\(\int \frac {\sqrt {1+x} (-1+x^2)}{(1+x^2) \sqrt {1+\sqrt {1+x}}} \, dx\) [1882]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [N/A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F(-1)]
   Maxima [N/A]
   Giac [F(-2)]
   Mupad [N/A]

Optimal result

Integrand size = 33, antiderivative size = 130 \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=-\frac {16}{15} \sqrt {1+x} \sqrt {1+\sqrt {1+x}}+\frac {4}{15} (11+3 x) \sqrt {1+\sqrt {1+x}}-\text {RootSum}\left [1+4 \text {$\#$1}^4-4 \text {$\#$1}^6+\text {$\#$1}^8\&,\frac {-\log \left (\sqrt {1+\sqrt {1+x}}-\text {$\#$1}\right )+\log \left (\sqrt {1+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^2}{-2 \text {$\#$1}^3+\text {$\#$1}^5}\&\right ] \]

[Out]

Unintegrable

Rubi [F]

\[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx \]

[In]

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

[Out]

4*Sqrt[1 + Sqrt[1 + x]] - (8*(1 + Sqrt[1 + x])^(3/2))/3 + (4*(1 + Sqrt[1 + x])^(5/2))/5 - 8*Defer[Subst][Defer
[Int][(1 + 4*x^4 - 4*x^6 + x^8)^(-1), x], x, Sqrt[1 + Sqrt[1 + x]]] + 16*Defer[Subst][Defer[Int][x^2/(1 + 4*x^
4 - 4*x^6 + x^8), x], x, Sqrt[1 + Sqrt[1 + x]]] - 8*Defer[Subst][Defer[Int][x^4/(1 + 4*x^4 - 4*x^6 + x^8), x],
 x, Sqrt[1 + Sqrt[1 + x]]]

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {x^4 \left (-2+x^2\right )}{\sqrt {1+x} \left (2-2 x^2+x^4\right )} \, dx,x,\sqrt {1+x}\right ) \\ & = 4 \text {Subst}\left (\int \frac {\left (-1+x^2\right )^4 \left (-1-2 x^2+x^4\right )}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \text {Subst}\left (\int \left (1-2 x^2+x^4-\frac {2 \left (1-2 x^2+x^4\right )}{1+4 x^4-4 x^6+x^8}\right ) \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}-\frac {8}{3} \left (1+\sqrt {1+x}\right )^{3/2}+\frac {4}{5} \left (1+\sqrt {1+x}\right )^{5/2}-8 \text {Subst}\left (\int \frac {1-2 x^2+x^4}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}-\frac {8}{3} \left (1+\sqrt {1+x}\right )^{3/2}+\frac {4}{5} \left (1+\sqrt {1+x}\right )^{5/2}-8 \text {Subst}\left (\int \frac {\left (-1+x^2\right )^2}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}-\frac {8}{3} \left (1+\sqrt {1+x}\right )^{3/2}+\frac {4}{5} \left (1+\sqrt {1+x}\right )^{5/2}-8 \text {Subst}\left (\int \left (\frac {1}{1+4 x^4-4 x^6+x^8}-\frac {2 x^2}{1+4 x^4-4 x^6+x^8}+\frac {x^4}{1+4 x^4-4 x^6+x^8}\right ) \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}-\frac {8}{3} \left (1+\sqrt {1+x}\right )^{3/2}+\frac {4}{5} \left (1+\sqrt {1+x}\right )^{5/2}-8 \text {Subst}\left (\int \frac {1}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right )-8 \text {Subst}\left (\int \frac {x^4}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right )+16 \text {Subst}\left (\int \frac {x^2}{1+4 x^4-4 x^6+x^8} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.90 \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\frac {4}{15} \sqrt {1+\sqrt {1+x}} \left (8-4 \sqrt {1+x}+3 (1+x)\right )-\text {RootSum}\left [1+4 \text {$\#$1}^4-4 \text {$\#$1}^6+\text {$\#$1}^8\&,\frac {-\log \left (\sqrt {1+\sqrt {1+x}}-\text {$\#$1}\right )+\log \left (\sqrt {1+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^2}{-2 \text {$\#$1}^3+\text {$\#$1}^5}\&\right ] \]

[In]

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

[Out]

(4*Sqrt[1 + Sqrt[1 + x]]*(8 - 4*Sqrt[1 + x] + 3*(1 + x)))/15 - RootSum[1 + 4*#1^4 - 4*#1^6 + #1^8 & , (-Log[Sq
rt[1 + Sqrt[1 + x]] - #1] + Log[Sqrt[1 + Sqrt[1 + x]] - #1]*#1^2)/(-2*#1^3 + #1^5) & ]

Maple [N/A] (verified)

Time = 0.16 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.75

method result size
derivativedivides \(\frac {4 \left (1+\sqrt {1+x}\right )^{\frac {5}{2}}}{5}-\frac {8 \left (1+\sqrt {1+x}\right )^{\frac {3}{2}}}{3}+4 \sqrt {1+\sqrt {1+x}}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{8}-4 \textit {\_Z}^{6}+4 \textit {\_Z}^{4}+1\right )}{\sum }\frac {\left (-\textit {\_R}^{4}+2 \textit {\_R}^{2}-1\right ) \ln \left (\sqrt {1+\sqrt {1+x}}-\textit {\_R} \right )}{\textit {\_R}^{7}-3 \textit {\_R}^{5}+2 \textit {\_R}^{3}}\right )\) \(97\)
default \(\frac {4 \left (1+\sqrt {1+x}\right )^{\frac {5}{2}}}{5}-\frac {8 \left (1+\sqrt {1+x}\right )^{\frac {3}{2}}}{3}+4 \sqrt {1+\sqrt {1+x}}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{8}-4 \textit {\_Z}^{6}+4 \textit {\_Z}^{4}+1\right )}{\sum }\frac {\left (-\textit {\_R}^{4}+2 \textit {\_R}^{2}-1\right ) \ln \left (\sqrt {1+\sqrt {1+x}}-\textit {\_R} \right )}{\textit {\_R}^{7}-3 \textit {\_R}^{5}+2 \textit {\_R}^{3}}\right )\) \(97\)

[In]

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

[Out]

4/5*(1+(1+x)^(1/2))^(5/2)-8/3*(1+(1+x)^(1/2))^(3/2)+4*(1+(1+x)^(1/2))^(1/2)+sum((-_R^4+2*_R^2-1)/(_R^7-3*_R^5+
2*_R^3)*ln((1+(1+x)^(1/2))^(1/2)-_R),_R=RootOf(_Z^8-4*_Z^6+4*_Z^4+1))

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 3 vs. order 1.

Time = 1.03 (sec) , antiderivative size = 1268, normalized size of antiderivative = 9.75 \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\text {Too large to display} \]

[In]

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

[Out]

4/15*(3*x - 4*sqrt(x + 1) + 11)*sqrt(sqrt(x + 1) + 1) + 1/2*sqrt(sqrt(8*I + 8) + sqrt(-8*I + 8) + 2*sqrt(-3/4*
(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) +
 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4)*log(1/8*((sqrt(8*I + 8) - 2*I - 2)^2*(3*sqrt(-8*I + 8) + 6*I -
10) + (3*(sqrt(-8*I + 8) + 2*I - 2)^2 + 24*sqrt(-8*I + 8) + 48*I - 88)*(sqrt(8*I + 8) - 2*I - 2) - 4*(sqrt(-8*
I + 8) + 2*I - 2)^2 - 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8)
+ 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8)*((sqrt(8*I + 8) - 2*I - 2)*(3*sqrt
(-8*I + 8) + 6*I - 10) - 4*sqrt(-8*I + 8) - 8*I + 16) - 40*sqrt(-8*I + 8) - 80*I + 80)*sqrt(sqrt(8*I + 8) + sq
rt(-8*I + 8) + 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I +
 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4) + 32*sqrt(sqrt(x + 1) + 1)) - 1/2*sq
rt(sqrt(8*I + 8) + sqrt(-8*I + 8) + 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(s
qrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4)*log(-1/8*((sqrt
(8*I + 8) - 2*I - 2)^2*(3*sqrt(-8*I + 8) + 6*I - 10) + (3*(sqrt(-8*I + 8) + 2*I - 2)^2 + 24*sqrt(-8*I + 8) + 4
8*I - 88)*(sqrt(8*I + 8) - 2*I - 2) - 4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2
 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I +
 8) - 8*I + 8)*((sqrt(8*I + 8) - 2*I - 2)*(3*sqrt(-8*I + 8) + 6*I - 10) - 4*sqrt(-8*I + 8) - 8*I + 16) - 40*sq
rt(-8*I + 8) - 80*I + 80)*sqrt(sqrt(8*I + 8) + sqrt(-8*I + 8) + 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*
(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8
*I + 8) + 4) + 32*sqrt(sqrt(x + 1) + 1)) + 1/2*sqrt(sqrt(8*I + 8) + sqrt(-8*I + 8) - 2*sqrt(-3/4*(sqrt(8*I + 8
) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 -
 4*sqrt(-8*I + 8) - 8*I + 8) + 4)*log(1/8*((sqrt(8*I + 8) - 2*I - 2)^2*(3*sqrt(-8*I + 8) + 6*I - 10) + (3*(sqr
t(-8*I + 8) + 2*I - 2)^2 + 24*sqrt(-8*I + 8) + 48*I - 88)*(sqrt(8*I + 8) - 2*I - 2) - 4*(sqrt(-8*I + 8) + 2*I
- 2)^2 + 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) -
3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8)*((sqrt(8*I + 8) - 2*I - 2)*(3*sqrt(-8*I + 8) +
6*I - 10) - 4*sqrt(-8*I + 8) - 8*I + 16) - 40*sqrt(-8*I + 8) - 80*I + 80)*sqrt(sqrt(8*I + 8) + sqrt(-8*I + 8)
- 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sq
rt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4) + 32*sqrt(sqrt(x + 1) + 1)) - 1/2*sqrt(sqrt(8*I +
 8) + sqrt(-8*I + 8) - 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8)
 + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4)*log(-1/8*((sqrt(8*I + 8) - 2
*I - 2)^2*(3*sqrt(-8*I + 8) + 6*I - 10) + (3*(sqrt(-8*I + 8) + 2*I - 2)^2 + 24*sqrt(-8*I + 8) + 48*I - 88)*(sq
rt(8*I + 8) - 2*I - 2) - 4*(sqrt(-8*I + 8) + 2*I - 2)^2 + 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(
8*I + 8) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8
)*((sqrt(8*I + 8) - 2*I - 2)*(3*sqrt(-8*I + 8) + 6*I - 10) - 4*sqrt(-8*I + 8) - 8*I + 16) - 40*sqrt(-8*I + 8)
- 80*I + 80)*sqrt(sqrt(8*I + 8) + sqrt(-8*I + 8) - 2*sqrt(-3/4*(sqrt(8*I + 8) - 2*I - 2)^2 - 1/2*(sqrt(8*I + 8
) - 2*I - 2)*(sqrt(-8*I + 8) + 2*I + 6) - 3/4*(sqrt(-8*I + 8) + 2*I - 2)^2 - 4*sqrt(-8*I + 8) - 8*I + 8) + 4)
+ 32*sqrt(sqrt(x + 1) + 1)) - sqrt(-1/2*sqrt(8*I + 8) + I + 1)*log(1/4*((sqrt(8*I + 8) - 2*I - 2)^2*(3*sqrt(-8
*I + 8) + 6*I - 10) + 3*(sqrt(-8*I + 8) + 2*I - 2)^3 + (3*(sqrt(-8*I + 8) + 2*I - 2)^2 + 24*sqrt(-8*I + 8) + 4
8*I - 88)*(sqrt(8*I + 8) - 2*I - 2) + 24*(sqrt(-8*I + 8) + 2*I - 2)^2 + 48*sqrt(-8*I + 8) + 96*I - 192)*sqrt(-
1/2*sqrt(8*I + 8) + I + 1) + 16*sqrt(sqrt(x + 1) + 1)) + sqrt(-1/2*sqrt(8*I + 8) + I + 1)*log(-1/4*((sqrt(8*I
+ 8) - 2*I - 2)^2*(3*sqrt(-8*I + 8) + 6*I - 10) + 3*(sqrt(-8*I + 8) + 2*I - 2)^3 + (3*(sqrt(-8*I + 8) + 2*I -
2)^2 + 24*sqrt(-8*I + 8) + 48*I - 88)*(sqrt(8*I + 8) - 2*I - 2) + 24*(sqrt(-8*I + 8) + 2*I - 2)^2 + 48*sqrt(-8
*I + 8) + 96*I - 192)*sqrt(-1/2*sqrt(8*I + 8) + I + 1) + 16*sqrt(sqrt(x + 1) + 1)) + sqrt(-1/2*sqrt(-8*I + 8)
- I + 1)*log(1/4*(3*(sqrt(-8*I + 8) + 2*I - 2)^3 + 28*(sqrt(-8*I + 8) + 2*I - 2)^2 + 88*sqrt(-8*I + 8) + 176*I
 - 272)*sqrt(-1/2*sqrt(-8*I + 8) - I + 1) + 16*sqrt(sqrt(x + 1) + 1)) - sqrt(-1/2*sqrt(-8*I + 8) - I + 1)*log(
-1/4*(3*(sqrt(-8*I + 8) + 2*I - 2)^3 + 28*(sqrt(-8*I + 8) + 2*I - 2)^2 + 88*sqrt(-8*I + 8) + 176*I - 272)*sqrt
(-1/2*sqrt(-8*I + 8) - I + 1) + 16*sqrt(sqrt(x + 1) + 1))

Sympy [F(-1)]

Timed out. \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\text {Timed out} \]

[In]

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

[Out]

Timed out

Maxima [N/A]

Not integrable

Time = 0.35 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.22 \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\int { \frac {{\left (x^{2} - 1\right )} \sqrt {x + 1}}{{\left (x^{2} + 1\right )} \sqrt {\sqrt {x + 1} + 1}} \,d x } \]

[In]

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

[Out]

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

Giac [F(-2)]

Exception generated. \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\text {Exception raised: TypeError} \]

[In]

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

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Invalid _EXT in replace_ext Error: Bad Argument ValueInvalid _EXT in replace_ext Error: Bad Argument ValueD
one

Mupad [N/A]

Not integrable

Time = 5.85 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.22 \[ \int \frac {\sqrt {1+x} \left (-1+x^2\right )}{\left (1+x^2\right ) \sqrt {1+\sqrt {1+x}}} \, dx=\int \frac {\left (x^2-1\right )\,\sqrt {x+1}}{\left (x^2+1\right )\,\sqrt {\sqrt {x+1}+1}} \,d x \]

[In]

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

[Out]

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