3.1.14 \(\int \frac {6-3 x^2+x^4}{4+5 x^2-5 x^4+x^6} \, dx\) [14]

Optimal. Leaf size=39 \[ -\tan ^{-1}\left (\sqrt {3}-2 x\right )+\tan ^{-1}\left (\sqrt {3}+2 x\right )+\tan ^{-1}\left (\frac {1}{2} x \left (1-3 x^2+x^4\right )\right ) \]

[Out]

arctan(1/2*x*(x^4-3*x^2+1))+arctan(2*x-3^(1/2))+arctan(2*x+3^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.036, Rules used = {2120} \begin {gather*} \tan ^{-1}\left (\frac {1}{2} x \left (x^4-3 x^2+1\right )\right )-\tan ^{-1}\left (\sqrt {3}-2 x\right )+\tan ^{-1}\left (2 x+\sqrt {3}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-ArcTan[Sqrt[3] - 2*x] + ArcTan[Sqrt[3] + 2*x] + ArcTan[(x*(1 - 3*x^2 + x^4))/2]

Rule 2120

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)/((d_) + (e_.)*(x_)^2 + (f_.)*(x_)^4 + (g_.)*(x_)^6), x_Symbol] :> Wit
h[{q = Rt[((-a)*c*f^2 + 12*a^2*g^2 + f*(3*c^2*d - 2*a*b*g))/(c*g*(3*c*d - a*f)), 2], r = Rt[(a*c*f^2 + 4*g*(b*
c*d + a^2*g) - f*(3*c^2*d + 2*a*b*g))/(c*g*(3*c*d - a*f)), 2]}, Simp[(c/(g*q))*ArcTan[(r + 2*x)/q], x] + (-Sim
p[(c/(g*q))*ArcTan[(r - 2*x)/q], x] - Simp[(c/(g*q))*ArcTan[(3*c*d - a*f)*(x/(g*q*(b*c*d - 2*a^2*g)*(b*c*d - a
*b*f + 4*a^2*g)))*(b*c^2*d*f - a*b^2*f*g - 2*a^2*c*f*g + 6*a^2*b*g^2 + c*(3*c^2*d*f - a*c*f^2 - b*c*d*g + 2*a^
2*g^2)*x^2 + c^2*g*(3*c*d - a*f)*x^4)], x])] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[9*c^3*d^2 - c*(b^2 + 6*
a*c)*d*f + a^2*c*f^2 + 2*a*b*(3*c*d + a*f)*g - 12*a^3*g^2, 0] && EqQ[3*c^4*d^2*e - 3*a^2*c^2*d*f*g + a^3*c*f^2
*g + 2*a^3*g^2*(b*f - 6*a*g) - c^3*d*(2*b*d*f + a*e*f - 12*a*d*g), 0] && NeQ[3*c*d - a*f, 0] && NeQ[b*c*d - 2*
a^2*g, 0] && NeQ[b*c*d - a*b*f + 4*a^2*g, 0] && PosQ[((-a)*c*f^2 + 12*a^2*g^2 + f*(3*c^2*d - 2*a*b*g))/(c*g*(3
*c*d - a*f))]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 41, normalized size = 1.05 \begin {gather*} -\frac {1}{2} \tan ^{-1}\left (\frac {x \left (-3+x^2\right )}{2-x^2}\right )+\frac {1}{2} \tan ^{-1}\left (\frac {x \left (-3+x^2\right )}{-2+x^2}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/2*ArcTan[(x*(-3 + x^2))/(2 - x^2)] + ArcTan[(x*(-3 + x^2))/(-2 + x^2)]/2

________________________________________________________________________________________

Mathics [A]
time = 1.70, size = 21, normalized size = 0.54 \begin {gather*} \text {ArcTan}\left [x\right ]+\text {ArcTan}\left [\frac {x \left (1-3 x^2+x^4\right )}{2}\right ]+\text {ArcTan}\left [x^3\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] + ArcTan[x (1 - 3 x ^ 2 + x ^ 4) / 2] + ArcTan[x ^ 3]

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 0.02, size = 40, normalized size = 1.03

method result size
risch \(\arctan \left (\frac {1}{2} x^{5}-\frac {3}{2} x^{3}+\frac {1}{2} x \right )+\arctan \left (x^{3}\right )+\arctan \left (x \right )\) \(23\)
default \(\frac {i \ln \left (x^{3}+i x^{2}-3 x -2 i\right )}{2}-\frac {i \ln \left (x^{3}-i x^{2}-3 x +2 i\right )}{2}\) \(40\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^4-3*x^2+6)/(x^6-5*x^4+5*x^2+4),x,method=_RETURNVERBOSE)

[Out]

1/2*I*ln(I*x^2+x^3-2*I-3*x)-1/2*I*ln(-I*x^2+x^3+2*I-3*x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 22, normalized size = 0.56 \begin {gather*} \arctan \left (\frac {1}{2} \, x^{5} - \frac {3}{2} \, x^{3} + \frac {1}{2} \, x\right ) + \arctan \left (x^{3}\right ) + \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(1/2*x^5 - 3/2*x^3 + 1/2*x) + arctan(x^3) + arctan(x)

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 24, normalized size = 0.62 \begin {gather*} \operatorname {atan}{\left (x \right )} + \operatorname {atan}{\left (x^{3} \right )} + \operatorname {atan}{\left (\frac {x^{5}}{2} - \frac {3 x^{3}}{2} + \frac {x}{2} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

atan(x) + atan(x**3) + atan(x**5/2 - 3*x**3/2 + x/2)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 22, normalized size = 0.56 \begin {gather*} \arctan x+\arctan \left (x^{3}\right )+\arctan \left (\frac {x^{5}-3 x^{3}+x}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(1/2*x^5 - 3/2*x^3 + 1/2*x) + arctan(x^3) + arctan(x)

________________________________________________________________________________________

Mupad [B]
time = 0.27, size = 22, normalized size = 0.56 \begin {gather*} \mathrm {atan}\left (\frac {x^5}{2}-\frac {3\,x^3}{2}+\frac {x}{2}\right )+\mathrm {atan}\left (x^3\right )+\mathrm {atan}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

atan(x/2 - (3*x^3)/2 + x^5/2) + atan(x^3) + atan(x)

________________________________________________________________________________________