Optimal. Leaf size=326 \[ \frac {4}{3} x \sqrt {-x+\sqrt {1+x^2}}+\frac {2}{3} \sqrt {1+x^2} \sqrt {-x+\sqrt {1+x^2}}+\sqrt {-1+\sqrt {2}} \text {ArcTan}\left (\frac {\sqrt {-x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )-\sqrt {1+\sqrt {2}} \text {ArcTan}\left (\frac {\sqrt {-x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )+\sqrt {2} \text {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}} \tanh ^{-1}\left (\frac {\sqrt {-x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )+\sqrt {1+\sqrt {2}} \tanh ^{-1}\left (\frac {\sqrt {-x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {-x+\sqrt {1+x^2}}}{1-x+\sqrt {1+x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.55, antiderivative size = 341, normalized size of antiderivative = 1.05, number of steps
used = 36, number of rules used = 19, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.679, Rules used = {6857, 2142,
14, 2144, 1642, 842, 840, 1180, 210, 212, 213, 209, 2147, 335, 217, 1179, 642, 1176, 631}
\begin {gather*} -\frac {\text {ArcTan}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )}{\sqrt {1+\sqrt {2}}}+\frac {\text {ArcTan}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )}{\sqrt {\sqrt {2}-1}}+\sqrt {2} \text {ArcTan}\left (1-\sqrt {2} \sqrt {\sqrt {x^2+1}+x}\right )-\sqrt {2} \text {ArcTan}\left (\sqrt {2} \sqrt {\sqrt {x^2+1}+x}+1\right )+\sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}}+\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}}-\frac {\tanh ^{-1}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )}{\sqrt {1+\sqrt {2}}}+\frac {\tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )}{\sqrt {\sqrt {2}-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 209
Rule 210
Rule 212
Rule 213
Rule 217
Rule 335
Rule 631
Rule 642
Rule 840
Rule 842
Rule 1176
Rule 1179
Rule 1180
Rule 1642
Rule 2142
Rule 2144
Rule 2147
Rule 6857
Rubi steps
\begin {align*} \int \frac {1+x^4}{\left (-1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {2}{\left (-1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=2 \int \frac {1}{\left (-1+x^4\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx+\int \frac {1}{\sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {1}{2} \text {Subst}\left (\int \frac {1+x^2}{x^{5/2}} \, dx,x,x+\sqrt {1+x^2}\right )+2 \int \left (-\frac {1}{2 \left (1-x^2\right ) \sqrt {x+\sqrt {1+x^2}}}-\frac {1}{2 \left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=\frac {1}{2} \text {Subst}\left (\int \left (\frac {1}{x^{5/2}}+\frac {1}{\sqrt {x}}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\int \frac {1}{\left (1-x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx-\int \frac {1}{\left (1+x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-2 \text {Subst}\left (\int \frac {1}{\sqrt {x} \left (1+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\int \left (\frac {1}{2 (1-x) \sqrt {x+\sqrt {1+x^2}}}+\frac {1}{2 (1+x) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {1}{2} \int \frac {1}{(1-x) \sqrt {x+\sqrt {1+x^2}}} \, dx-\frac {1}{2} \int \frac {1}{(1+x) \sqrt {x+\sqrt {1+x^2}}} \, dx-4 \text {Subst}\left (\int \frac {1}{1+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {1}{2} \text {Subst}\left (\int \frac {1+x^2}{x^{3/2} \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}{x^{3/2} \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}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {1}{2} \text {Subst}\left (\int \left (-\frac {1}{x^{3/2}}+\frac {2 (1+x)}{x^{3/2} \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}{x^{3/2}}+\frac {2 (1-x)}{x^{3/2} \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}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^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}{x^{3/2} \left (1+2 x-x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\text {Subst}\left (\int \frac {1-x}{x^{3/2} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \tan ^{-1}\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}}-\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}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \tan ^{-1}\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}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \tan ^{-1}\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}}-\text {Subst}\left (\int \frac {1}{1-\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1+\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1-\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {1}{1+\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{\sqrt {-1+\sqrt {2}}}-\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{\sqrt {1+\sqrt {2}}}+\sqrt {2} \tan ^{-1}\left (1-\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \tan ^{-1}\left (1+\sqrt {2} \sqrt {x+\sqrt {1+x^2}}\right )+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{\sqrt {-1+\sqrt {2}}}-\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{\sqrt {1+\sqrt {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}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.37, size = 279, normalized size = 0.86 \begin {gather*} -\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\sqrt {2} \text {ArcTan}\left (\frac {-1+x+\sqrt {1+x^2}}{\sqrt {2} \sqrt {x+\sqrt {1+x^2}}}\right )-\sqrt {-1+\sqrt {2}} \text {ArcTan}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {1+\sqrt {2}} \text {ArcTan}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {-1+\sqrt {2}} \tanh ^{-1}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {1+\sqrt {2}} \tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {1+x+\sqrt {1+x^2}}{\sqrt {2} \sqrt {x+\sqrt {1+x^2}}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.06, size = 0, normalized size = 0.00 \[\int \frac {x^{4}+1}{\left (x^{4}-1\right ) \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.54, size = 467, normalized size = 1.43 \begin {gather*} -\frac {2}{3} \, {\left (x^{2} - \sqrt {x^{2} + 1} x - 1\right )} \sqrt {x + \sqrt {x^{2} + 1}} + 2 \, \sqrt {2} \arctan \left (\sqrt {2} \sqrt {\sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + x + \sqrt {x^{2} + 1} + 1} - \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} - 1\right ) + 2 \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \sqrt {-4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4} - \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 1\right ) - 2 \, \sqrt {\sqrt {2} + 1} \arctan \left (\sqrt {x + \sqrt {2} + \sqrt {x^{2} + 1} - 1} \sqrt {\sqrt {2} + 1} - \sqrt {x + \sqrt {x^{2} + 1}} \sqrt {\sqrt {2} + 1}\right ) + 2 \, \sqrt {\sqrt {2} - 1} \arctan \left (\sqrt {x + \sqrt {2} + \sqrt {x^{2} + 1} + 1} \sqrt {\sqrt {2} - 1} - \sqrt {x + \sqrt {x^{2} + 1}} \sqrt {\sqrt {2} - 1}\right ) - \frac {1}{2} \, \sqrt {\sqrt {2} - 1} \log \left ({\left (\sqrt {2} + 1\right )} \sqrt {\sqrt {2} - 1} + \sqrt {x + \sqrt {x^{2} + 1}}\right ) + \frac {1}{2} \, \sqrt {\sqrt {2} - 1} \log \left (-{\left (\sqrt {2} + 1\right )} \sqrt {\sqrt {2} - 1} + \sqrt {x + \sqrt {x^{2} + 1}}\right ) + \frac {1}{2} \, \sqrt {\sqrt {2} + 1} \log \left (\sqrt {\sqrt {2} + 1} {\left (\sqrt {2} - 1\right )} + \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \frac {1}{2} \, \sqrt {\sqrt {2} + 1} \log \left (-\sqrt {\sqrt {2} + 1} {\left (\sqrt {2} - 1\right )} + \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \frac {1}{2} \, \sqrt {2} \log \left (4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4\right ) + \frac {1}{2} \, \sqrt {2} \log \left (-4 \, \sqrt {2} \sqrt {x + \sqrt {x^{2} + 1}} + 4 \, x + 4 \, \sqrt {x^{2} + 1} + 4\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^{4} + 1}{\left (x - 1\right ) \left (x + 1\right ) \sqrt {x + \sqrt {x^{2} + 1}} \left (x^{2} + 1\right )}\, 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.00 \begin {gather*} \int \frac {x^4+1}{\left (x^4-1\right )\,\sqrt {x+\sqrt {x^2+1}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________