Integrand size = 31, antiderivative size = 154 \[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\frac {104-36 x+214 x^2-24 x^3+\left (40+48 x+72 x^2+16 x^3\right ) \sqrt {x+\sqrt {1+x^2}}+\sqrt {1+x^2} \left (-24+214 x-24 x^2+\left (40+72 x+16 x^2\right ) \sqrt {x+\sqrt {1+x^2}}\right )}{48 x \sqrt {1+x^2}+24 \left (1+2 x^2\right )}+\frac {5}{4} \log \left (x+\sqrt {1+x^2}\right )-4 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right ) \]
[Out]
Time = 0.48 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.35, number of steps used = 32, number of rules used = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.710, Rules used = {6874, 2142, 1835, 1634, 201, 221, 272, 52, 65, 213, 14, 2147, 276, 2145, 473, 470, 335, 304, 209, 212, 477, 472} \[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\frac {\text {arcsinh}(x)}{4}+\frac {1}{2} \text {arctanh}\left (\sqrt {x^2+1}\right )-2 \text {arctanh}\left (\sqrt {\sqrt {x^2+1}+x}\right )-\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 {\log (x)}{2} \]
[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 470
Rule 472
Rule 473
Rule 477
Rule 1634
Rule 1835
Rule 2142
Rule 2145
Rule 2147
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \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} \text {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+\text {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} \text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{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} \int \frac {1}{\sqrt {1+x^2}} \, dx-\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 {\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+\text {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 {\text {arcsinh}(x)}{4}-\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} \text {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} \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}{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 {\text {arcsinh}(x)}{4}-\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} \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}{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 {\text {arcsinh}(x)}{4}+\frac {1}{2} \text {arctanh}\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 \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}{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 {\text {arcsinh}(x)}{4}-\arctan \left (\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \text {arctanh}\left (\sqrt {1+x^2}\right )-\text {arctanh}\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 )-\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}{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 {\text {arcsinh}(x)}{4}+\frac {1}{2} \text {arctanh}\left (\sqrt {1+x^2}\right )-2 \text {arctanh}\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*}
Time = 0.23 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.00 \[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\frac {104-36 x+214 x^2-24 x^3+\left (40+48 x+72 x^2+16 x^3\right ) \sqrt {x+\sqrt {1+x^2}}+\sqrt {1+x^2} \left (-24+214 x-24 x^2+\left (40+72 x+16 x^2\right ) \sqrt {x+\sqrt {1+x^2}}\right )}{48 x \sqrt {1+x^2}+24 \left (1+2 x^2\right )}+\frac {5}{4} \log \left (x+\sqrt {1+x^2}\right )-4 \log \left (1+\sqrt {x+\sqrt {1+x^2}}\right ) \]
[In]
[Out]
\[\int \frac {1+\sqrt {x^{2}+1}}{1+\sqrt {x +\sqrt {x^{2}+1}}}d x\]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.55 \[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=-\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 ) \]
[In]
[Out]
\[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\int \frac {\sqrt {x^{2} + 1} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} + 1}\, dx \]
[In]
[Out]
\[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\int { \frac {\sqrt {x^{2} + 1} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} + 1} \,d x } \]
[In]
[Out]
\[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\int { \frac {\sqrt {x^{2} + 1} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} + 1} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {1+\sqrt {1+x^2}}{1+\sqrt {x+\sqrt {1+x^2}}} \, dx=\int \frac {\sqrt {x^2+1}+1}{\sqrt {x+\sqrt {x^2+1}}+1} \,d x \]
[In]
[Out]