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

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

[Out]

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

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.294637, size = 15, normalized size = 0.88 \[ 4 \log{\left (x \right )} - \frac{\log{\left (x^{2} + 1 \right )}}{2} + \operatorname{atan}{\left (x \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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