Optimal. Leaf size=36 \[ -\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\tan ^{-1}\left (\sqrt {-1+x} \sqrt {1+x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {1978, 96, 94,
209} \begin {gather*} \text {ArcTan}\left (\sqrt {x-1} \sqrt {x+1}\right )-\frac {\sqrt {x-1} \sqrt {x+1}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 94
Rule 96
Rule 209
Rule 1978
Rubi steps
\begin {align*} \int \frac {\sqrt {\frac {-1+x}{1+x}}}{x^2} \, dx &=\int \frac {\sqrt {-1+x}}{x^2 \sqrt {1+x}} \, dx\\ &=-\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx\\ &=-\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {-1+x} \sqrt {1+x}\right )\\ &=-\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\tan ^{-1}\left (\sqrt {-1+x} \sqrt {1+x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 66, normalized size = 1.83 \begin {gather*} -\frac {\sqrt {\frac {-1+x}{1+x}} \left (\sqrt {-1+x} (1+x)+2 x \sqrt {1+x} \tan ^{-1}\left (x-\sqrt {-1+x} \sqrt {1+x}\right )\right )}{\sqrt {-1+x} x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(58\) vs.
\(2(28)=56\).
time = 0.12, size = 59, normalized size = 1.64
method | result | size |
risch | \(-\frac {\left (1+x \right ) \sqrt {\frac {-1+x}{1+x}}}{x}-\frac {\arctan \left (\frac {1}{\sqrt {x^{2}-1}}\right ) \sqrt {\frac {-1+x}{1+x}}\, \sqrt {\left (1+x \right ) \left (-1+x \right )}}{-1+x}\) | \(56\) |
default | \(\frac {\sqrt {\frac {-1+x}{1+x}}\, \left (1+x \right ) \left (\left (x^{2}-1\right )^{\frac {3}{2}}-x^{2} \sqrt {x^{2}-1}-\arctan \left (\frac {1}{\sqrt {x^{2}-1}}\right ) x \right )}{\sqrt {\left (1+x \right ) \left (-1+x \right )}\, x}\) | \(59\) |
trager | \(-\frac {\left (1+x \right ) \sqrt {-\frac {1-x}{1+x}}}{x}+\RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {\RootOf \left (\textit {\_Z}^{2}+1\right ) \sqrt {-\frac {1-x}{1+x}}\, x +\RootOf \left (\textit {\_Z}^{2}+1\right ) \sqrt {-\frac {1-x}{1+x}}-1}{x}\right )\) | \(82\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 41, normalized size = 1.14 \begin {gather*} -\frac {2 \, \sqrt {\frac {x - 1}{x + 1}}}{\frac {x - 1}{x + 1} + 1} + 2 \, \arctan \left (\sqrt {\frac {x - 1}{x + 1}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.33, size = 36, normalized size = 1.00 \begin {gather*} \frac {2 \, x \arctan \left (\sqrt {\frac {x - 1}{x + 1}}\right ) - {\left (x + 1\right )} \sqrt {\frac {x - 1}{x + 1}}}{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 {\frac {x - 1}{x + 1}}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.50, size = 51, normalized size = 1.42 \begin {gather*} -\frac {1}{2} \, {\left (\pi - 2\right )} \mathrm {sgn}\left (x + 1\right ) + 2 \, \arctan \left (-x + \sqrt {x^{2} - 1}\right ) \mathrm {sgn}\left (x + 1\right ) - \frac {2 \, \mathrm {sgn}\left (x + 1\right )}{{\left (x - \sqrt {x^{2} - 1}\right )}^{2} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.06, size = 41, normalized size = 1.14 \begin {gather*} 2\,\mathrm {atan}\left (\sqrt {\frac {x-1}{x+1}}\right )-\frac {2\,\sqrt {\frac {x-1}{x+1}}}{\frac {x-1}{x+1}+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________