Integrand size = 28, antiderivative size = 134 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {4 x}{3 \sqrt {1+\sqrt {1+x^2}}}+\frac {2 x \sqrt {1+x^2}}{3 \sqrt {1+\sqrt {1+x^2}}}+2 \sqrt {-1+\sqrt {2}} \arctan \left (\frac {x}{\sqrt {1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right )-2 \sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {x}{\sqrt {-1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right ) \]
[Out]
\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx \]
[In]
[Out]
Rubi steps \begin{align*} \text {integral}& = \int \left (\sqrt {1+\sqrt {1+x^2}}+\frac {2 \sqrt {1+\sqrt {1+x^2}}}{-1+x^2}\right ) \, dx \\ & = 2 \int \frac {\sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx+\int \sqrt {1+\sqrt {1+x^2}} \, dx \\ & = \frac {2 x^3}{3 \left (1+\sqrt {1+x^2}\right )^{3/2}}+\frac {2 x}{\sqrt {1+\sqrt {1+x^2}}}+2 \int \left (-\frac {\sqrt {1+\sqrt {1+x^2}}}{2 (1-x)}-\frac {\sqrt {1+\sqrt {1+x^2}}}{2 (1+x)}\right ) \, dx \\ & = \frac {2 x^3}{3 \left (1+\sqrt {1+x^2}\right )^{3/2}}+\frac {2 x}{\sqrt {1+\sqrt {1+x^2}}}-\int \frac {\sqrt {1+\sqrt {1+x^2}}}{1-x} \, dx-\int \frac {\sqrt {1+\sqrt {1+x^2}}}{1+x} \, dx \\ \end{align*}
Time = 0.37 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.87 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {2 x \left (2+\sqrt {1+x^2}\right )}{3 \sqrt {1+\sqrt {1+x^2}}}+2 \sqrt {-1+\sqrt {2}} \arctan \left (\frac {x}{\sqrt {1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right )-2 \sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {1+\sqrt {2}} x}{\sqrt {1+\sqrt {1+x^2}}}\right ) \]
[In]
[Out]
\[\int \frac {\left (x^{2}+1\right ) \sqrt {1+\sqrt {x^{2}+1}}}{x^{2}-1}d x\]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 536 vs. \(2 (96) = 192\).
Time = 2.61 (sec) , antiderivative size = 536, normalized size of antiderivative = 4.00 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {3 \, x \sqrt {-4 \, \sqrt {2} + 4} \log \left (-\frac {2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x + 193 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - {\left (71 \, x^{3} + \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 457 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} + 4 \, {\left (71 \, x^{2} + \sqrt {2} {\left (61 \, x^{2} + 132\right )} - \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} + 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{3} - x}\right ) - 3 \, x \sqrt {-4 \, \sqrt {2} + 4} \log \left (\frac {2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x + 193 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - {\left (71 \, x^{3} + \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 457 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - 4 \, {\left (71 \, x^{2} + \sqrt {2} {\left (61 \, x^{2} + 132\right )} - \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} + 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{3} - x}\right ) - 6 \, x \sqrt {\sqrt {2} + 1} \log \left (-\frac {2 \, {\left ({\left (71 \, x^{3} - \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x - 193 \, x\right )} + 457 \, x\right )} \sqrt {\sqrt {2} + 1} + 2 \, {\left (71 \, x^{2} - \sqrt {2} {\left (61 \, x^{2} + 132\right )} + \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} - 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}\right )}}{x^{3} - x}\right ) + 6 \, x \sqrt {\sqrt {2} + 1} \log \left (\frac {2 \, {\left ({\left (71 \, x^{3} - \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x - 193 \, x\right )} + 457 \, x\right )} \sqrt {\sqrt {2} + 1} - 2 \, {\left (71 \, x^{2} - \sqrt {2} {\left (61 \, x^{2} + 132\right )} + \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} - 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}\right )}}{x^{3} - x}\right ) + 8 \, {\left (x^{2} + \sqrt {x^{2} + 1} - 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{12 \, x} \]
[In]
[Out]
\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (x^{2} + 1\right ) \sqrt {\sqrt {x^{2} + 1} + 1}}{\left (x - 1\right ) \left (x + 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int { \frac {{\left (x^{2} + 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{2} - 1} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int { \frac {{\left (x^{2} + 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{2} - 1} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (x^2+1\right )\,\sqrt {\sqrt {x^2+1}+1}}{x^2-1} \,d x \]
[In]
[Out]