Optimal. Leaf size=154 \[ \frac {5}{4} \log \left (\sqrt {x^2+1}+x\right )-4 \log \left (\sqrt {\sqrt {x^2+1}+x}+1\right )+\frac {-24 x^3+214 x^2+\sqrt {x^2+1} \left (-24 x^2+\left (16 x^2+72 x+40\right ) \sqrt {\sqrt {x^2+1}+x}+214 x-24\right )+\left (16 x^3+72 x^2+48 x+40\right ) \sqrt {\sqrt {x^2+1}+x}-36 x+104}{48 \sqrt {x^2+1} x+24 \left (2 x^2+1\right )} \]
________________________________________________________________________________________
Rubi [A] time = 0.72, antiderivative size = 208, normalized size of antiderivative = 1.35, number of steps used = 32, number of rules used = 22, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.710, Rules used = {6742, 2117, 1821, 1620, 195, 215, 266, 50, 63, 207, 14, 2122, 270, 2120, 462, 459, 329, 298, 203, 206, 466, 461} \begin {gather*} -\frac {x^2}{4}+\frac {1}{4} \sqrt {x^2+1} x+\frac {1}{6} \left (\sqrt {x^2+1}+x\right )^{3/2}-\frac {\sqrt {x^2+1}}{2}+\frac {3}{2} \sqrt {\sqrt {x^2+1}+x}+\frac {3}{2 \sqrt {\sqrt {x^2+1}+x}}-\frac {1}{2 \left (\sqrt {x^2+1}+x\right )}+\frac {1}{6 \left (\sqrt {x^2+1}+x\right )^{3/2}}+\frac {1}{2} \log \left (\sqrt {x^2+1}+x\right )-2 \log \left (\sqrt {\sqrt {x^2+1}+x}+1\right )+\frac {1}{2} \tanh ^{-1}\left (\sqrt {x^2+1}\right )-2 \tanh ^{-1}\left (\sqrt {\sqrt {x^2+1}+x}\right )-\frac {\log (x)}{2}+\frac {1}{4} \sinh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 50
Rule 63
Rule 195
Rule 203
Rule 206
Rule 207
Rule 215
Rule 266
Rule 270
Rule 298
Rule 329
Rule 459
Rule 461
Rule 462
Rule 466
Rule 1620
Rule 1821
Rule 2117
Rule 2120
Rule 2122
Rule 6742
Rubi steps
\begin {align*} \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {1}{1+\sqrt {x+\sqrt {1+x^2}}}+\frac {\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=\int \frac {1}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx+\int \frac {\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+x^2}{\left (1+\sqrt {x}\right ) x^2} \, dx,x,x+\sqrt {1+x^2}\right )+\int \left (\frac {\sqrt {1+x^2}}{2}-\frac {\sqrt {1+x^2}}{2 x}-\frac {1+x^2}{2 x}-\frac {1}{2} \sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}+\frac {\sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}}{2 x}+\frac {\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}}{2 x}\right ) \, dx\\ &=\frac {1}{2} \int \sqrt {1+x^2} \, dx-\frac {1}{2} \int \frac {\sqrt {1+x^2}}{x} \, dx-\frac {1}{2} \int \frac {1+x^2}{x} \, dx-\frac {1}{2} \int \sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}} \, dx+\frac {1}{2} \int \frac {\sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}}{x} \, dx+\frac {1}{2} \int \frac {\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}}{x} \, dx+\operatorname {Subst}\left (\int \frac {1+x^4}{x^3 (1+x)} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=\frac {1}{4} x \sqrt {1+x^2}-\frac {1}{8} \operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^{5/2}} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{8} \operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^3}{x^{5/2} \left (-1+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \int \frac {1}{\sqrt {1+x^2}} \, dx-\frac {1}{4} \operatorname {Subst}\left (\int \frac {\sqrt {1+x}}{x} \, dx,x,x^2\right )+\frac {1}{4} \operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^{3/2} \left (-1+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\frac {1}{2} \int \left (\frac {1}{x}+x\right ) \, dx+\operatorname {Subst}\left (\int \left (1+\frac {1}{x^3}-\frac {1}{x^2}+\frac {1}{x}-\frac {2}{1+x}\right ) \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {x^2}{4}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{4} x \sqrt {1+x^2}-\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {3}{2 \sqrt {x+\sqrt {1+x^2}}}+\sqrt {x+\sqrt {1+x^2}}+\frac {1}{4} \sinh ^{-1}(x)-\frac {\log (x)}{2}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )-\frac {1}{8} \operatorname {Subst}\left (\int \left (\frac {1}{x^{5/2}}+\frac {2}{\sqrt {x}}+x^{3/2}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\frac {1}{4} \operatorname {Subst}\left (\int \frac {1}{x \sqrt {1+x}} \, dx,x,x^2\right )+\frac {1}{4} \operatorname {Subst}\left (\int \frac {\left (1+x^4\right )^3}{x^4 \left (-1+x^4\right )} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {\sqrt {x} \left (-\frac {3}{2}-\frac {x^2}{2}\right )}{-1+x^2} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {x^2}{4}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{4} x \sqrt {1+x^2}+\frac {1}{12 \left (x+\sqrt {1+x^2}\right )^{3/2}}-\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {3}{2 \sqrt {x+\sqrt {1+x^2}}}+\frac {1}{2} \sqrt {x+\sqrt {1+x^2}}+\frac {1}{6} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {1}{20} \left (x+\sqrt {1+x^2}\right )^{5/2}+\frac {1}{4} \sinh ^{-1}(x)-\frac {\log (x)}{2}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{4} \operatorname {Subst}\left (\int \left (4-\frac {1}{x^4}+x^4+\frac {4}{-1+x^2}-\frac {4}{1+x^2}\right ) \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sqrt {1+x^2}\right )+\operatorname {Subst}\left (\int \frac {\sqrt {x}}{-1+x^2} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {x^2}{4}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{4} x \sqrt {1+x^2}+\frac {1}{6 \left (x+\sqrt {1+x^2}\right )^{3/2}}-\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {3}{2 \sqrt {x+\sqrt {1+x^2}}}+\frac {3}{2} \sqrt {x+\sqrt {1+x^2}}+\frac {1}{6} \left (x+\sqrt {1+x^2}\right )^{3/2}+\frac {1}{4} \sinh ^{-1}(x)+\frac {1}{2} \tanh ^{-1}\left (\sqrt {1+x^2}\right )-\frac {\log (x)}{2}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )+2 \operatorname {Subst}\left (\int \frac {x^2}{-1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {x^2}{4}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{4} x \sqrt {1+x^2}+\frac {1}{6 \left (x+\sqrt {1+x^2}\right )^{3/2}}-\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {3}{2 \sqrt {x+\sqrt {1+x^2}}}+\frac {3}{2} \sqrt {x+\sqrt {1+x^2}}+\frac {1}{6} \left (x+\sqrt {1+x^2}\right )^{3/2}+\frac {1}{4} \sinh ^{-1}(x)-\tan ^{-1}\left (\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \tanh ^{-1}\left (\sqrt {1+x^2}\right )-\tanh ^{-1}\left (\sqrt {x+\sqrt {1+x^2}}\right )-\frac {\log (x)}{2}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )-\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {x^2}{4}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{4} x \sqrt {1+x^2}+\frac {1}{6 \left (x+\sqrt {1+x^2}\right )^{3/2}}-\frac {1}{2 \left (x+\sqrt {1+x^2}\right )}+\frac {3}{2 \sqrt {x+\sqrt {1+x^2}}}+\frac {3}{2} \sqrt {x+\sqrt {1+x^2}}+\frac {1}{6} \left (x+\sqrt {1+x^2}\right )^{3/2}+\frac {1}{4} \sinh ^{-1}(x)+\frac {1}{2} \tanh ^{-1}\left (\sqrt {1+x^2}\right )-2 \tanh ^{-1}\left (\sqrt {x+\sqrt {1+x^2}}\right )-\frac {\log (x)}{2}+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 2.08, size = 482, normalized size = 3.13 \begin {gather*} -\frac {2 \sqrt {x^2+1} \left (\sqrt {x^2+1}+x\right )^{9/2} \left (\left (4 x^2+4 \sqrt {x^2+1} x+2\right ) \, _2F_1\left (\frac {3}{4},1;\frac {7}{4};\left (x+\sqrt {x^2+1}\right )^2\right )-x^2-\sqrt {x^2+1} x-2\right )}{48 x^6+84 x^4+39 x^2+15 \sqrt {x^2+1} x+48 \sqrt {x^2+1} x^5+60 \sqrt {x^2+1} x^3+3}+\frac {1}{3} \left (\sqrt {x^2+1}-2 x\right ) \sqrt {\sqrt {x^2+1}+x}-\frac {x^2}{4}+\frac {1}{4} (x-4) \sqrt {x^2+1}+\log \left (\sqrt {x^2+1}+1\right )+\frac {2 \sqrt {x^2+1} \left (\sqrt {x^2+1}+x\right ) \left (\sqrt {\sqrt {x^2+1}+x}-\tan ^{-1}\left (\sqrt {\sqrt {x^2+1}+x}\right )-\tanh ^{-1}\left (\sqrt {\sqrt {x^2+1}+x}\right )\right )}{x^2+\sqrt {x^2+1} x+1}-\frac {\left (6 x^4+21 x^2+18 \sqrt {x^2+1} x+6 \sqrt {x^2+1} x^3+7\right ) \sqrt {\sqrt {x^2+1}+x}}{15 \left (2 x^2+2 \sqrt {x^2+1} x+1\right )}+\frac {\sqrt {x^2+1} \left (6 x^4+6 x^2+3 \sqrt {x^2+1} x+6 \sqrt {x^2+1} x^3+2\right )}{15 \left (x^2+\sqrt {x^2+1} x+1\right ) \sqrt {\sqrt {x^2+1}+x}}+\frac {x}{2}-2 \log (x)+\frac {1}{4} \sinh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.24, size = 154, normalized size = 1.00 \begin {gather*} \frac {5}{4} \log \left (\sqrt {x^2+1}+x\right )-4 \log \left (\sqrt {\sqrt {x^2+1}+x}+1\right )+\frac {-24 x^3+214 x^2+\sqrt {x^2+1} \left (-24 x^2+\left (16 x^2+72 x+40\right ) \sqrt {\sqrt {x^2+1}+x}+214 x-24\right )+\left (16 x^3+72 x^2+48 x+40\right ) \sqrt {\sqrt {x^2+1}+x}-36 x+104}{48 \sqrt {x^2+1} x+24 \left (2 x^2+1\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.40, size = 84, normalized size = 0.55 \begin {gather*} -\frac {1}{4} \, x^{2} + \frac {1}{3} \, {\left (x^{2} - \sqrt {x^{2} + 1} {\left (x - 5\right )} - 4 \, x + 5\right )} \sqrt {x + \sqrt {x^{2} + 1}} + \frac {1}{4} \, \sqrt {x^{2} + 1} {\left (x - 4\right )} + \frac {1}{2} \, x - 4 \, \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + 1\right ) + \frac {5}{2} \, \log \left (\sqrt {x + \sqrt {x^{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^{2} + 1} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} + 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.38, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1+\sqrt {x^{2}+1}}{1+\sqrt {x +\sqrt {x^{2}+1}}}\, dx \end {gather*}
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*} \frac {1}{2} \, x + \frac {1}{2} \, \int \sqrt {x^{2} + 1}\,{d x} - \int \frac {x^{2} + \sqrt {x^{2} + 1} x + x}{2 \, {\left (x + \sqrt {x^{2} + 1} + 2 \, \sqrt {x + \sqrt {x^{2} + 1}} + 1\right )}}\,{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^2+1}+1}{\sqrt {x+\sqrt {x^2+1}}+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 {\sqrt {x^{2} + 1} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________