3.2.80 \(\int \frac {5-3 x+6 x^2+5 x^3-x^4}{-1+x+2 x^2-2 x^3-x^4+x^5} \, dx\) [180]

Optimal. Leaf size=38 \[ -\frac {3}{2 (1-x)^2}+\frac {2}{1-x}+\frac {1}{1+x}+\log (1-x)-2 \log (1+x) \]

[Out]

-3/2/(1-x)^2+2/(1-x)+1/(1+x)+ln(1-x)-2*ln(1+x)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 44, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.023, Rules used = {2099} \begin {gather*} \frac {2}{1-x}+\frac {1}{x+1}-\frac {3}{2 (1-x)^2}+\log (1-x)-2 \log (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 32, normalized size = 0.84 \begin {gather*} -\frac {3}{2 (-1+x)^2}-\frac {2}{-1+x}+\frac {1}{1+x}+\log (-1+x)-2 \log (1+x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 31, normalized size = 0.82

method result size
default \(\ln \left (-1+x \right )-\frac {3}{2 \left (-1+x \right )^{2}}-\frac {2}{-1+x}+\frac {1}{1+x}-2 \ln \left (1+x \right )\) \(31\)
norman \(\frac {-x^{2}-\frac {7}{2} x +\frac {3}{2}}{\left (-1+x \right )^{2} \left (1+x \right )}-2 \ln \left (1+x \right )+\ln \left (-1+x \right )\) \(33\)
risch \(\frac {-x^{2}-\frac {7}{2} x +\frac {3}{2}}{x^{3}-x^{2}-x +1}-2 \ln \left (1+x \right )+\ln \left (-1+x \right )\) \(38\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(-1+x)-3/2/(-1+x)^2-2/(-1+x)+1/(1+x)-2*ln(1+x)

________________________________________________________________________________________

Maxima [A]
time = 1.12, size = 38, normalized size = 1.00 \begin {gather*} -\frac {2 \, x^{2} + 7 \, x - 3}{2 \, {\left (x^{3} - x^{2} - x + 1\right )}} - 2 \, \log \left (x + 1\right ) + \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(2*x^2 + 7*x - 3)/(x^3 - x^2 - x + 1) - 2*log(x + 1) + log(x - 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (32) = 64\).
time = 0.44, size = 65, normalized size = 1.71 \begin {gather*} -\frac {2 \, x^{2} + 4 \, {\left (x^{3} - x^{2} - x + 1\right )} \log \left (x + 1\right ) - 2 \, {\left (x^{3} - x^{2} - x + 1\right )} \log \left (x - 1\right ) + 7 \, x - 3}{2 \, {\left (x^{3} - x^{2} - x + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(2*x^2 + 4*(x^3 - x^2 - x + 1)*log(x + 1) - 2*(x^3 - x^2 - x + 1)*log(x - 1) + 7*x - 3)/(x^3 - x^2 - x +
1)

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 36, normalized size = 0.95 \begin {gather*} - \frac {2 x^{2} + 7 x - 3}{2 x^{3} - 2 x^{2} - 2 x + 2} + \log {\left (x - 1 \right )} - 2 \log {\left (x + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2*x**2 + 7*x - 3)/(2*x**3 - 2*x**2 - 2*x + 2) + log(x - 1) - 2*log(x + 1)

________________________________________________________________________________________

Giac [A]
time = 0.50, size = 35, normalized size = 0.92 \begin {gather*} -\frac {2 \, x^{2} + 7 \, x - 3}{2 \, {\left (x + 1\right )} {\left (x - 1\right )}^{2}} - 2 \, \log \left ({\left | x + 1 \right |}\right ) + \log \left ({\left | x - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(2*x^2 + 7*x - 3)/((x + 1)*(x - 1)^2) - 2*log(abs(x + 1)) + log(abs(x - 1))

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 33, normalized size = 0.87 \begin {gather*} \ln \left (x-1\right )-2\,\ln \left (x+1\right )+\frac {x^2+\frac {7\,x}{2}-\frac {3}{2}}{-x^3+x^2+x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1) - 2*log(x + 1) + ((7*x)/2 + x^2 - 3/2)/(x + x^2 - x^3 - 1)

________________________________________________________________________________________