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

   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 = 18, antiderivative size = 17 \[ \int \frac {2+2 x}{(-1+x)^3 \left (1+x^2\right )} \, dx=-\frac {1}{(1-x)^2}+\frac {1}{-1+x}+\arctan (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {815, 209} \[ \int \frac {2+2 x}{(-1+x)^3 \left (1+x^2\right )} \, dx=\arctan (x)+\frac {1}{x-1}-\frac {1}{(1-x)^2} \]

[In]

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

[Out]

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

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.86 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76

method result size
risch \(\frac {x -2}{\left (x -1\right )^{2}}+\arctan \left (x \right )\) \(13\)
default \(\arctan \left (x \right )-\frac {1}{\left (x -1\right )^{2}}+\frac {1}{x -1}\) \(16\)
parallelrisch \(-\frac {i \ln \left (x -i\right ) x^{2}-i \ln \left (x +i\right ) x^{2}-2 i \ln \left (x -i\right ) x +2 i \ln \left (x +i\right ) x +3+i \ln \left (x -i\right )-i \ln \left (x +i\right )-x^{2}}{2 \left (x -1\right )^{2}}\) \(71\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.47 \[ \int \frac {2+2 x}{(-1+x)^3 \left (1+x^2\right )} \, dx=\frac {{\left (x^{2} - 2 \, x + 1\right )} \arctan \left (x\right ) + x - 2}{x^{2} - 2 \, x + 1} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82 \[ \int \frac {2+2 x}{(-1+x)^3 \left (1+x^2\right )} \, dx=\frac {x - 2}{x^{2} - 2 x + 1} + \operatorname {atan}{\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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