Optimal. Leaf size=434 \[ \frac {x^2 \sqrt {x+\sqrt {1+x^2}}}{2 \left (-1+x^2\right )}-\frac {x \sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}}{2 \left (-1+x^2\right )}+\frac {\left (\sqrt {2 \left (1+5 \sqrt {2}\right )}-4 \sqrt {1+\sqrt {2}} x^2+\sqrt {2 \left (1+\sqrt {2}\right )} x^2\right ) \text {ArcTan}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{8 (-1+x) (1+x)}+\frac {\left (-\sqrt {2 \left (-1+5 \sqrt {2}\right )}+4 \sqrt {-1+\sqrt {2}} x^2+\sqrt {2 \left (-1+\sqrt {2}\right )} x^2\right ) \text {ArcTan}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{8 (-1+x) (1+x)}+\frac {\left (\sqrt {2 \left (1+5 \sqrt {2}\right )}-4 \sqrt {1+\sqrt {2}} x^2+\sqrt {2 \left (1+\sqrt {2}\right )} x^2\right ) \tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{8 (-1+x) (1+x)}+\frac {\left (-\sqrt {2 \left (-1+5 \sqrt {2}\right )}+4 \sqrt {-1+\sqrt {2}} x^2+\sqrt {2 \left (-1+\sqrt {2}\right )} x^2\right ) \tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{8 (-1+x) (1+x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.55, antiderivative size = 463, normalized size of antiderivative = 1.07, number of
steps used = 34, number of rules used = 15, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.652, Rules used
= {6874, 2144, 1662, 12, 721, 1107, 210, 212, 213, 209, 6857, 1642, 842, 840, 1180}
\begin {gather*} \frac {\text {ArcTan}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )}{2 \sqrt {1+\sqrt {2}}}+\frac {1}{4} \sqrt {\frac {1}{2} \left (\sqrt {2}-1\right )} \text {ArcTan}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )+\frac {1}{4} \sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \text {ArcTan}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )-\frac {\text {ArcTan}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )}{2 \sqrt {\sqrt {2}-1}}+\frac {\sqrt {\sqrt {x^2+1}+x}}{2 \left (-\left (\sqrt {x^2+1}+x\right )^2-2 \left (\sqrt {x^2+1}+x\right )+1\right )}+\frac {\sqrt {\sqrt {x^2+1}+x}}{2 \left (-\left (\sqrt {x^2+1}+x\right )^2+2 \left (\sqrt {x^2+1}+x\right )+1\right )}+\frac {\tanh ^{-1}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )}{2 \sqrt {1+\sqrt {2}}}+\frac {1}{4} \sqrt {\frac {1}{2} \left (\sqrt {2}-1\right )} \tanh ^{-1}\left (\sqrt {\sqrt {2}-1} \sqrt {\sqrt {x^2+1}+x}\right )+\frac {1}{4} \sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )-\frac {\tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {\sqrt {x^2+1}+x}\right )}{2 \sqrt {\sqrt {2}-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 210
Rule 212
Rule 213
Rule 721
Rule 840
Rule 842
Rule 1107
Rule 1180
Rule 1642
Rule 1662
Rule 2144
Rule 6857
Rule 6874
Rubi steps
\begin {align*} \int \frac {1}{\left (-1+x^2\right )^2 \sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {1}{4 (1-x)^2 \sqrt {x+\sqrt {1+x^2}}}+\frac {1}{4 (1+x)^2 \sqrt {x+\sqrt {1+x^2}}}+\frac {1}{2 \left (1-x^2\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=\frac {1}{4} \int \frac {1}{(1-x)^2 \sqrt {x+\sqrt {1+x^2}}} \, dx+\frac {1}{4} \int \frac {1}{(1+x)^2 \sqrt {x+\sqrt {1+x^2}}} \, dx+\frac {1}{2} \int \frac {1}{\left (1-x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {1}{2} \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}{2} \text {Subst}\left (\int \frac {1+x^2}{\sqrt {x} \left (1+2 x-x^2\right )^2} \, 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 )^2} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}-\frac {1}{16} \text {Subst}\left (\int -\frac {4}{\sqrt {x} \left (1+2 x-x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{16} \text {Subst}\left (\int -\frac {4}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \int \frac {1}{(1-x) \sqrt {x+\sqrt {1+x^2}}} \, dx+\frac {1}{4} \int \frac {1}{(1+x) \sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {1}{4} \text {Subst}\left (\int \frac {1}{\sqrt {x} \left (1+2 x-x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \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}{4} \text {Subst}\left (\int \frac {1}{\sqrt {x} \left (-1+2 x+x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )+\frac {1}{4} \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 {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {1}{4} \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}{4} \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 \frac {1}{1+2 x^2-x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1+2 x^2+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {1}{2} \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}{2} \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 {\text {Subst}\left (\int \frac {1}{1-\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{4 \sqrt {2}}+\frac {\text {Subst}\left (\int \frac {1}{1+\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{4 \sqrt {2}}-\frac {\text {Subst}\left (\int \frac {1}{1-\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{4 \sqrt {2}}+\frac {\text {Subst}\left (\int \frac {1}{1+\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{4 \sqrt {2}}\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\frac {1}{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 )-\frac {1}{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 )\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\text {Subst}\left (\int \frac {-1+x^2}{1+2 x^2-x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-\text {Subst}\left (\int \frac {-1-x^2}{-1+2 x^2+x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1-\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {2}-x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1-\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {2}+x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1-2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}+\frac {\sqrt {x+\sqrt {1+x^2}}}{2 \left (1+2 \left (x+\sqrt {1+x^2}\right )-\left (x+\sqrt {1+x^2}\right )^2\right )}-\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{2 \sqrt {-1+\sqrt {2}}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{2 \sqrt {1+\sqrt {2}}}+\frac {\tan ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}-\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{2 \sqrt {-1+\sqrt {2}}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {-1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (-1+\sqrt {2}\right )}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{2 \sqrt {1+\sqrt {2}}}+\frac {\tanh ^{-1}\left (\frac {\sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {2}}}\right )}{4 \sqrt {2 \left (1+\sqrt {2}\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.94, size = 236, normalized size = 0.54 \begin {gather*} \frac {1}{8} \left (\frac {4 x^2 \sqrt {x+\sqrt {1+x^2}}}{-1+x^2}-\frac {4 x \sqrt {1+x^2} \sqrt {x+\sqrt {1+x^2}}}{-1+x^2}+\sqrt {-2+10 \sqrt {2}} \text {ArcTan}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2+10 \sqrt {2}} \text {ArcTan}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )+\sqrt {-2+10 \sqrt {2}} \tanh ^{-1}\left (\sqrt {-1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )-\sqrt {2+10 \sqrt {2}} \tanh ^{-1}\left (\sqrt {1+\sqrt {2}} \sqrt {x+\sqrt {1+x^2}}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \frac {1}{\left (x^{2}-1\right )^{2} \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.38, size = 399, normalized size = 0.92 \begin {gather*} \frac {4 \, \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} + 1} \arctan \left (\frac {1}{7} \, \sqrt {x + \sqrt {2} + \sqrt {x^{2} + 1} - 1} \sqrt {5 \, \sqrt {2} + 1} {\left (2 \, \sqrt {2} + 1\right )} - \frac {1}{7} \, \sqrt {x + \sqrt {x^{2} + 1}} \sqrt {5 \, \sqrt {2} + 1} {\left (2 \, \sqrt {2} + 1\right )}\right ) - 4 \, \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} - 1} \arctan \left (\frac {1}{7} \, \sqrt {x + \sqrt {2} + \sqrt {x^{2} + 1} + 1} \sqrt {5 \, \sqrt {2} - 1} {\left (2 \, \sqrt {2} - 1\right )} - \frac {1}{7} \, \sqrt {x + \sqrt {x^{2} + 1}} \sqrt {5 \, \sqrt {2} - 1} {\left (2 \, \sqrt {2} - 1\right )}\right ) + \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} - 1} \log \left (\sqrt {5 \, \sqrt {2} - 1} {\left (\sqrt {2} + 3\right )} + 7 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} - 1} \log \left (-\sqrt {5 \, \sqrt {2} - 1} {\left (\sqrt {2} + 3\right )} + 7 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) + \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} + 1} \log \left (\sqrt {5 \, \sqrt {2} + 1} {\left (\sqrt {2} - 3\right )} + 7 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) - \sqrt {2} {\left (x^{2} - 1\right )} \sqrt {5 \, \sqrt {2} + 1} \log \left (-\sqrt {5 \, \sqrt {2} + 1} {\left (\sqrt {2} - 3\right )} + 7 \, \sqrt {x + \sqrt {x^{2} + 1}}\right ) + 8 \, {\left (x^{2} - \sqrt {x^{2} + 1} x\right )} \sqrt {x + \sqrt {x^{2} + 1}}}{16 \, {\left (x^{2} - 1\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 {1}{\left (x - 1\right )^{2} \left (x + 1\right )^{2} \sqrt {x + \sqrt {x^{2} + 1}}}\, 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 {1}{{\left (x^2-1\right )}^2\,\sqrt {x+\sqrt {x^2+1}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________