Optimal. Leaf size=127 \[ \frac {2 \sqrt {x^2+1} (x-6)+2 \left (x^2-6 x-1\right )}{3 \sqrt {\sqrt {x^2+1}+x}}+4 \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\frac {\sqrt {\sqrt {x^2+1}+x}}{\sqrt {1+\sqrt {2}}}\right )+4 \sqrt {\sqrt {2}-1} \tanh ^{-1}\left (\frac {\sqrt {\sqrt {x^2+1}+x}}{\sqrt {\sqrt {2}-1}}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.32, antiderivative size = 136, normalized size of antiderivative = 1.07, number of steps used = 12, number of rules used = 9, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {6742, 2117, 14, 2119, 1628, 826, 1166, 207, 203} \begin {gather*} \frac {1}{3} \left (\sqrt {x^2+1}+x\right )^{3/2}-4 \sqrt {\sqrt {x^2+1}+x}-\frac {1}{\sqrt {\sqrt {x^2+1}+x}}+4 \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )+4 \sqrt {\sqrt {2}-1} \tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 203
Rule 207
Rule 826
Rule 1166
Rule 1628
Rule 2117
Rule 2119
Rule 6742
Rubi steps
\begin {align*} \int \frac {(-1+x) \sqrt {x+\sqrt {1+x^2}}}{1+x} \, dx &=\int \left (\sqrt {x+\sqrt {1+x^2}}-\frac {2 \sqrt {x+\sqrt {1+x^2}}}{1+x}\right ) \, dx\\ &=-\left (2 \int \frac {\sqrt {x+\sqrt {1+x^2}}}{1+x} \, dx\right )+\int \sqrt {x+\sqrt {1+x^2}} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+x^2}{x^{3/2}} \, dx,x,x+\sqrt {1+x^2}\right )-2 \operatorname {Subst}\left (\int \frac {1+x^2}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \left (\frac {1}{x^{3/2}}+\sqrt {x}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-2 \operatorname {Subst}\left (\int \left (\frac {1}{\sqrt {x}}+\frac {2 (1-x)}{\sqrt {x} \left (-1+2 x+x^2\right )}\right ) \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}-4 \sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-4 \operatorname {Subst}\left (\int \frac {1-x}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}-4 \sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-8 \operatorname {Subst}\left (\int \frac {1-x^2}{-1+2 x^2+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}-4 \sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+\left (4 \left (1-\sqrt {2}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\left (4 \left (1+\sqrt {2}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}-4 \sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+4 \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )+4 \sqrt {-1+\sqrt {2}} \tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.34, size = 150, normalized size = 1.18 \begin {gather*} \frac {1}{3} \left (\sqrt {x^2+1}+x\right )^{3/2}-4 \sqrt {\sqrt {x^2+1}+x}-\frac {1}{\sqrt {\sqrt {x^2+1}+x}}+4 \sqrt {\sqrt {2}-1} \left (1+\sqrt {2}\right ) \tan ^{-1}\left (\frac {\sqrt {\sqrt {x^2+1}+x}}{\sqrt {1+\sqrt {2}}}\right )+4 \left (\sqrt {2}-1\right ) \sqrt {1+\sqrt {2}} \tanh ^{-1}\left (\frac {\sqrt {\sqrt {x^2+1}+x}}{\sqrt {\sqrt {2}-1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.30, size = 127, normalized size = 1.00 \begin {gather*} \frac {2 (-6+x) \sqrt {1+x^2}+2 \left (-1-6 x+x^2\right )}{3 \sqrt {x+\sqrt {1+x^2}}}+4 \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+4 \sqrt {-1+\sqrt {2}} \tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.46, size = 158, normalized size = 1.24 \begin {gather*} \frac {2}{3} \, {\left (2 \, x - \sqrt {x^{2} + 1} - 6\right )} \sqrt {x + \sqrt {x^{2} + 1}} - 8 \, \sqrt {\sqrt {2} + 1} \arctan \left (\sqrt {x + \sqrt {2} + \sqrt {x^{2} + 1} + 1} \sqrt {\sqrt {2} + 1} {\left (\sqrt {2} - 1\right )} - \sqrt {x + \sqrt {x^{2} + 1}} \sqrt {\sqrt {2} + 1} {\left (\sqrt {2} - 1\right )}\right ) + 2 \, \sqrt {\sqrt {2} - 1} \log \left (4 \, \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, \sqrt {\sqrt {2} - 1}\right ) - 2 \, \sqrt {\sqrt {2} - 1} \log \left (4 \, \sqrt {x + \sqrt {x^{2} + 1}} - 4 \, \sqrt {\sqrt {2} - 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x + \sqrt {x^{2} + 1}} {\left (x - 1\right )}}{x + 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {\left (-1+x \right ) \sqrt {x +\sqrt {x^{2}+1}}}{1+x}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x + \sqrt {x^{2} + 1}} {\left (x - 1\right )}}{x + 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {x+\sqrt {x^2+1}}\,\left (x-1\right )}{x+1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (x - 1\right ) \sqrt {x + \sqrt {x^{2} + 1}}}{x + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________