Integrand size = 28, antiderivative size = 304 \[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\sqrt {-1+\sqrt {2}} \arctan \left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )+\sqrt {1+\sqrt {2}} \arctan \left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )-\sqrt {2} \arctan \left (\frac {-\frac {1}{\sqrt {2}}+\frac {x}{\sqrt {2}}+\frac {\sqrt {1+x^2}}{\sqrt {2}}}{\sqrt {x+\sqrt {1+x^2}}}\right )+\sqrt {-1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )-\sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )+\sqrt {2} \text {arctanh}\left (\frac {\frac {1}{\sqrt {2}}+\frac {x}{\sqrt {2}}+\frac {\sqrt {1+x^2}}{\sqrt {2}}}{\sqrt {x+\sqrt {1+x^2}}}\right ) \]
[Out]
Time = 0.53 (sec) , antiderivative size = 343, normalized size of antiderivative = 1.13, number of steps used = 34, number of rules used = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.643, Rules used = {6857, 2142, 14, 2144, 1642, 840, 1180, 210, 212, 213, 209, 2147, 335, 303, 1176, 631, 1179, 642} \[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\sqrt {1+\sqrt {2}} \arctan \left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )-\sqrt {\sqrt {2}-1} \arctan \left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )+\sqrt {2} \arctan \left (1-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}\right )-\sqrt {2} \arctan \left (\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+1\right )-\sqrt {1+\sqrt {2}} \text {arctanh}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )+\sqrt {\sqrt {2}-1} \text {arctanh}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )+\frac {1}{3} \left (\sqrt {x^2+1}+x\right )^{3/2}-\frac {1}{\sqrt {\sqrt {x^2+1}+x}}-\frac {\log \left (\sqrt {x^2+1}-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )}{\sqrt {2}}+\frac {\log \left (\sqrt {x^2+1}+\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+x+1\right )}{\sqrt {2}} \]
[In]
[Out]
Rule 14
Rule 209
Rule 210
Rule 212
Rule 213
Rule 303
Rule 335
Rule 631
Rule 642
Rule 840
Rule 1176
Rule 1179
Rule 1180
Rule 1642
Rule 2142
Rule 2144
Rule 2147
Rule 6857
Rubi steps \begin{align*} \text {integral}& = \int \left (\sqrt {x+\sqrt {1+x^2}}+\frac {2 \sqrt {x+\sqrt {1+x^2}}}{-1+x^4}\right ) \, dx \\ & = 2 \int \frac {\sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx+\int \sqrt {x+\sqrt {1+x^2}} \, dx \\ & = \frac {1}{2} \text {Subst}\left (\int \frac {1+x^2}{x^{3/2}} \, dx,x,x+\sqrt {1+x^2}\right )+2 \int \left (-\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-x^2\right )}-\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+x^2\right )}\right ) \, dx \\ & = \frac {1}{2} \text {Subst}\left (\int \left (\frac {1}{x^{3/2}}+\sqrt {x}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\int \frac {\sqrt {x+\sqrt {1+x^2}}}{1-x^2} \, dx-\int \frac {\sqrt {x+\sqrt {1+x^2}}}{1+x^2} \, dx \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-2 \text {Subst}\left (\int \frac {\sqrt {x}}{1+x^2} \, dx,x,x+\sqrt {1+x^2}\right )-\int \left (\frac {\sqrt {x+\sqrt {1+x^2}}}{2 (1-x)}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 (1+x)}\right ) \, dx \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {1}{2} \int \frac {\sqrt {x+\sqrt {1+x^2}}}{1-x} \, dx-\frac {1}{2} \int \frac {\sqrt {x+\sqrt {1+x^2}}}{1+x} \, dx-4 \text {Subst}\left (\int \frac {x^2}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {1}{2} \text {Subst}\left (\int \frac {1+x^2}{\sqrt {x} \left (1+2 x-x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1+x^2}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+2 \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {1}{2} \text {Subst}\left (\int \left (-\frac {1}{\sqrt {x}}+\frac {2 (1+x)}{\sqrt {x} \left (1+2 x-x^2\right )}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\frac {1}{2} \text {Subst}\left (\int \left (\frac {1}{\sqrt {x}}+\frac {2 (1-x)}{\sqrt {x} \left (-1+2 x+x^2\right )}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\frac {\text {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}}-\frac {\text {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}}-\text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\frac {\log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}+\frac {\log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}-\sqrt {2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1+x}{\sqrt {x} \left (1+2 x-x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\text {Subst}\left (\int \frac {1-x}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+\sqrt {2} \arctan \left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \arctan \left (1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\frac {\log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}+\frac {\log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}-2 \text {Subst}\left (\int \frac {1+x^2}{1+2 x^2-x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \text {Subst}\left (\int \frac {1-x^2}{-1+2 x^2+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}+\sqrt {2} \arctan \left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \arctan \left (1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\frac {\log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}+\frac {\log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}-\left (-1-\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\left (1-\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\left (-1+\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\left (1+\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right ) \\ & = -\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\sqrt {-1+\sqrt {2}} \arctan \left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )+\sqrt {1+\sqrt {2}} \arctan \left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )+\sqrt {2} \arctan \left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \arctan \left (1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {-1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )-\sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )-\frac {\log \left (1+x+\sqrt {1+x^2}-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}}+\frac {\log \left (1+x+\sqrt {1+x^2}+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )}{\sqrt {2}} \\ \end{align*}
Time = 0.53 (sec) , antiderivative size = 280, normalized size of antiderivative = 0.92 \[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=-\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {1}{3} \left (x+\sqrt {1+x^2}\right )^{3/2}-\sqrt {2} \arctan \left (\frac {-1+x+\sqrt {1+x^2}}{\sqrt {2} \sqrt {x+\sqrt {1+x^2}}}\right )+\sqrt {1+\sqrt {2}} \arctan \left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {-1+\sqrt {2}} \arctan \left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {1+\sqrt {2}} \text {arctanh}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {-1+\sqrt {2}} \text {arctanh}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {2} \text {arctanh}\left (\frac {1+x+\sqrt {1+x^2}}{\sqrt {2} \sqrt {x+\sqrt {1+x^2}}}\right ) \]
[In]
[Out]
\[\int \frac {\left (x^{4}+1\right ) \sqrt {x +\sqrt {x^{2}+1}}}{x^{4}-1}d x\]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.28 (sec) , antiderivative size = 383, normalized size of antiderivative = 1.26 \[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\frac {2}{3} \, {\left (2 \, x - \sqrt {x^{2} + 1}\right )} \sqrt {x + \sqrt {x^{2} + 1}} - \left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \log \left (\left (i + 1\right ) \, \sqrt {2} + 2 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) + \left (\frac {1}{2} i + \frac {1}{2}\right ) \, \sqrt {2} \log \left (-\left (i - 1\right ) \, \sqrt {2} + 2 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \left (\frac {1}{2} i + \frac {1}{2}\right ) \, \sqrt {2} \log \left (\left (i - 1\right ) \, \sqrt {2} + 2 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) + \left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \log \left (-\left (i + 1\right ) \, \sqrt {2} + 2 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \frac {1}{2} \, \sqrt {\sqrt {2} + 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + \sqrt {\sqrt {2} + 1}\right ) + \frac {1}{2} \, \sqrt {\sqrt {2} + 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} - \sqrt {\sqrt {2} + 1}\right ) + \frac {1}{2} \, \sqrt {\sqrt {2} - 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + \sqrt {\sqrt {2} - 1}\right ) - \frac {1}{2} \, \sqrt {\sqrt {2} - 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} - \sqrt {\sqrt {2} - 1}\right ) - \frac {1}{2} \, \sqrt {-\sqrt {2} + 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + \sqrt {-\sqrt {2} + 1}\right ) + \frac {1}{2} \, \sqrt {-\sqrt {2} + 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} - \sqrt {-\sqrt {2} + 1}\right ) + \frac {1}{2} \, \sqrt {-\sqrt {2} - 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} + \sqrt {-\sqrt {2} - 1}\right ) - \frac {1}{2} \, \sqrt {-\sqrt {2} - 1} \log \left (\sqrt {x + \sqrt {x^{2} + 1}} - \sqrt {-\sqrt {2} - 1}\right ) \]
[In]
[Out]
\[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\int \frac {\sqrt {x + \sqrt {x^{2} + 1}} \left (x^{4} + 1\right )}{\left (x - 1\right ) \left (x + 1\right ) \left (x^{2} + 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\int { \frac {{\left (x^{4} + 1\right )} \sqrt {x + \sqrt {x^{2} + 1}}}{x^{4} - 1} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\int { \frac {{\left (x^{4} + 1\right )} \sqrt {x + \sqrt {x^{2} + 1}}}{x^{4} - 1} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}{-1+x^4} \, dx=\int \frac {\left (x^4+1\right )\,\sqrt {x+\sqrt {x^2+1}}}{x^4-1} \,d x \]
[In]
[Out]