$MaxExtraPrecision  =  5000

Clear[C1, c, Den, DenNor, E1, fac, H, h, J, lambda, M1, M2, newint, 
        nu, Num, NumNor, orig, p, P, Q, r, run1, R1, Rone, Rtwo, s, T, 
        Z];

(* 
      A good CHANGE OF VARIABLES is worth  a thousand tricks *)

P[z_, m_] := P[z, m] = 
          Sum[(-1)^i*Binomial[m, 2*i]*z^(m - 2*i), {i, 0, 
              Floor[m/2]}];

Q[z_, m_] := Q[z, m] = 
          Sum[(-1)^i*Binomial[m, 2*i + 1]*z^(m - 1 - 2*i), {i, 0, 
              Floor[(m - 1)/2]}];

drawing[m_, range1_, range2_] := 
        Plot[P[z, m]/Q[z, m], {z, range1, range2}];

drawing[4, -2, 2]

cocheck[m_, x_] := P[Cot[x], m]/Q[Cot[x], m]/
          Cot[m*x];

cocheck[6, x]

FullSimplify[cocheck[6, x]]

(m := 0) && 
      While[m ≤ 
          3, (Print[m, "     ", P[z, m], "       ", 
            Q[z, m]]; m++)]

Rone[x_] := Rone[x] = 1/(x^4 + 2*x^2 + 6);

orig := 
        Integrate[Rone[x], {x, -Infinity, Infinity}];

orig

Rtwo[x_] := 
        2*(9 + 4*x^2)/(96*x^4 + 152*x^2 + 81);

newint := 
        Integrate[Rtwo[x], {x, -Infinity, Infinity}];

newint

FullSimplify[orig - newint]

R1[x_, 0, m_] := Rone[x];

R1[x, 0, 2]

Num[x_, y_, m_] := Num[x, y, m] = 
          Expand[Numerator[Together[R1[x, y, m]]]];

Den[x_, y_, m_] := Den[x, y, m] = 
          Expand[Denominator[Together[R1[x, y, m]]]];

p[y_, m_] := p[y, m] = Exponent[Den[x, y, m], x];

Resultant[a*x^2 + b*x + c, 2*a*x + b, x] // Factor

Resultant[x^3 + a*x + b, 3*x^2 + a, x]

H[x_, y_, m_] := H[x, y, m] = 
          Resultant[Den[z1, y, m], P[z1, m] - x1*Q[z1, m], 
              z1] /. {x1 -> x};

h[i_, y_, m_] := h[i, y, m] = 
          Coefficient[H[x, y, m], x, p[y, m] - i];

E1[x_, y_, m_] := E1[x, y, m] = 
          Collect[Sum[
              h[i, y, m]*(P[x, m])^(p[y, m] - i)*(Q[x, m])^i, {i, 
                0, p[y, m]}], x];

Z[x_, y_, m_] := Z[x, y, m] = 
          Collect[E1[x, y, m]/Den[x, y, m] // FullSimplify, 
            x];

C1[x_, y_, m_] := C1[x, y, m] = 
          Collect[Z[x, y, m]*Num[x, y, m], x];

c[j_, y_, m_] := c[j, y, m] = 
          Coefficient[C1[x, y, m], x, m*p[y, m] - 2 - j];

T[x_, a_, b_] := T[x, a, b] = 
          Sum[(-1)^(a - x + j)*Binomial[a, x - j]*
              Binomial[b, j], {j, 0, x}];

s[m_, y_] := s[m, y] = m*p[y, m] - 2;

r[m_, y_] := r[m, y] = (m - 1)*p[y, m];

lambda[m_, y_] := lambda[m, y] = s[m, y]/2;

nu[y_, m_] := nu[y, m] = p[y, m]/2;

M1[j_, alpha_, beta_, gamma_, m_, 
          y_] := M1[j, alpha, beta, gamma, m, 
            y] = (-1)^(j + alpha - beta)*
            c[2*j, y, m]*2^(2*(alpha - beta))*
            alpha*(1/(2*alpha - beta))*Binomial[2*alpha - beta, beta]*
            Binomial[nu[y, m] - alpha - 1 + beta, 
              gamma]*(T[lambda[m, y] + alpha*m, 2*j, s[m, y] - 2*j] + 
                T[lambda[m, y] - alpha*m, 2*j, 
                  s[m, y] - 2*j]);

M2[j_, alpha_, beta_, gamma_, m_, 
          y_] := M2[j, alpha, beta, gamma, m, 
            y] = (-1)^(j + beta)*
            c[2*j + 1, y, m]*2^(2*beta + 1)*
            Binomial[alpha + beta, 2*beta + 1]*
            Binomial[nu[y, m] - 2 - beta, 
              gamma]*(T[lambda[m, y] + alpha*m, 2*j + 1, 
                  s[m, y] - 2*j - 1] - 
                T[lambda[m, y] - alpha*m, 2*j + 1, 
                  s[m, y] - 2*j - 1]);

(* 
      FINALLY we have the numerator of the new rational function *)

J[x_, y_, m_] := J[x, y, m] = 
          2^(-s[m, y])*
                Sum[Binomial[nu[y, m] - 1, gamma]*
                    Sum[(-1)^j*c[2*j, y, m]*
                        T[lambda[m, y], 2*j, s[m, y] - 2*j], {j, 0, 
                        lambda[m, y]}]*x^(2*gamma), {gamma, 0, 
                    nu[y, m] - 1}] + 
              2^(-s[m, y])*
                Sum[Sum[
                      Sum[Sum[
                          M1[j, alpha, beta, gamma, m, y], {beta, 0, 
                            alpha}], {alpha, 1, nu[y, m] - 1 - gamma}], {j, 
                        0, lambda[m, y]}]*x^(2*gamma), {gamma, 0, 
                    nu[y, m] - 2}] +  
              2^(-s[m, y])*
                Sum[Sum[
                      Sum[Sum[
                          M1[j, alpha, beta, gamma, m, y], {beta, 
                            alpha - nu[y, m] + gamma + 1, alpha}], {alpha, 
                          nu[y, m] - gamma, nu[y, m] - 1}], {j, 0, 
                        lambda[m, y]}]*x^(2*gamma), {gamma, 1, 
                    nu[y, m] - 1}] + 
              2^(-s[m, y])*
                Sum[Sum[
                      Sum[Sum[
                          M2[j, alpha, beta, gamma, m, y], {beta, 0, 
                            alpha - 1}], {alpha, 1, 
                          nu[y, m] - 1 - gamma}], {j, 0, lambda[m, y] - 1}]*
                    x^(2*gamma + 1), {gamma, 0, nu[y, m] - 2}] +  
              2^(-s[m, y])*
                Sum[Sum[
                      Sum[Sum[
                          M2[j, alpha, beta, gamma, m, y], {beta, 0, 
                            alpha - 1}], {alpha, nu[y, m] - gamma, 
                          nu[y, m] - 1}], {j, 0, lambda[m, y] - 1}]*
                    x^(2*gamma + 1), {gamma, 1, nu[y, m] - 2}] // 
            Expand;

R1[x_, y_, 
          m_] := R1[x, y, 
            m] = If[y == 0, Rone[x], J[x, y - 1, m]/H[x, y - 1, m]] // 
              FullSimplify // Together;

(*                NOW WE SEE THE SEQUENCES *)

Rone[x]

R1[x, 0, 2]

R1[x, 1, 2]

Rtwo[x]

R1[x, 2, 2]

Integrate[R1[x, 2, 2], {x, -Infinity, Infinity}]

newint

R1[x, 0, 2]

R1[x, 1, 2]

R1[x, 2, 2]

R1[x, 3, 2]

NumNor[x_, y_, m_] := NumNor[x, y, m] = 
          Num[x, y, m]/
              Coefficient[Num[x, y, m], x, Exponent[Num[x, y, m], x]] // 
            Expand;

DenNor[x_, y_, m_] := DenNor[x, y, m] = 
          Den[x, y, m]/
              Coefficient[Den[x, y, m], x, Exponent[Den[x, y, m], x]] // 
            Expand;

fac[x_, y_, m_] := fac[x, y, m] = 
          Coefficient[Num[x, y, m], x, Exponent[Num[x, y, m], x]]/
            Coefficient[Den[x, y, m], x, 
              Exponent[Den[x, y, m], x]];

NumNor[x, 3, 2]

DenNor[x, 3, 2]

fac[x, 3, 2]

R1[x, 3, 2]

fac[x, 3, 2]*(NumNor[x, 3, 2]/DenNor[x, 3, 2]) // 
      FullSimplify

R1[x, 3, 2] - fac[x, 3, 2]*(NumNor[x, 3, 2]/DenNor[x, 3, 2]) // 
      FullSimplify

(y := 0) && 
      While[y ≤ 
          5, (Print[y, " *  ", fac[x, y, 2], "  * ", 
            N[fac[x, y, 2]*Pi], "  *  ", N[orig], "   ** ", 
            NumNor[x, y, 2], "   ** ", 
            DenNor[x, y, 2]]; y++)]

N[((1123453313 )/561121344), 20]

ContinuedFraction[((1123453313 )/561121344)]

N[((438809377505902913 )/219404660484006144), 20]

ContinuedFraction[((438809377505902913 )/219404660484006144)]

r[u1_, i_, tol_] := 
        If[ContinuedFraction[u1][[i]] > tol, 1, 0];
stop[u1_, tol_] := 
        If[Length[
              Position[
                Table[r[u1, i, tol], {i, 1, Length[ContinuedFraction[u1]]}], 
                1]] == 0, 
          Length[ContinuedFraction[
              u1]], Flatten[
                Position[
                  Table[r[u1, i, tol], {i, 1, 
                      Length[ContinuedFraction[u1]]}], 1]][[1]] - 
            1];
small[u1_, tol_] := 
      Table[ContinuedFraction[u1][[i]], {i, 1, 
          stop[u1, tol]}]
smallvalue[u1_, tol_] := 
        FromContinuedFraction[small[u1, tol]];

NewNum[x_, y_, m_, tol_] := NewNum[x, y, m, tol] = 
          Sum[smallvalue[Coefficient[NumNor[x, y, m], x, j], tol]*x^j, {j, 0, 
              Exponent[NumNor[x, y, m], x]}];
NewDen[x_, y_, m_, tol_] := NewDen[x, y, m, tol] = 
          Sum[smallvalue[Coefficient[DenNor[x, y, m], x, j], tol]*x^j, {j, 0, 
              Exponent[DenNor[x, y, m], x]}];

{NumNor[x, 2, 2], NewNum[x, 2, 2, 10]}

{DenNor[x, 2, 2], NewDen[x, 2, 2, 10]}

ContinuedFraction[(108241/124416)]

run1[m_, max_, 
        tol_] := run1[m, max, tol] = (y := 0) && 
          While[y ≤ 
              max, (Print[y, " *  ", 
                smallvalue[fac[x, y, m], tol], "  * ", 
                N[N[fac[x, y, m]*Pi - orig, 100], 10], " ** ", 
                NewNum[x, y, m, tol], "   ** ", 
                NewDen[x, y, m, tol]]; y++)]

run1[2, 5, 10]