Optimal. Leaf size=97 \[ -\frac {x}{2}+\frac {1}{3} (3+x) \sqrt {x+\sqrt {1+x^2}}+\sqrt {1+x^2} \left (-\frac {1}{2}+\frac {1}{3} \sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \log \left (x+\sqrt {1+x^2}\right )-2 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.52, antiderivative size = 91, normalized size of antiderivative = 0.94, number of steps
used = 41, number of rules used = 22, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.710, Rules used = {6874, 201,
221, 2142, 14, 2144, 459, 2147, 276, 272, 52, 65, 213, 2145, 473, 470, 335, 304, 209, 212, 477, 472}
\begin {gather*} \frac {1}{3} \left (\sqrt {x^2+1}+x\right )^{3/2}+\sqrt {\sqrt {x^2+1}+x}-\frac {\sqrt {x^2+1}}{2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {x^2+1}\right )-2 \tanh ^{-1}\left (\sqrt {\sqrt {x^2+1}+x}\right )-\frac {x}{2}-\frac {\log (x)}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 52
Rule 65
Rule 201
Rule 209
Rule 212
Rule 213
Rule 221
Rule 272
Rule 276
Rule 304
Rule 335
Rule 459
Rule 470
Rule 472
Rule 473
Rule 477
Rule 2142
Rule 2144
Rule 2145
Rule 2147
Rule 6874
Rubi steps
\begin {align*} \int \frac {x+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {x}{1+\sqrt {x+\sqrt {1+x^2}}}+\frac {\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=\int \frac {x}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx+\int \frac {\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\int \left (-\frac {1}{2}+\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{2} \sqrt {x+\sqrt {1+x^2}}-\frac {1}{2} x \sqrt {x+\sqrt {1+x^2}}+\frac {1}{2} \sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}\right ) \, dx+\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 {x}{2}+\frac {x^2}{4}-\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 {x+\sqrt {1+x^2}} \, dx-\frac {1}{2} \int x \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\\ &=-\frac {x}{2}+\frac {x^2}{4}-\frac {1}{8} \text {Subst}\left (\int \frac {\left (-1+x^2\right ) \left (1+x^2\right )}{x^{5/2}} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{8} \text {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} \text {Subst}\left (\int \frac {\sqrt {1+x}}{x} \, dx,x,x^2\right )+\frac {1}{4} \text {Subst}\left (\int \frac {1+x^2}{x^{3/2}} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \text {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\\ &=-\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}+\frac {1}{2 \sqrt {x+\sqrt {1+x^2}}}-\frac {\log (x)}{2}-\frac {1}{8} \text {Subst}\left (\int \left (-\frac {1}{x^{5/2}}+x^{3/2}\right ) \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \text {Subst}\left (\int \left (\frac {1}{x^{3/2}}+\sqrt {x}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\frac {1}{4} \text {Subst}\left (\int \frac {1}{x \sqrt {1+x}} \, dx,x,x^2\right )+\frac {1}{4} \text {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} \text {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}-\frac {\sqrt {1+x^2}}{2}-\frac {1}{12 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {1}{20} \left (x+\sqrt {1+x^2}\right )^{5/2}-\frac {\log (x)}{2}+\frac {1}{4} \text {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} \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sqrt {1+x^2}\right )+\text {Subst}\left (\int \frac {\sqrt {x}}{-1+x^2} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}+\sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {1+x^2}\right )-\frac {\log (x)}{2}+2 \text {Subst}\left (\int \frac {x^2}{-1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}+\sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\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}-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {x}{2}-\frac {\sqrt {1+x^2}}{2}+\sqrt {x+\sqrt {1+x^2}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+\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}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 91, normalized size = 0.94 \begin {gather*} \frac {1}{6} \left (-3 x+2 (3+x) \sqrt {x+\sqrt {1+x^2}}+\sqrt {1+x^2} \left (-3+2 \sqrt {x+\sqrt {1+x^2}}\right )+3 \log \left (x+\sqrt {1+x^2}\right )-12 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {x +\sqrt {x^{2}+1}}{1+\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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 64, normalized size = 0.66 \begin {gather*} \frac {1}{3} \, {\left (x + \sqrt {x^{2} + 1} + 3\right )} \sqrt {x + \sqrt {x^{2} + 1}} - \frac {1}{2} \, x - \frac {1}{2} \, \sqrt {x^{2} + 1} - 2 \, \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + 1\right ) + \log \left (\sqrt {x + \sqrt {x^{2} + 1}}\right ) \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 {x + \sqrt {x^{2} + 1}}{\sqrt {x + \sqrt {x^{2} + 1}} + 1}\, dx \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*} \text {could not integrate} \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+\sqrt {x^2+1}}{\sqrt {x+\sqrt {x^2+1}}+1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________