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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 25 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=-\frac {1}{(1-x)^2}+\frac {2}{1-x}+\log (1-x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {711} \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=\frac {2}{1-x}-\frac {1}{(1-x)^2}+\log (1-x) \]

[In]

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

[Out]

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

Rule 711

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=\frac {1-2 x}{(-1+x)^2}+\log (-1+x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68

method result size
norman \(\frac {1-2 x}{\left (-1+x \right )^{2}}+\ln \left (-1+x \right )\) \(17\)
risch \(\frac {1-2 x}{\left (-1+x \right )^{2}}+\ln \left (-1+x \right )\) \(17\)
default \(\ln \left (-1+x \right )-\frac {2}{-1+x}-\frac {1}{\left (-1+x \right )^{2}}\) \(20\)
parallelrisch \(\frac {\ln \left (-1+x \right ) x^{2}+1-2 \ln \left (-1+x \right ) x +\ln \left (-1+x \right )-2 x}{\left (-1+x \right )^{2}}\) \(31\)
meijerg \(-\frac {x \left (2-x \right )}{2 \left (1-x \right )^{2}}+\frac {x \left (-9 x +6\right )}{6 \left (1-x \right )^{2}}+\ln \left (1-x \right )\) \(38\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.16 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=\frac {{\left (x^{2} - 2 \, x + 1\right )} \log \left (x - 1\right ) - 2 \, x + 1}{x^{2} - 2 \, x + 1} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=\frac {1 - 2 x}{x^{2} - 2 x + 1} + \log {\left (x - 1 \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=-\frac {2 \, x - 1}{x^{2} - 2 \, x + 1} + \log \left (x - 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.72 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=-\frac {2 \, x - 1}{{\left (x - 1\right )}^{2}} + \log \left ({\left | x - 1 \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \frac {1+x^2}{(-1+x)^3} \, dx=\ln \left (x-1\right )-\frac {2\,x-1}{x^2-2\,x+1} \]

[In]

int((x^2 + 1)/(x - 1)^3,x)

[Out]

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