Optimal. Leaf size=91 \[ \frac {2 \sqrt {x-\sqrt {x^2+1}} (-x-2)+2 \sqrt {x^2+1} \sqrt {x-\sqrt {x^2+1}}}{\sqrt {x^2+1}-x-1}-2 \tan ^{-1}\left (\sqrt {x-\sqrt {x^2+1}}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.44, antiderivative size = 83, normalized size of antiderivative = 0.91, number of steps used = 16, number of rules used = 12, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {6742, 2119, 457, 329, 298, 203, 206, 2120, 463, 12, 321, 212} \begin {gather*} \frac {\sqrt {x-\sqrt {x^2+1}}}{x}+2 \sqrt {x-\sqrt {x^2+1}}-\frac {1}{x \sqrt {x-\sqrt {x^2+1}}}-2 \tan ^{-1}\left (\sqrt {x-\sqrt {x^2+1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 203
Rule 206
Rule 212
Rule 298
Rule 321
Rule 329
Rule 457
Rule 463
Rule 2119
Rule 2120
Rule 6742
Rubi steps
\begin {align*} \int \frac {\sqrt {x-\sqrt {1+x^2}}}{1-\sqrt {1+x^2}} \, dx &=\int \left (-\frac {\sqrt {x-\sqrt {1+x^2}}}{x^2}-\frac {\sqrt {1+x^2} \sqrt {x-\sqrt {1+x^2}}}{x^2}\right ) \, dx\\ &=-\int \frac {\sqrt {x-\sqrt {1+x^2}}}{x^2} \, dx-\int \frac {\sqrt {1+x^2} \sqrt {x-\sqrt {1+x^2}}}{x^2} \, dx\\ &=-\left (2 \operatorname {Subst}\left (\int \frac {\sqrt {x} \left (1+x^2\right )}{\left (-1+x^2\right )^2} \, dx,x,x-\sqrt {1+x^2}\right )\right )+\operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^2}{\sqrt {x} \left (-1+x^2\right )^2} \, dx,x,x-\sqrt {1+x^2}\right )\\ &=\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}+\frac {1}{2} \operatorname {Subst}\left (\int \frac {2 x^{3/2}}{-1+x^2} \, dx,x,x-\sqrt {1+x^2}\right )-\operatorname {Subst}\left (\int \frac {\sqrt {x}}{-1+x^2} \, dx,x,x-\sqrt {1+x^2}\right )\\ &=\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}-2 \operatorname {Subst}\left (\int \frac {x^2}{-1+x^4} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )+\operatorname {Subst}\left (\int \frac {x^{3/2}}{-1+x^2} \, dx,x,x-\sqrt {1+x^2}\right )\\ &=2 \sqrt {x-\sqrt {1+x^2}}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}+\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )+\operatorname {Subst}\left (\int \frac {1}{\sqrt {x} \left (-1+x^2\right )} \, dx,x,x-\sqrt {1+x^2}\right )-\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )\\ &=2 \sqrt {x-\sqrt {1+x^2}}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}-\tan ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right )+\tanh ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right )+2 \operatorname {Subst}\left (\int \frac {1}{-1+x^4} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )\\ &=2 \sqrt {x-\sqrt {1+x^2}}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}-\tan ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right )+\tanh ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right )-\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )-\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x-\sqrt {1+x^2}}\right )\\ &=2 \sqrt {x-\sqrt {1+x^2}}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x}+\frac {\sqrt {x-\sqrt {1+x^2}}}{x \left (-x+\sqrt {1+x^2}\right )}-2 \tan ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 14.17, size = 1129, normalized size = 12.41 \begin {gather*} -\frac {159120 \left (x^2-\sqrt {x^2+1} x+1\right ) \left (\frac {16}{585} \, _4F_3\left (\frac {5}{4},2,2,2;1,1,\frac {17}{4};\left (x-\sqrt {x^2+1}\right )^2\right ) \left (\left (x-\sqrt {x^2+1}\right )^3+x-\sqrt {x^2+1}\right )^2+\frac {681 \left (x-\sqrt {x^2+1}\right )^6-1483 \left (x-\sqrt {x^2+1}\right )^4-6769 \left (x-\sqrt {x^2+1}\right )^2+5 \left (\left (x-\sqrt {x^2+1}\right )^8-248 \left (x-\sqrt {x^2+1}\right )^6+102 \left (x-\sqrt {x^2+1}\right )^4+1208 \left (x-\sqrt {x^2+1}\right )^2+729\right ) \, _2F_1\left (\frac {1}{4},1;\frac {5}{4};\left (x-\sqrt {x^2+1}\right )^2\right )-3645}{640 \left (x-\sqrt {x^2+1}\right )^4}\right ) \left (x-\sqrt {x^2+1}\right )^{23/2}}{x \left (1-\frac {x}{\sqrt {x^2+1}}\right ) \left (\left (x-\sqrt {x^2+1}\right )^2+1\right ) \left (1989 \left (-217600 x^{12}+217600 \sqrt {x^2+1} x^{11}-540032 x^{10}+431232 \sqrt {x^2+1} x^9-565792 x^8+377376 \sqrt {x^2+1} x^7-331584 x^6+183200 \sqrt {x^2+1} x^5-99050 x^4+36170 \sqrt {x^2+1} x^3-8563 x^2+10 \left (-1024 x^{13}+1024 \sqrt {x^2+1} x^{12}+28672 x^{11}-29184 \sqrt {x^2+1} x^{10}+75840 x^9-61120 \sqrt {x^2+1} x^8+79168 x^7-52320 \sqrt {x^2+1} x^6+44684 x^5-24300 \sqrt {x^2+1} x^4+13240 x^3-4978 \sqrt {x^2+1} x^2+1335 x-182 \sqrt {x^2+1}\right ) \, _2F_1\left (\frac {1}{4},1;\frac {5}{4};\left (x-\sqrt {x^2+1}\right )^2\right ) x+687 \sqrt {x^2+1} x+140\right )+4352 x \left (-106496 x^{15}+106496 \sqrt {x^2+1} x^{14}-409600 x^{13}+356352 \sqrt {x^2+1} x^{12}-632320 x^{11}+467456 \sqrt {x^2+1} x^{10}-499200 x^9+303360 \sqrt {x^2+1} x^8-212160 x^7+100800 \sqrt {x^2+1} x^6-46592 x^5+15904 \sqrt {x^2+1} x^4-4550 x^3+938 \sqrt {x^2+1} x^2-130 x+9 \sqrt {x^2+1}\right ) \, _4F_3\left (\frac {5}{4},2,2,2;1,1,\frac {17}{4};\left (x-\sqrt {x^2+1}\right )^2\right )+40960 x \left (-32768 x^{17}+32768 \sqrt {x^2+1} x^{16}-147456 x^{15}+131072 \sqrt {x^2+1} x^{14}-274432 x^{13}+212992 \sqrt {x^2+1} x^{12}-272384 x^{11}+180224 \sqrt {x^2+1} x^{10}-154880 x^9+84480 \sqrt {x^2+1} x^8-50304 x^7+21504 \sqrt {x^2+1} x^6-8736 x^5+2688 \sqrt {x^2+1} x^4-688 x^3+128 \sqrt {x^2+1} x^2-16 x+\sqrt {x^2+1}\right ) \, _4F_3\left (\frac {9}{4},3,3,3;2,2,\frac {21}{4};\left (x-\sqrt {x^2+1}\right )^2\right )\right )}-\frac {\left (\left (x-\sqrt {x^2+1}\right )^2-1\right )^2 \left (-\frac {2 \left (x-\sqrt {x^2+1}\right )^{3/2}}{\left (x-\sqrt {x^2+1}\right )^2-1}+\tan ^{-1}\left (\sqrt {x-\sqrt {x^2+1}}\right )-\tanh ^{-1}\left (\sqrt {x-\sqrt {x^2+1}}\right )\right )}{4 x^2 \left (1-\frac {x}{\sqrt {x^2+1}}\right ) \left (1-\frac {\left (x-\sqrt {x^2+1}\right )^2-1}{2 \left (x-\sqrt {x^2+1}\right )^2}\right ) \left (x-\sqrt {x^2+1}\right )^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.10, size = 91, normalized size = 1.00 \begin {gather*} \frac {2 (-2-x) \sqrt {x-\sqrt {1+x^2}}+2 \sqrt {1+x^2} \sqrt {x-\sqrt {1+x^2}}}{-1-x+\sqrt {1+x^2}}-2 \tan ^{-1}\left (\sqrt {x-\sqrt {1+x^2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.60, size = 50, normalized size = 0.55 \begin {gather*} -\frac {2 \, x \arctan \left (\sqrt {x - \sqrt {x^{2} + 1}}\right ) - {\left (3 \, x + \sqrt {x^{2} + 1} + 1\right )} \sqrt {x - \sqrt {x^{2} + 1}}}{x} \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*} \int -\frac {\sqrt {x - \sqrt {x^{2} + 1}}}{\sqrt {x^{2} + 1} - 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {\sqrt {x -\sqrt {x^{2}+1}}}{1-\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*} -\int \frac {\sqrt {x - \sqrt {x^{2} + 1}}}{\sqrt {x^{2} + 1} - 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} -\int \frac {\sqrt {x-\sqrt {x^2+1}}}{\sqrt {x^2+1}-1} \,d x \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 {\sqrt {x - \sqrt {x^{2} + 1}}}{\sqrt {x^{2} + 1} - 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________