3.2.93 \(\int \frac {1}{(-1+x)^2 x^2} \, dx\) [193]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {46} \begin {gather*} \frac {1}{1-x}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rubi steps

\begin {align*} \int \frac {1}{(-1+x)^2 x^2} \, dx &=\int \left (\frac {1}{(-1+x)^2}-\frac {2}{-1+x}+\frac {1}{x^2}+\frac {2}{x}\right ) \, dx\\ &=\frac {1}{1-x}-\frac {1}{x}-2 \log (1-x)+2 \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 25, normalized size = 1.00 \begin {gather*} -\frac {1}{-1+x}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 2.09, size = 29, normalized size = 1.16 \begin {gather*} \frac {1-2 x+2 x \left (-1+x\right ) \left (\text {Log}\left [x\right ]-\text {Log}\left [-1+x\right ]\right )}{x \left (-1+x\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(1 - 2 x + 2 x (-1 + x) (Log[x] - Log[-1 + x])) / (x (-1 + x))

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 24, normalized size = 0.96

method result size
default \(-\frac {1}{x}+2 \ln \left (x \right )-\frac {1}{-1+x}-2 \ln \left (-1+x \right )\) \(24\)
norman \(\frac {1-2 x}{x \left (-1+x \right )}+2 \ln \left (x \right )-2 \ln \left (-1+x \right )\) \(26\)
risch \(\frac {1-2 x}{x \left (-1+x \right )}+2 \ln \left (x \right )-2 \ln \left (-1+x \right )\) \(26\)
meijerg \(-\frac {1}{x}+1+2 \ln \left (x \right )+2 i \pi +\frac {3 x}{-3 x +3}-2 \ln \left (1-x \right )\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(-1+x)^2/x^2,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.32, size = 27, normalized size = 1.08 \begin {gather*} -\frac {2 \, x - 1}{x^{2} - x} - 2 \, \log \left (x - 1\right ) + 2 \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-1+x)^2/x^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 40, normalized size = 1.60 \begin {gather*} -\frac {2 \, {\left (x^{2} - x\right )} \log \left (x - 1\right ) - 2 \, {\left (x^{2} - x\right )} \log \left (x\right ) + 2 \, x - 1}{x^{2} - x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-1+x)^2/x^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 20, normalized size = 0.80 \begin {gather*} \frac {1 - 2 x}{x^{2} - x} + 2 \log {\left (x \right )} - 2 \log {\left (x - 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-1+x)**2/x**2,x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 27, normalized size = 1.08 \begin {gather*} 2 \ln \left |x\right |-2 \ln \left |x-1\right |+\frac {2 x-1}{-x^{2}+x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-1+x)^2/x^2,x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.05, size = 27, normalized size = 1.08 \begin {gather*} \frac {1}{x\,\left (x-1\right )}-\frac {2}{x-1}-2\,\ln \left (\frac {x-1}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(x^2*(x - 1)^2),x)

[Out]

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

________________________________________________________________________________________