\(\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 result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 44, antiderivative size = 38 \[ \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=-\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] (verified)

Time = 0.05 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.023, Rules used = {2099} \[ \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=\frac {2}{1-x}+\frac {1}{x+1}-\frac {3}{2 (1-x)^2}+\log (1-x)-2 \log (x+1) \]

[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*} \text {integral}& = \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] (verified)

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

[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] (verified)

Time = 0.05 (sec) , antiderivative size = 31, normalized size of antiderivative = 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\)
parallelrisch \(\frac {2 \ln \left (-1+x \right ) x^{3}-4 \ln \left (1+x \right ) x^{3}+3-2 \ln \left (-1+x \right ) x^{2}+4 \ln \left (1+x \right ) x^{2}-2 \ln \left (-1+x \right ) x +4 \ln \left (1+x \right ) x -2 x^{2}+2 \ln \left (-1+x \right )-4 \ln \left (1+x \right )-7 x}{2 x^{3}-2 x^{2}-2 x +2}\) \(90\)

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (32) = 64\).

Time = 0.23 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.71 \[ \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=-\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 )}} \]

[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] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.95 \[ \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=- \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 )} \]

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

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00 \[ \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=-\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 ) \]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.92 \[ \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=-\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 ) \]

[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] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.87 \[ \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=\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} \]

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