3.479 \(\int \frac{1+x}{(-1+x) x^2} \, dx\)

Optimal. Leaf size=16 \[ \frac{1}{x}+2 \log (1-x)-2 \log (x) \]

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.025342, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083 \[ \frac{1}{x}+2 \log (1-x)-2 \log (x) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 3.26899, size = 14, normalized size = 0.88 \[ - 2 \log{\left (x \right )} + 2 \log{\left (- x + 1 \right )} + \frac{1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Mathematica [A]  time = 0.00437705, size = 16, normalized size = 1. \[ \frac{1}{x}+2 \log (1-x)-2 \log (x) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.009, size = 15, normalized size = 0.9 \[ 2\,\ln \left ( -1+x \right ) +{x}^{-1}-2\,\ln \left ( x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 0.771998, size = 19, normalized size = 1.19 \[ \frac{1}{x} + 2 \, \log \left (x - 1\right ) - 2 \, \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.260379, size = 24, normalized size = 1.5 \[ \frac{2 \, x \log \left (x - 1\right ) - 2 \, x \log \left (x\right ) + 1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.194442, size = 14, normalized size = 0.88 \[ - 2 \log{\left (x \right )} + 2 \log{\left (x - 1 \right )} + \frac{1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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