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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 26, antiderivative size = 21 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=2 \log (1-x)-\log (2-x)+\log (1+x) \]

[Out]

2*ln(1-x)-ln(2-x)+ln(1+x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 21, 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.038, Rules used = {2099} \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=2 \log (1-x)-\log (2-x)+\log (x+1) \]

[In]

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

[Out]

2*Log[1 - x] - Log[2 - x] + 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 {1}{2-x}+\frac {2}{-1+x}+\frac {1}{1+x}\right ) \, dx \\ & = 2 \log (1-x)-\log (2-x)+\log (1+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=2 \log (1-x)-\log (2-x)+\log (1+x) \]

[In]

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

[Out]

2*Log[1 - x] - Log[2 - x] + Log[1 + x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86

method result size
default \(\ln \left (x +1\right )+2 \ln \left (x -1\right )-\ln \left (x -2\right )\) \(18\)
norman \(\ln \left (x +1\right )+2 \ln \left (x -1\right )-\ln \left (x -2\right )\) \(18\)
risch \(\ln \left (x +1\right )+2 \ln \left (x -1\right )-\ln \left (x -2\right )\) \(18\)
parallelrisch \(\ln \left (x +1\right )+2 \ln \left (x -1\right )-\ln \left (x -2\right )\) \(18\)

[In]

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

[Out]

ln(x+1)+2*ln(x-1)-ln(x-2)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.81 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=\log \left (x + 1\right ) + 2 \, \log \left (x - 1\right ) - \log \left (x - 2\right ) \]

[In]

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

[Out]

log(x + 1) + 2*log(x - 1) - log(x - 2)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=- \log {\left (x - 2 \right )} + 2 \log {\left (x - 1 \right )} + \log {\left (x + 1 \right )} \]

[In]

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

[Out]

-log(x - 2) + 2*log(x - 1) + log(x + 1)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.81 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=\log \left (x + 1\right ) + 2 \, \log \left (x - 1\right ) - \log \left (x - 2\right ) \]

[In]

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

[Out]

log(x + 1) + 2*log(x - 1) - log(x - 2)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=\log \left ({\left | x + 1 \right |}\right ) + 2 \, \log \left ({\left | x - 1 \right |}\right ) - \log \left ({\left | x - 2 \right |}\right ) \]

[In]

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

[Out]

log(abs(x + 1)) + 2*log(abs(x - 1)) - log(abs(x - 2))

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {-1-5 x+2 x^2}{2-x-2 x^2+x^3} \, dx=2\,\ln \left (x-1\right )-2\,\mathrm {atanh}\left (\frac {144}{11\,\left (22\,x-50\right )}+\frac {13}{11}\right ) \]

[In]

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

[Out]

2*log(x - 1) - 2*atanh(144/(11*(22*x - 50)) + 13/11)