3.180 \(\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\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.06, 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 = {2074} \[ \frac {2}{1-x}+\frac {1}{x+1}-\frac {3}{2 (1-x)^2}+\log (1-x)-2 \log (x+1) \]

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 2074

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.06, size = 32, normalized size = 0.84 \[ -\frac {2}{x-1}+\frac {1}{x+1}-\frac {3}{2 (x-1)^2}+\log (x-1)-2 \log (x+1) \]

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]

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.03, size = 35, normalized size = 0.92 \[ \frac {-2 x^2-7 x+3}{2 (x-1)^2 (x+1)}+\log (x-1)-2 \log (x+1) \]

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[(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 - 7*x - 2*x^2)/(2*(-1 + x)^2*(1 + x)) + Log[-1 + x] - 2*Log[1 + x]

________________________________________________________________________________________

fricas [B]  time = 0.69, size = 65, normalized size = 1.71 \[ -\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 )}} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.87, size = 35, normalized size = 0.92 \[ -\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 ) \]

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

________________________________________________________________________________________

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 = 0.64, size = 38, normalized size = 1.00 \[ -\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 ) \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 33, normalized size = 0.87 \[ \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} \]

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)

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 36, normalized size = 0.95 \[ - \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 )} \]

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)

________________________________________________________________________________________