3.157 \(\int \frac{4-x+2 x^2}{4 x+x^3} \, dx\)

Optimal. Leaf size=23 \[ \frac{1}{2} \log \left (x^2+4\right )+\log (x)-\frac{1}{2} \tan ^{-1}\left (\frac{x}{2}\right ) \]

[Out]

-ArcTan[x/2]/2 + Log[x] + Log[4 + x^2]/2

_______________________________________________________________________________________

Rubi [A]  time = 0.050405, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25 \[ \frac{1}{2} \log \left (x^2+4\right )+\log (x)-\frac{1}{2} \tan ^{-1}\left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

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

[Out]

-ArcTan[x/2]/2 + Log[x] + Log[4 + x^2]/2

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 4.33239, size = 17, normalized size = 0.74 \[ \log{\left (x \right )} + \frac{\log{\left (x^{2} + 4 \right )}}{2} - \frac{\operatorname{atan}{\left (\frac{x}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Mathematica [A]  time = 0.00730777, size = 23, normalized size = 1. \[ \frac{1}{2} \log \left (x^2+4\right )+\log (x)-\frac{1}{2} \tan ^{-1}\left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

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

[Out]

-ArcTan[x/2]/2 + Log[x] + Log[4 + x^2]/2

_______________________________________________________________________________________

Maple [A]  time = 0.009, size = 18, normalized size = 0.8 \[ -{\frac{1}{2}\arctan \left ({\frac{x}{2}} \right ) }+\ln \left ( x \right ) +{\frac{\ln \left ({x}^{2}+4 \right ) }{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.52335, size = 23, normalized size = 1. \[ -\frac{1}{2} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{1}{2} \, \log \left (x^{2} + 4\right ) + \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.212299, size = 23, normalized size = 1. \[ -\frac{1}{2} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{1}{2} \, \log \left (x^{2} + 4\right ) + \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.14869, size = 17, normalized size = 0.74 \[ \log{\left (x \right )} + \frac{\log{\left (x^{2} + 4 \right )}}{2} - \frac{\operatorname{atan}{\left (\frac{x}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.212899, size = 24, normalized size = 1.04 \[ -\frac{1}{2} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{1}{2} \,{\rm ln}\left (x^{2} + 4\right ) +{\rm ln}\left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-1/2*arctan(1/2*x) + 1/2*ln(x^2 + 4) + ln(abs(x))