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

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

[Out]

arctan(x)+ln(1-x)

________________________________________________________________________________________

Rubi [A]
time = 0.04, 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 = {1600, 1607, 1643, 209} \begin {gather*} \text {ArcTan}(x)+\log (1-x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 1607

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 1643

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.00, size = 9, normalized size = 1.00 \begin {gather*} \tan ^{-1}(x)+\log (1-x) \end {gather*}

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.20, size = 8, normalized size = 0.89

method result size
default \(\ln \left (-1+x \right )+\arctan \left (x \right )\) \(8\)
risch \(\ln \left (-1+x \right )+\arctan \left (x \right )\) \(8\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(-1+x)+arctan(x)

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 7, normalized size = 0.78 \begin {gather*} \arctan \left (x\right ) + \log \left (x - 1\right ) \end {gather*}

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 = 0.40, size = 7, normalized size = 0.78 \begin {gather*} \arctan \left (x\right ) + \log \left (x - 1\right ) \end {gather*}

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.05, size = 7, normalized size = 0.78 \begin {gather*} \log {\left (x - 1 \right )} + \operatorname {atan}{\left (x \right )} \end {gather*}

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] Leaf count of result is larger than twice the leaf count of optimal. 28 vs. \(2 (9) = 18\).
time = 4.32, size = 28, normalized size = 3.11 \begin {gather*} \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 {gather*}

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________