3.330 \(\int \frac{-1+x+4 x^3}{(-1+x) x^2 \left (1+x^2\right )} \, dx\)

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

[Out]

-x^(-1) + ArcTan[x] + 2*Log[1 - x] - Log[1 + x^2]

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

-x^(-1) + ArcTan[x] + 2*Log[1 - x] - Log[1 + x^2]

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

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

[Out]

-x^(-1) + ArcTan[x] + 2*Log[1 - x] - Log[1 + x^2]

_______________________________________________________________________________________

Maple [A]  time = 0.01, size = 23, normalized size = 1. \[ 2\,\ln \left ( -1+x \right ) -{x}^{-1}-\ln \left ({x}^{2}+1 \right ) +\arctan \left ( x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 0.893454, size = 30, normalized size = 1.25 \[ -\frac{1}{x} + \arctan \left (x\right ) - \log \left (x^{2} + 1\right ) + 2 \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.274551, size = 35, normalized size = 1.46 \[ \frac{x \arctan \left (x\right ) - x \log \left (x^{2} + 1\right ) + 2 \, x \log \left (x - 1\right ) - 1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.355072, size = 19, normalized size = 0.79 \[ 2 \log{\left (x - 1 \right )} - \log{\left (x^{2} + 1 \right )} + \operatorname{atan}{\left (x \right )} - \frac{1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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