Optimal. Leaf size=141 \[ \sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}}-2 \sqrt {2} \tan ^{-1}\left (\frac {\frac {\sqrt {x^2+1}}{\sqrt {2}}+\frac {x}{\sqrt {2}}-\frac {1}{\sqrt {2}}}{\sqrt {\sqrt {x^2+1}+x}}\right )-2 \sqrt {2} \tanh ^{-1}\left (\frac {\frac {\sqrt {x^2+1}}{\sqrt {2}}+\frac {x}{\sqrt {2}}+\frac {1}{\sqrt {2}}}{\sqrt {\sqrt {x^2+1}+x}}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 180, normalized size of antiderivative = 1.28, number of steps used = 16, number of rules used = 11, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.393, Rules used = {6725, 2117, 14, 2122, 329, 211, 1165, 628, 1162, 617, 204} \begin {gather*} \sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}}+\sqrt {2} \log \left (\sqrt {x^2+1}-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )-\sqrt {2} \log \left (\sqrt {x^2+1}+\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )+2 \sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}\right )-2 \sqrt {2} \tan ^{-1}\left (\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 204
Rule 211
Rule 329
Rule 617
Rule 628
Rule 1162
Rule 1165
Rule 2117
Rule 2122
Rule 6725
Rubi steps
\begin {align*} \int \frac {-1+x^2}{\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {1}{\sqrt {x+\sqrt {1+x^2}}}-\frac {2}{\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=-\left (2 \int \frac {1}{\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx\right )+\int \frac {1}{\sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+x^2}{x^{5/2}} \, dx,x,x+\sqrt {1+x^2}\right )-4 \operatorname {Subst}\left (\int \frac {1}{\sqrt {x} \left (1+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \left (\frac {1}{x^{5/2}}+\frac {1}{\sqrt {x}}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-8 \operatorname {Subst}\left (\int \frac {1}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-4 \operatorname {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-4 \operatorname {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-2 \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {2} \operatorname {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {2} \operatorname {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\sqrt {2} \log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\left (2 \sqrt {2}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )+\left (2 \sqrt {2}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+2 \sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-2 \sqrt {2} \tan ^{-1}\left (1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {2} \log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.12, size = 180, normalized size = 1.28 \begin {gather*} \sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}}+\sqrt {2} \log \left (\sqrt {x^2+1}-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )-\sqrt {2} \log \left (\sqrt {x^2+1}+\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )+2 \sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}\right )-2 \sqrt {2} \tan ^{-1}\left (\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.18, size = 141, normalized size = 1.00 \begin {gather*} -\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-2 \sqrt {2} \tan ^{-1}\left (\frac {-\frac {1}{\sqrt {2}}+\frac {x}{\sqrt {2}}+\frac {\sqrt {1+x^2}}{\sqrt {2}}}{\sqrt {x+\sqrt {1+x^2}}}\right )-2 \sqrt {2} \tanh ^{-1}\left (\frac {\frac {1}{\sqrt {2}}+\frac {x}{\sqrt {2}}+\frac {\sqrt {1+x^2}}{\sqrt {2}}}{\sqrt {x+\sqrt {1+x^2}}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.63, size = 216, normalized size = 1.53 \begin {gather*} -\frac {2}{3} \, {\left (x^{2} - \sqrt {x^{2} + 1} x - 1\right )} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, \sqrt {2} \arctan \left (\sqrt {2} \sqrt {\sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + x + \sqrt {x^{2} + 1} + 1} - \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} - 1\right ) + 4 \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \sqrt {-4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4} - \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 1\right ) - \sqrt {2} \log \left (4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4\right ) + \sqrt {2} \log \left (-4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4\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 {x^{2} - 1}{{\left (x^{2} + 1\right )} \sqrt {x + \sqrt {x^{2} + 1}}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.03, size = 0, normalized size = 0.00 \[\int \frac {x^{2}-1}{\left (x^{2}+1\right ) \sqrt {x +\sqrt {x^{2}+1}}}\, 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 {x^{2} - 1}{{\left (x^{2} + 1\right )} \sqrt {x + \sqrt {x^{2} + 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 {x^2-1}{\left (x^2+1\right )\,\sqrt {x+\sqrt {x^2+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 ) \left (x + 1\right )}{\sqrt {x + \sqrt {x^{2} + 1}} \left (x^{2} + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________