### 3.86 $$\int \frac{4+x^2+3 x^4+5 x^6}{(2+3 x^2+x^4)^2} \, dx$$

Optimal. Leaf size=48 $-\frac{x \left (12 x^2+11\right )}{2 \left (x^4+3 x^2+2\right )}+\frac{17}{2} \tan ^{-1}(x)-\frac{19 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{2 \sqrt{2}}$

[Out]

-(x*(11 + 12*x^2))/(2*(2 + 3*x^2 + x^4)) + (17*ArcTan[x])/2 - (19*ArcTan[x/Sqrt[2]])/(2*Sqrt[2])

________________________________________________________________________________________

Rubi [A]  time = 0.0280516, antiderivative size = 48, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 28, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.107, Rules used = {1678, 1166, 203} $-\frac{x \left (12 x^2+11\right )}{2 \left (x^4+3 x^2+2\right )}+\frac{17}{2} \tan ^{-1}(x)-\frac{19 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{2 \sqrt{2}}$

Antiderivative was successfully veriﬁed.

[In]

Int[(4 + x^2 + 3*x^4 + 5*x^6)/(2 + 3*x^2 + x^4)^2,x]

[Out]

-(x*(11 + 12*x^2))/(2*(2 + 3*x^2 + x^4)) + (17*ArcTan[x])/2 - (19*ArcTan[x/Sqrt[2]])/(2*Sqrt[2])

Rule 1678

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> With[{d = Coeff[PolynomialRemainder[Pq, a +
b*x^2 + c*x^4, x], x, 0], e = Coeff[PolynomialRemainder[Pq, a + b*x^2 + c*x^4, x], x, 2]}, Simp[(x*(a + b*x^2
+ c*x^4)^(p + 1)*(a*b*e - d*(b^2 - 2*a*c) - c*(b*d - 2*a*e)*x^2))/(2*a*(p + 1)*(b^2 - 4*a*c)), x] + Dist[1/(2*
a*(p + 1)*(b^2 - 4*a*c)), Int[(a + b*x^2 + c*x^4)^(p + 1)*ExpandToSum[2*a*(p + 1)*(b^2 - 4*a*c)*PolynomialQuot
ient[Pq, a + b*x^2 + c*x^4, x] + b^2*d*(2*p + 3) - 2*a*c*d*(4*p + 5) - a*b*e + c*(4*p + 7)*(b*d - 2*a*e)*x^2,
x], x], x]] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x^2] && Expon[Pq, x^2] > 1 && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1
]

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{4+x^2+3 x^4+5 x^6}{\left (2+3 x^2+x^4\right )^2} \, dx &=-\frac{x \left (11+12 x^2\right )}{2 \left (2+3 x^2+x^4\right )}-\frac{1}{4} \int \frac{-30+4 x^2}{2+3 x^2+x^4} \, dx\\ &=-\frac{x \left (11+12 x^2\right )}{2 \left (2+3 x^2+x^4\right )}+\frac{17}{2} \int \frac{1}{1+x^2} \, dx-\frac{19}{2} \int \frac{1}{2+x^2} \, dx\\ &=-\frac{x \left (11+12 x^2\right )}{2 \left (2+3 x^2+x^4\right )}+\frac{17}{2} \tan ^{-1}(x)-\frac{19 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{2 \sqrt{2}}\\ \end{align*}

Mathematica [A]  time = 0.0405299, size = 46, normalized size = 0.96 $\frac{1}{4} \left (-\frac{2 x \left (12 x^2+11\right )}{x^4+3 x^2+2}+34 \tan ^{-1}(x)-19 \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )\right )$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(4 + x^2 + 3*x^4 + 5*x^6)/(2 + 3*x^2 + x^4)^2,x]

[Out]

((-2*x*(11 + 12*x^2))/(2 + 3*x^2 + x^4) + 34*ArcTan[x] - 19*Sqrt[2]*ArcTan[x/Sqrt[2]])/4

________________________________________________________________________________________

Maple [A]  time = 0.011, size = 38, normalized size = 0.8 \begin{align*} -{\frac{13\,x}{2\,{x}^{2}+4}}-{\frac{19\,\sqrt{2}}{4}\arctan \left ({\frac{x\sqrt{2}}{2}} \right ) }+{\frac{x}{2\,{x}^{2}+2}}+{\frac{17\,\arctan \left ( x \right ) }{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((5*x^6+3*x^4+x^2+4)/(x^4+3*x^2+2)^2,x)

[Out]

-13/2*x/(x^2+2)-19/4*arctan(1/2*x*2^(1/2))*2^(1/2)+1/2*x/(x^2+1)+17/2*arctan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.49892, size = 54, normalized size = 1.12 \begin{align*} -\frac{19}{4} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) - \frac{12 \, x^{3} + 11 \, x}{2 \,{\left (x^{4} + 3 \, x^{2} + 2\right )}} + \frac{17}{2} \, \arctan \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^6+3*x^4+x^2+4)/(x^4+3*x^2+2)^2,x, algorithm="maxima")

[Out]

-19/4*sqrt(2)*arctan(1/2*sqrt(2)*x) - 1/2*(12*x^3 + 11*x)/(x^4 + 3*x^2 + 2) + 17/2*arctan(x)

________________________________________________________________________________________

Fricas [A]  time = 2.05986, size = 170, normalized size = 3.54 \begin{align*} -\frac{24 \, x^{3} + 19 \, \sqrt{2}{\left (x^{4} + 3 \, x^{2} + 2\right )} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) - 34 \,{\left (x^{4} + 3 \, x^{2} + 2\right )} \arctan \left (x\right ) + 22 \, x}{4 \,{\left (x^{4} + 3 \, x^{2} + 2\right )}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^6+3*x^4+x^2+4)/(x^4+3*x^2+2)^2,x, algorithm="fricas")

[Out]

-1/4*(24*x^3 + 19*sqrt(2)*(x^4 + 3*x^2 + 2)*arctan(1/2*sqrt(2)*x) - 34*(x^4 + 3*x^2 + 2)*arctan(x) + 22*x)/(x^
4 + 3*x^2 + 2)

________________________________________________________________________________________

Sympy [A]  time = 0.181602, size = 44, normalized size = 0.92 \begin{align*} - \frac{12 x^{3} + 11 x}{2 x^{4} + 6 x^{2} + 4} + \frac{17 \operatorname{atan}{\left (x \right )}}{2} - \frac{19 \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} x}{2} \right )}}{4} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x**6+3*x**4+x**2+4)/(x**4+3*x**2+2)**2,x)

[Out]

-(12*x**3 + 11*x)/(2*x**4 + 6*x**2 + 4) + 17*atan(x)/2 - 19*sqrt(2)*atan(sqrt(2)*x/2)/4

________________________________________________________________________________________

Giac [A]  time = 1.08092, size = 54, normalized size = 1.12 \begin{align*} -\frac{19}{4} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) - \frac{12 \, x^{3} + 11 \, x}{2 \,{\left (x^{4} + 3 \, x^{2} + 2\right )}} + \frac{17}{2} \, \arctan \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((5*x^6+3*x^4+x^2+4)/(x^4+3*x^2+2)^2,x, algorithm="giac")

[Out]

-19/4*sqrt(2)*arctan(1/2*sqrt(2)*x) - 1/2*(12*x^3 + 11*x)/(x^4 + 3*x^2 + 2) + 17/2*arctan(x)