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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {815, 209} \begin {gather*} \text {ArcTan}(x)+\frac {1}{x-1}-\frac {1}{(1-x)^2} \end {gather*}

Antiderivative was successfully verified.

[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*} \int \frac {2+2 x}{(-1+x)^3 \left (1+x^2\right )} \, dx &=\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]
time = 0.01, size = 17, normalized size = 1.00 \begin {gather*} \frac {-2+x+(-1+x)^2 \tan ^{-1}(x)}{(-1+x)^2} \end {gather*}

Antiderivative was successfully verified.

[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]
time = 0.23, size = 16, normalized size = 0.94

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.51, size = 17, normalized size = 1.00 \begin {gather*} \frac {x - 2}{x^{2} - 2 \, x + 1} + \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 25, normalized size = 1.47 \begin {gather*} \frac {{\left (x^{2} - 2 \, x + 1\right )} \arctan \left (x\right ) + x - 2}{x^{2} - 2 \, x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.04, size = 14, normalized size = 0.82 \begin {gather*} \frac {x - 2}{x^{2} - 2 x + 1} + \operatorname {atan}{\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 3.31, size = 12, normalized size = 0.71 \begin {gather*} \frac {x - 2}{{\left (x - 1\right )}^{2}} + \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 17, normalized size = 1.00 \begin {gather*} \mathrm {atan}\left (x\right )+\frac {x-2}{x^2-2\,x+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________