3.6.90 \(\int \frac {(-1+x) (1+x)^3}{(1+x^2)^2 \sqrt {1+x^2+x^4}} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 39, normalized size of antiderivative = 0.85, number of steps used = 6, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {1687, 1586, 1698, 203, 1685, 802} \begin {gather*} \frac {2 \sqrt {x^4+x^2+1}}{x^2+1}-\tan ^{-1}\left (\frac {x}{\sqrt {x^4+x^2+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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])

Rule 802

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> -Si
mp[((e*f - d*g)*(d + e*x)^(m + 1)*(a + b*x + c*x^2)^(p + 1))/(2*(p + 1)*(c*d^2 - b*d*e + a*e^2)), x] /; FreeQ[
{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && EqQ[Simplify[m + 2*
p + 3], 0] && EqQ[b*(e*f + d*g) - 2*(c*d*f + a*e*g), 0]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1685

Int[(Px_)*(x_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2,
Subst[Int[(Px /. x -> Sqrt[x])*(d + e*x)^q*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, d, e, p, q}
, x] && PolyQ[Px, x^2]

Rule 1687

Int[(Pr_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{r = Expo
n[Pr, x], k}, Int[Sum[Coeff[Pr, x, 2*k]*x^(2*k), {k, 0, r/2}]*(d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x] + Int[x*
Sum[Coeff[Pr, x, 2*k + 1]*x^(2*k), {k, 0, (r - 1)/2}]*(d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b,
 c, d, e, p, q}, x] && PolyQ[Pr, x] &&  !PolyQ[Pr, x^2]

Rule 1698

Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> Dist[
A, Subst[Int[1/(d - (b*d - 2*a*e)*x^2), x], x, x/Sqrt[a + b*x^2 + c*x^4]], x] /; FreeQ[{a, b, c, d, e, A, B},
x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && EqQ[c*d^2 - a*e^2, 0] && EqQ[B*d + A*e, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [C]  time = 5.04, size = 709, normalized size = 15.41 \begin {gather*} \frac {2 \left (\frac {x^4+x^2+1}{x^2+1}-\frac {\sqrt [6]{-1} \sqrt {\frac {\left (\sqrt {3}-i\right ) \left (x-\sqrt [3]{-1}+1\right ) \left (2 x-i \sqrt {3}-1\right )}{\left (x+(-1)^{2/3}+1\right )^2}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{2 \left (\sqrt {3}+i\right ) x+4 i}} \left (x+(-1)^{2/3}+1\right )^2 F\left (\sin ^{-1}\left (\sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}}\right )|\frac {1}{4}\right )}{2 \sqrt {2} \sqrt [4]{3}}+\frac {\sqrt [6]{-1} \sqrt {\frac {-2 \sqrt {3} x+\sqrt {3}+3 i}{-2 i x+\sqrt {3}-i}} \sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{\left (\sqrt {3}+i\right ) x+2 i}} \left (x+(-1)^{2/3}+1\right )^2 \left (\left ((1+2 i)-i \sqrt {3}\right ) F\left (\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )+2 i \sqrt {3} \Pi \left (\frac {(1+2 i)+i \sqrt {3}}{(4+2 i)-2 \sqrt {3}};\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )\right )}{4 \sqrt {6}}-\frac {(-1)^{2/3} \sqrt {\frac {-2 \sqrt {3} x+\sqrt {3}+3 i}{-2 i x+\sqrt {3}-i}} \sqrt {\frac {i \sqrt {3} x+x+2}{x+(-1)^{2/3}+1}} \sqrt {\frac {2 \sqrt {3} x-\sqrt {3}+3 i}{\left (\sqrt {3}+i\right ) x+2 i}} \left (x+(-1)^{2/3}+1\right )^2 \left (\left (\sqrt {3}+(2+i)\right ) F\left (\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )-2 \sqrt {3} \Pi \left (\frac {(1-2 i)+i \sqrt {3}}{(4-2 i)+2 \sqrt {3}};\sin ^{-1}\left (\sqrt {\frac {2 \left (-i+\sqrt {3}\right ) x-4 i}{-2 i x+\sqrt {3}-i}}\right )|\frac {1}{4}\right )\right )}{4 \sqrt {6}}\right )}{\sqrt {x^4+x^2+1}} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

(2*((1 + x^2 + x^4)/(1 + x^2) - ((-1)^(1/6)*(1 + (-1)^(2/3) + x)^2*Sqrt[((-I + Sqrt[3])*(1 - (-1)^(1/3) + x)*(
-1 - I*Sqrt[3] + 2*x))/(1 + (-1)^(2/3) + x)^2]*Sqrt[(3*I - Sqrt[3] + 2*Sqrt[3]*x)/(4*I + 2*(I + Sqrt[3])*x)]*E
llipticF[ArcSin[Sqrt[(2 + x + I*Sqrt[3]*x)/(1 + (-1)^(2/3) + x)]], 1/4])/(2*Sqrt[2]*3^(1/4)) + ((-1)^(1/6)*(1
+ (-1)^(2/3) + x)^2*Sqrt[(3*I + Sqrt[3] - 2*Sqrt[3]*x)/(-I + Sqrt[3] - (2*I)*x)]*Sqrt[(2 + x + I*Sqrt[3]*x)/(1
 + (-1)^(2/3) + x)]*Sqrt[(3*I - Sqrt[3] + 2*Sqrt[3]*x)/(2*I + (I + Sqrt[3])*x)]*(((1 + 2*I) - I*Sqrt[3])*Ellip
ticF[ArcSin[Sqrt[(-4*I + 2*(-I + Sqrt[3])*x)/(-I + Sqrt[3] - (2*I)*x)]], 1/4] + (2*I)*Sqrt[3]*EllipticPi[((1 +
 2*I) + I*Sqrt[3])/((4 + 2*I) - 2*Sqrt[3]), ArcSin[Sqrt[(-4*I + 2*(-I + Sqrt[3])*x)/(-I + Sqrt[3] - (2*I)*x)]]
, 1/4]))/(4*Sqrt[6]) - ((-1)^(2/3)*(1 + (-1)^(2/3) + x)^2*Sqrt[(3*I + Sqrt[3] - 2*Sqrt[3]*x)/(-I + Sqrt[3] - (
2*I)*x)]*Sqrt[(2 + x + I*Sqrt[3]*x)/(1 + (-1)^(2/3) + x)]*Sqrt[(3*I - Sqrt[3] + 2*Sqrt[3]*x)/(2*I + (I + Sqrt[
3])*x)]*(((2 + I) + Sqrt[3])*EllipticF[ArcSin[Sqrt[(-4*I + 2*(-I + Sqrt[3])*x)/(-I + Sqrt[3] - (2*I)*x)]], 1/4
] - 2*Sqrt[3]*EllipticPi[((1 - 2*I) + I*Sqrt[3])/((4 - 2*I) + 2*Sqrt[3]), ArcSin[Sqrt[(-4*I + 2*(-I + Sqrt[3])
*x)/(-I + Sqrt[3] - (2*I)*x)]], 1/4]))/(4*Sqrt[6])))/Sqrt[1 + x^2 + x^4]

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.58, size = 46, normalized size = 1.00 \begin {gather*} \frac {2 \sqrt {1+x^2+x^4}}{1+x^2}-2 \tan ^{-1}\left (\frac {x}{1+x^2+\sqrt {1+x^2+x^4}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 41, normalized size = 0.89 \begin {gather*} -\frac {{\left (x^{2} + 1\right )} \arctan \left (\frac {x}{\sqrt {x^{4} + x^{2} + 1}}\right ) - 2 \, \sqrt {x^{4} + x^{2} + 1}}{x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (x + 1\right )}^{3} {\left (x - 1\right )}}{\sqrt {x^{4} + x^{2} + 1} {\left (x^{2} + 1\right )}^{2}}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((x + 1)^3*(x - 1)/(sqrt(x^4 + x^2 + 1)*(x^2 + 1)^2), x)

________________________________________________________________________________________

maple [A]  time = 0.34, size = 36, normalized size = 0.78

method result size
elliptic \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\arctan \left (\frac {\sqrt {x^{4}+x^{2}+1}}{x}\right )\) \(36\)
trager \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+1\right ) x +\sqrt {x^{4}+x^{2}+1}}{x^{2}+1}\right )\) \(56\)
risch \(\frac {2 \sqrt {x^{4}+x^{2}+1}}{x^{2}+1}+\frac {2 \sqrt {1-\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \sqrt {1-\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \EllipticF \left (\frac {x \sqrt {-2+2 i \sqrt {3}}}{2}, \frac {\sqrt {-2+2 i \sqrt {3}}}{2}\right )}{\sqrt {-2+2 i \sqrt {3}}\, \sqrt {x^{4}+x^{2}+1}}-\frac {2 \sqrt {1+\frac {x^{2}}{2}-\frac {i \sqrt {3}\, x^{2}}{2}}\, \sqrt {1+\frac {x^{2}}{2}+\frac {i \sqrt {3}\, x^{2}}{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , -\frac {1}{-\frac {1}{2}+\frac {i \sqrt {3}}{2}}, \frac {\sqrt {-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, \sqrt {x^{4}+x^{2}+1}}\) \(207\)
default \(\frac {2 \sqrt {1-\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \sqrt {1-\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) x^{2}}\, \EllipticF \left (\frac {x \sqrt {-2+2 i \sqrt {3}}}{2}, \frac {\sqrt {-2+2 i \sqrt {3}}}{2}\right )}{\sqrt {-2+2 i \sqrt {3}}\, \sqrt {x^{4}+x^{2}+1}}+\arctanh \left (\frac {x^{2}}{2 \sqrt {x^{4}+x^{2}+1}}-\frac {1}{2 \sqrt {x^{4}+x^{2}+1}}\right )-\frac {2 \sqrt {1+\frac {x^{2}}{2}-\frac {i \sqrt {3}\, x^{2}}{2}}\, \sqrt {1+\frac {x^{2}}{2}+\frac {i \sqrt {3}\, x^{2}}{2}}\, \EllipticPi \left (\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, x , -\frac {1}{-\frac {1}{2}+\frac {i \sqrt {3}}{2}}, \frac {\sqrt {-\frac {1}{2}-\frac {i \sqrt {3}}{2}}}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}}\right )}{\sqrt {-\frac {1}{2}+\frac {i \sqrt {3}}{2}}\, \sqrt {x^{4}+x^{2}+1}}+\frac {2 \sqrt {\left (x^{2}+1\right )^{2}-x^{2}}}{x^{2}+1}+\arctanh \left (\frac {-x^{2}+1}{2 \sqrt {\left (x^{2}+1\right )^{2}-x^{2}}}\right )\) \(266\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (x + 1\right )}^{3} {\left (x - 1\right )}}{\sqrt {x^{4} + x^{2} + 1} {\left (x^{2} + 1\right )}^{2}}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((x + 1)^3*(x - 1)/(sqrt(x^4 + x^2 + 1)*(x^2 + 1)^2), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\left (x-1\right )\,{\left (x+1\right )}^3}{{\left (x^2+1\right )}^2\,\sqrt {x^4+x^2+1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (x - 1\right ) \left (x + 1\right )^{3}}{\sqrt {\left (x^{2} - x + 1\right ) \left (x^{2} + x + 1\right )} \left (x^{2} + 1\right )^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((x - 1)*(x + 1)**3/(sqrt((x**2 - x + 1)*(x**2 + x + 1))*(x**2 + 1)**2), x)

________________________________________________________________________________________