Optimal. Leaf size=68 \[ -\frac {\sqrt {2-x-x^2}}{x}+\sin ^{-1}\left (\frac {1}{3} (-1-2 x)\right )+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {2-x-x^2}}\right )}{2 \sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {746, 857, 633,
222, 738, 212} \begin {gather*} \text {ArcSin}\left (\frac {1}{3} (-2 x-1)\right )-\frac {\sqrt {-x^2-x+2}}{x}+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {-x^2-x+2}}\right )}{2 \sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 222
Rule 633
Rule 738
Rule 746
Rule 857
Rubi steps
\begin {align*} \int \frac {\sqrt {2-x-x^2}}{x^2} \, dx &=-\frac {\sqrt {2-x-x^2}}{x}+\frac {1}{2} \int \frac {-1-2 x}{x \sqrt {2-x-x^2}} \, dx\\ &=-\frac {\sqrt {2-x-x^2}}{x}-\frac {1}{2} \int \frac {1}{x \sqrt {2-x-x^2}} \, dx-\int \frac {1}{\sqrt {2-x-x^2}} \, dx\\ &=-\frac {\sqrt {2-x-x^2}}{x}+\frac {1}{3} \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{9}}} \, dx,x,-1-2 x\right )+\text {Subst}\left (\int \frac {1}{8-x^2} \, dx,x,\frac {4-x}{\sqrt {2-x-x^2}}\right )\\ &=-\frac {\sqrt {2-x-x^2}}{x}+\sin ^{-1}\left (\frac {1}{3} (-1-2 x)\right )+\frac {\tanh ^{-1}\left (\frac {4-x}{2 \sqrt {2} \sqrt {2-x-x^2}}\right )}{2 \sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 76, normalized size = 1.12 \begin {gather*} -\frac {\sqrt {2-x-x^2}}{x}+2 \tan ^{-1}\left (\frac {\sqrt {2-x-x^2}}{2+x}\right )-\frac {\tanh ^{-1}\left (\frac {\sqrt {2-x-x^2}}{\sqrt {2} (-1+x)}\right )}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 88, normalized size = 1.29
method | result | size |
risch | \(\frac {x^{2}+x -2}{x \sqrt {-x^{2}-x +2}}-\arcsin \left (\frac {1}{3}+\frac {2 x}{3}\right )+\frac {\arctanh \left (\frac {\left (4-x \right ) \sqrt {2}}{4 \sqrt {-x^{2}-x +2}}\right ) \sqrt {2}}{4}\) | \(60\) |
default | \(-\frac {\left (-x^{2}-x +2\right )^{\frac {3}{2}}}{2 x}-\frac {\sqrt {-x^{2}-x +2}}{4}-\arcsin \left (\frac {1}{3}+\frac {2 x}{3}\right )+\frac {\arctanh \left (\frac {\left (4-x \right ) \sqrt {2}}{4 \sqrt {-x^{2}-x +2}}\right ) \sqrt {2}}{4}+\frac {\left (-2 x -1\right ) \sqrt {-x^{2}-x +2}}{4}\) | \(88\) |
trager | \(-\frac {\sqrt {-x^{2}-x +2}}{x}-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) x +4 \sqrt {-x^{2}-x +2}-4 \RootOf \left (\textit {\_Z}^{2}-2\right )}{x}\right )}{4}+\RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (2 \RootOf \left (\textit {\_Z}^{2}+1\right ) x +2 \sqrt {-x^{2}-x +2}+\RootOf \left (\textit {\_Z}^{2}+1\right )\right )\) | \(101\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 4.86, size = 59, normalized size = 0.87 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {2 \, \sqrt {2} \sqrt {-x^{2} - x + 2}}{{\left | x \right |}} + \frac {4}{{\left | x \right |}} - 1\right ) - \frac {\sqrt {-x^{2} - x + 2}}{x} + \arcsin \left (-\frac {2}{3} \, x - \frac {1}{3}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.82, size = 92, normalized size = 1.35 \begin {gather*} \frac {\sqrt {2} x \log \left (-\frac {4 \, \sqrt {2} \sqrt {-x^{2} - x + 2} {\left (x - 4\right )} + 7 \, x^{2} + 16 \, x - 32}{x^{2}}\right ) + 8 \, x \arctan \left (\frac {\sqrt {-x^{2} - x + 2} {\left (2 \, x + 1\right )}}{2 \, {\left (x^{2} + x - 2\right )}}\right ) - 8 \, \sqrt {-x^{2} - x + 2}}{8 \, 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 {- \left (x - 1\right ) \left (x + 2\right )}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 168 vs.
\(2 (52) = 104\).
time = 0.48, size = 168, normalized size = 2.47 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 6 \right |}}{{\left | 4 \, \sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 6 \right |}}\right ) + \frac {6 \, {\left (\frac {3 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + 1\right )}}{\frac {6 \, {\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}}{2 \, x + 1} + \frac {{\left (2 \, \sqrt {-x^{2} - x + 2} - 3\right )}^{2}}{{\left (2 \, x + 1\right )}^{2}} + 1} - \arcsin \left (\frac {2}{3} \, x + \frac {1}{3}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.08, size = 73, normalized size = 1.07 \begin {gather*} \frac {\sqrt {2}\,\ln \left (\frac {2}{x}+\frac {\sqrt {2}\,\sqrt {-x^2-x+2}}{x}-\frac {1}{2}\right )}{4}-\frac {\sqrt {-x^2-x+2}}{x}+\ln \left (x\,1{}\mathrm {i}+\sqrt {-x^2-x+2}+\frac {1}{2}{}\mathrm {i}\right )\,1{}\mathrm {i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________