3.168 \(\int \frac{-2+x^2}{x \left (2+x^2\right )} \, dx\)

Optimal. Leaf size=11 \[ \log \left (x^2+2\right )-\log (x) \]

[Out]

-Log[x] + Log[2 + x^2]

_______________________________________________________________________________________

Rubi [A]  time = 0.0357837, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125 \[ \log \left (x^2+2\right )-\log (x) \]

Antiderivative was successfully verified.

[In]  Int[(-2 + x^2)/(x*(2 + x^2)),x]

[Out]

-Log[x] + Log[2 + x^2]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 3.19894, size = 12, normalized size = 1.09 \[ - \frac{\log{\left (x^{2} \right )}}{2} + \log{\left (x^{2} + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**2-2)/x/(x**2+2),x)

[Out]

-log(x**2)/2 + log(x**2 + 2)

_______________________________________________________________________________________

Mathematica [A]  time = 0.00504965, size = 11, normalized size = 1. \[ \log \left (x^2+2\right )-\log (x) \]

Antiderivative was successfully verified.

[In]  Integrate[(-2 + x^2)/(x*(2 + x^2)),x]

[Out]

-Log[x] + Log[2 + x^2]

_______________________________________________________________________________________

Maple [A]  time = 0.006, size = 12, normalized size = 1.1 \[ -\ln \left ( x \right ) +\ln \left ({x}^{2}+2 \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^2-2)/x/(x^2+2),x)

[Out]

-ln(x)+ln(x^2+2)

_______________________________________________________________________________________

Maxima [A]  time = 1.36547, size = 18, normalized size = 1.64 \[ \log \left (x^{2} + 2\right ) - \frac{1}{2} \, \log \left (x^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^2 - 2)/((x^2 + 2)*x),x, algorithm="maxima")

[Out]

log(x^2 + 2) - 1/2*log(x^2)

_______________________________________________________________________________________

Fricas [A]  time = 0.200052, size = 15, normalized size = 1.36 \[ \log \left (x^{2} + 2\right ) - \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^2 - 2)/((x^2 + 2)*x),x, algorithm="fricas")

[Out]

log(x^2 + 2) - log(x)

_______________________________________________________________________________________

Sympy [A]  time = 0.091153, size = 8, normalized size = 0.73 \[ - \log{\left (x \right )} + \log{\left (x^{2} + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**2-2)/x/(x**2+2),x)

[Out]

-log(x) + log(x**2 + 2)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.217447, size = 18, normalized size = 1.64 \[{\rm ln}\left (x^{2} + 2\right ) - \frac{1}{2} \,{\rm ln}\left (x^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^2 - 2)/((x^2 + 2)*x),x, algorithm="giac")

[Out]

ln(x^2 + 2) - 1/2*ln(x^2)