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] + Log[1 - x]

________________________________________________________________________________________

Rubi [A]  time = 0.0752009, antiderivative size = 9, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, 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 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]

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])

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.0058596, size = 9, normalized size = 1. \[ \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]

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 8, normalized size = 0.9 \begin{align*} \arctan \left ( x \right ) +\ln \left ( x-1 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x)+ln(x-1)

________________________________________________________________________________________

Maxima [A]  time = 1.58857, size = 9, normalized size = 1. \begin{align*} \arctan \left (x\right ) + \log \left (x - 1\right ) \end{align*}

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)

________________________________________________________________________________________

Fricas [A]  time = 1.60499, size = 32, normalized size = 3.56 \begin{align*} \arctan \left (x\right ) + \log \left (x - 1\right ) \end{align*}

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)

________________________________________________________________________________________

Sympy [A]  time = 0.121915, size = 7, normalized size = 0.78 \begin{align*} \log{\left (x - 1 \right )} + \operatorname{atan}{\left (x \right )} \end{align*}

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)

________________________________________________________________________________________

Giac [B]  time = 1.22508, size = 38, normalized size = 4.22 \begin{align*} \frac{1}{4} \, \pi - \pi \left \lfloor \frac{\pi + 4 \, \arctan \left (x\right )}{4 \, \pi } + \frac{1}{2} \right \rfloor + \arctan \left (x\right ) + \log \left ({\left | x - 1 \right |}\right ) \end{align*}

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))