Integrand size = 39, antiderivative size = 176 \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=-\sqrt {2 \left (-1+\sqrt {2}\right )} \arctan \left (\frac {\sqrt {2 \left (1+\sqrt {2}\right )} x \sqrt {x^2+\sqrt {1+x^4}}}{1+x^2+\sqrt {1+x^4}}\right )+\sqrt {2} \text {arctanh}\left (\frac {\sqrt {2} x \sqrt {x^2+\sqrt {1+x^4}}}{1+x^2+\sqrt {1+x^4}}\right )-\sqrt {2 \left (1+\sqrt {2}\right )} \text {arctanh}\left (\frac {\sqrt {2 \left (-1+\sqrt {2}\right )} x \sqrt {x^2+\sqrt {1+x^4}}}{1+x^2+\sqrt {1+x^4}}\right ) \]
[Out]
Result contains complex when optimal does not.
Time = 0.64 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.02, number of steps used = 16, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {6857, 2157, 212, 2158, 739} \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\frac {1}{2} \sqrt {1+i} \text {arctanh}\left (\frac {1-x}{\sqrt {1+i} \sqrt {1-i x^2}}\right )-\frac {1}{2} \sqrt {1+i} \text {arctanh}\left (\frac {x+1}{\sqrt {1+i} \sqrt {1-i x^2}}\right )+\frac {1}{2} \sqrt {1-i} \text {arctanh}\left (\frac {1-x}{\sqrt {1-i} \sqrt {1+i x^2}}\right )-\frac {1}{2} \sqrt {1-i} \text {arctanh}\left (\frac {x+1}{\sqrt {1-i} \sqrt {1+i x^2}}\right )+\frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {\sqrt {x^4+1}+x^2}}\right )}{\sqrt {2}} \]
[In]
[Out]
Rule 212
Rule 739
Rule 2157
Rule 2158
Rule 6857
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}}-\frac {2 \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}}\right ) \, dx \\ & = -\left (2 \int \frac {\sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx\right )+\int \frac {\sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}} \, dx \\ & = -\left (2 \int \left (\frac {i \sqrt {x^2+\sqrt {1+x^4}}}{2 (i-x) \sqrt {1+x^4}}+\frac {i \sqrt {x^2+\sqrt {1+x^4}}}{2 (i+x) \sqrt {1+x^4}}\right ) \, dx\right )+\text {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\frac {x}{\sqrt {x^2+\sqrt {1+x^4}}}\right ) \\ & = \frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}}-i \int \frac {\sqrt {x^2+\sqrt {1+x^4}}}{(i-x) \sqrt {1+x^4}} \, dx-i \int \frac {\sqrt {x^2+\sqrt {1+x^4}}}{(i+x) \sqrt {1+x^4}} \, dx \\ & = \frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}}-\left (-\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1}{(i-x) \sqrt {1+i x^2}} \, dx-\left (-\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1}{(i+x) \sqrt {1+i x^2}} \, dx-\left (\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1}{(i-x) \sqrt {1-i x^2}} \, dx-\left (\frac {1}{2}+\frac {i}{2}\right ) \int \frac {1}{(i+x) \sqrt {1-i x^2}} \, dx \\ & = \frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}}-\left (-\frac {1}{2}-\frac {i}{2}\right ) \text {Subst}\left (\int \frac {1}{(1+i)-x^2} \, dx,x,\frac {-1-x}{\sqrt {1-i x^2}}\right )-\left (-\frac {1}{2}-\frac {i}{2}\right ) \text {Subst}\left (\int \frac {1}{(1+i)-x^2} \, dx,x,\frac {1-x}{\sqrt {1-i x^2}}\right )-\left (\frac {1}{2}-\frac {i}{2}\right ) \text {Subst}\left (\int \frac {1}{(1-i)-x^2} \, dx,x,\frac {-1+x}{\sqrt {1+i x^2}}\right )-\left (\frac {1}{2}-\frac {i}{2}\right ) \text {Subst}\left (\int \frac {1}{(1-i)-x^2} \, dx,x,\frac {1+x}{\sqrt {1+i x^2}}\right ) \\ & = \frac {1}{2} \sqrt {1+i} \text {arctanh}\left (\frac {1-x}{\sqrt {1+i} \sqrt {1-i x^2}}\right )-\frac {1}{2} \sqrt {1+i} \text {arctanh}\left (\frac {1+x}{\sqrt {1+i} \sqrt {1-i x^2}}\right )+\frac {1}{2} \sqrt {1-i} \text {arctanh}\left (\frac {1-x}{\sqrt {1-i} \sqrt {1+i x^2}}\right )-\frac {1}{2} \sqrt {1-i} \text {arctanh}\left (\frac {1+x}{\sqrt {1-i} \sqrt {1+i x^2}}\right )+\frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}} \\ \end{align*}
Time = 0.62 (sec) , antiderivative size = 172, normalized size of antiderivative = 0.98 \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\sqrt {2} \left (-\sqrt {-1+\sqrt {2}} \arctan \left (\frac {\sqrt {\frac {1}{2}+\frac {1}{\sqrt {2}}} \left (-1+x^2+\sqrt {1+x^4}\right )}{x \sqrt {x^2+\sqrt {1+x^4}}}\right )+\text {arctanh}\left (\frac {-1+x^2+\sqrt {1+x^4}}{\sqrt {2} x \sqrt {x^2+\sqrt {1+x^4}}}\right )-\sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {-1+x^2+\sqrt {1+x^4}}{\sqrt {2 \left (1+\sqrt {2}\right )} x \sqrt {x^2+\sqrt {1+x^4}}}\right )\right ) \]
[In]
[Out]
\[\int \frac {\left (x^{2}-1\right ) \sqrt {x^{2}+\sqrt {x^{4}+1}}}{\left (x^{2}+1\right ) \sqrt {x^{4}+1}}d x\]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 475 vs. \(2 (138) = 276\).
Time = 3.20 (sec) , antiderivative size = 475, normalized size of antiderivative = 2.70 \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\frac {1}{4} \, \sqrt {2} \log \left (4 \, x^{4} + 4 \, \sqrt {x^{4} + 1} x^{2} + 2 \, {\left (\sqrt {2} x^{3} + \sqrt {2} \sqrt {x^{4} + 1} x\right )} \sqrt {x^{2} + \sqrt {x^{4} + 1}} + 1\right ) + \frac {1}{4} \, \sqrt {2 \, \sqrt {2} + 2} \log \left (\frac {2 \, \sqrt {2} x^{2} + 4 \, x^{2} + {\left (\sqrt {2} \sqrt {x^{4} + 1} x - \sqrt {2} {\left (x^{3} + x\right )} - 2 \, x\right )} \sqrt {x^{2} + \sqrt {x^{4} + 1}} \sqrt {2 \, \sqrt {2} + 2} + 2 \, \sqrt {x^{4} + 1} {\left (\sqrt {2} + 1\right )}}{x^{2} + 1}\right ) - \frac {1}{4} \, \sqrt {2 \, \sqrt {2} + 2} \log \left (\frac {2 \, \sqrt {2} x^{2} + 4 \, x^{2} - {\left (\sqrt {2} \sqrt {x^{4} + 1} x - \sqrt {2} {\left (x^{3} + x\right )} - 2 \, x\right )} \sqrt {x^{2} + \sqrt {x^{4} + 1}} \sqrt {2 \, \sqrt {2} + 2} + 2 \, \sqrt {x^{4} + 1} {\left (\sqrt {2} + 1\right )}}{x^{2} + 1}\right ) + \frac {1}{4} \, \sqrt {-2 \, \sqrt {2} + 2} \log \left (-\frac {2 \, \sqrt {2} x^{2} - 4 \, x^{2} + {\left (\sqrt {2} \sqrt {x^{4} + 1} x \sqrt {-2 \, \sqrt {2} + 2} - {\left (\sqrt {2} {\left (x^{3} + x\right )} - 2 \, x\right )} \sqrt {-2 \, \sqrt {2} + 2}\right )} \sqrt {x^{2} + \sqrt {x^{4} + 1}} + 2 \, \sqrt {x^{4} + 1} {\left (\sqrt {2} - 1\right )}}{x^{2} + 1}\right ) - \frac {1}{4} \, \sqrt {-2 \, \sqrt {2} + 2} \log \left (-\frac {2 \, \sqrt {2} x^{2} - 4 \, x^{2} - {\left (\sqrt {2} \sqrt {x^{4} + 1} x \sqrt {-2 \, \sqrt {2} + 2} - {\left (\sqrt {2} {\left (x^{3} + x\right )} - 2 \, x\right )} \sqrt {-2 \, \sqrt {2} + 2}\right )} \sqrt {x^{2} + \sqrt {x^{4} + 1}} + 2 \, \sqrt {x^{4} + 1} {\left (\sqrt {2} - 1\right )}}{x^{2} + 1}\right ) \]
[In]
[Out]
\[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\int \frac {\left (x - 1\right ) \left (x + 1\right ) \sqrt {x^{2} + \sqrt {x^{4} + 1}}}{\left (x^{2} + 1\right ) \sqrt {x^{4} + 1}}\, dx \]
[In]
[Out]
\[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\int { \frac {\sqrt {x^{2} + \sqrt {x^{4} + 1}} {\left (x^{2} - 1\right )}}{\sqrt {x^{4} + 1} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\int { \frac {\sqrt {x^{2} + \sqrt {x^{4} + 1}} {\left (x^{2} - 1\right )}}{\sqrt {x^{4} + 1} {\left (x^{2} + 1\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\left (1+x^2\right ) \sqrt {1+x^4}} \, dx=\int \frac {\left (x^2-1\right )\,\sqrt {\sqrt {x^4+1}+x^2}}{\left (x^2+1\right )\,\sqrt {x^4+1}} \,d x \]
[In]
[Out]