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

Optimal. Leaf size=9 \[ \log (1-x)+\tan ^{-1}(x) \]

[Out]

arctan(x)+ln(1-x)

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1586, 1593, 1629, 203} \[ \log (1-x)+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] + Log[1 - x]

Rule 203

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

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1629

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 9, normalized size = 1.00 \[ \log (1-x)+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] + Log[1 - x]

________________________________________________________________________________________

fricas [A]  time = 0.89, size = 7, normalized size = 0.78 \[ \arctan \relax (x) + \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x) + log(x - 1)

________________________________________________________________________________________

giac [B]  time = 0.29, size = 28, normalized size = 3.11 \[ \frac {1}{4} \, \pi - \pi \left \lfloor \frac {\pi + 4 \, \arctan \relax (x)}{4 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \relax (x) + \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*pi - pi*floor(1/4*(pi + 4*arctan(x))/pi + 1/2) + arctan(x) + log(abs(x - 1))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 8, normalized size = 0.89 \[ \arctan \relax (x )+\ln \left (x -1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(x-1)+arctan(x)

________________________________________________________________________________________

maxima [A]  time = 2.17, size = 7, normalized size = 0.78 \[ \arctan \relax (x) + \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x) + log(x - 1)

________________________________________________________________________________________

mupad [B]  time = 2.10, size = 19, normalized size = 2.11 \[ \ln \left (x-1\right )-\mathrm {atan}\left (\frac {5}{4\,x+2}-\frac {1}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1) - atan(5/(4*x + 2) - 1/2)

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 7, normalized size = 0.78 \[ \log {\left (x - 1 \right )} + \operatorname {atan}{\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1) + atan(x)

________________________________________________________________________________________