Optimal. Leaf size=38 \[ -\frac {\sqrt {1+x+x^2}}{x}+\frac {1}{2} \tanh ^{-1}\left (\frac {2+x}{2 \sqrt {1+x+x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {744, 738, 212}
\begin {gather*} \frac {1}{2} \tanh ^{-1}\left (\frac {x+2}{2 \sqrt {x^2+x+1}}\right )-\frac {\sqrt {x^2+x+1}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 738
Rule 744
Rubi steps
\begin {align*} \int \frac {1}{x^2 \sqrt {1+x+x^2}} \, dx &=-\frac {\sqrt {1+x+x^2}}{x}-\frac {1}{2} \int \frac {1}{x \sqrt {1+x+x^2}} \, dx\\ &=-\frac {\sqrt {1+x+x^2}}{x}+\text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2+x}{\sqrt {1+x+x^2}}\right )\\ &=-\frac {\sqrt {1+x+x^2}}{x}+\frac {1}{2} \tanh ^{-1}\left (\frac {2+x}{2 \sqrt {1+x+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 33, normalized size = 0.87 \begin {gather*} -\frac {\sqrt {1+x+x^2}}{x}-\tanh ^{-1}\left (x-\sqrt {1+x+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 31, normalized size = 0.82
method | result | size |
default | \(\frac {\arctanh \left (\frac {2+x}{2 \sqrt {x^{2}+x +1}}\right )}{2}-\frac {\sqrt {x^{2}+x +1}}{x}\) | \(31\) |
risch | \(\frac {\arctanh \left (\frac {2+x}{2 \sqrt {x^{2}+x +1}}\right )}{2}-\frac {\sqrt {x^{2}+x +1}}{x}\) | \(31\) |
trager | \(-\frac {\sqrt {x^{2}+x +1}}{x}+\frac {\ln \left (\frac {2 \sqrt {x^{2}+x +1}+2+x}{x}\right )}{2}\) | \(35\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.72, size = 37, normalized size = 0.97 \begin {gather*} -\frac {\sqrt {x^{2} + x + 1}}{x} + \frac {1}{2} \, \operatorname {arsinh}\left (\frac {\sqrt {3} x}{3 \, {\left | x \right |}} + \frac {2 \, \sqrt {3}}{3 \, {\left | x \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.58, size = 52, normalized size = 1.37 \begin {gather*} \frac {x \log \left (-x + \sqrt {x^{2} + x + 1} + 1\right ) - x \log \left (-x + \sqrt {x^{2} + x + 1} - 1\right ) - 2 \, x - 2 \, \sqrt {x^{2} + x + 1}}{2 \, 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 {1}{x^{2} \sqrt {x^{2} + x + 1}}\, 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. 67 vs.
\(2 (30) = 60\).
time = 0.63, size = 67, normalized size = 1.76 \begin {gather*} \frac {x - \sqrt {x^{2} + x + 1} + 2}{{\left (x - \sqrt {x^{2} + x + 1}\right )}^{2} - 1} + \frac {1}{2} \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} + 1 \right |}\right ) - \frac {1}{2} \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} - 1 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.03, size = 31, normalized size = 0.82 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {\frac {x}{2}+1}{\sqrt {x^2+x+1}}\right )}{2}-\frac {\sqrt {x^2+x+1}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________