\(\int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx\) [5849]

   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 = 31, antiderivative size = 30 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=-x+\log \left (\left (2+\frac {5 e^2}{2}\right ) \left (2+x-\frac {x^2}{2-x}\right )\right ) \]

[Out]

ln((2-x^2/(2-x)+x)*(2+5/2*exp(2)))-x

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.67, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2099, 266} \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=\log \left (2-x^2\right )-x-\log (2-x) \]

[In]

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

[Out]

-x - Log[2 - x] + Log[2 - x^2]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.67 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=-x-\log (2-x)+\log \left (2-x^2\right ) \]

[In]

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

[Out]

-x - Log[2 - x] + Log[2 - x^2]

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.57

method result size
default \(-x +\ln \left (x^{2}-2\right )-\ln \left (-2+x \right )\) \(17\)
norman \(-x +\ln \left (x^{2}-2\right )-\ln \left (-2+x \right )\) \(17\)
risch \(-x +\ln \left (x^{2}-2\right )-\ln \left (-2+x \right )\) \(17\)
parallelrisch \(-x +\ln \left (x^{2}-2\right )-\ln \left (-2+x \right )\) \(17\)

[In]

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

[Out]

-x+ln(x^2-2)-ln(-2+x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.53 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=-x + \log \left (x^{2} - 2\right ) - \log \left (x - 2\right ) \]

[In]

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

[Out]

-x + log(x^2 - 2) - log(x - 2)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.40 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=- x - \log {\left (x - 2 \right )} + \log {\left (x^{2} - 2 \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.53 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=-x + \log \left (x^{2} - 2\right ) - \log \left (x - 2\right ) \]

[In]

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

[Out]

-x + log(x^2 - 2) - log(x - 2)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.60 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=-x + \log \left ({\left | x^{2} - 2 \right |}\right ) - \log \left ({\left | x - 2 \right |}\right ) \]

[In]

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

[Out]

-x + log(abs(x^2 - 2)) - log(abs(x - 2))

Mupad [B] (verification not implemented)

Time = 13.64 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.53 \[ \int \frac {-2-2 x+3 x^2-x^3}{4-2 x-2 x^2+x^3} \, dx=\ln \left (x^2-2\right )-\ln \left (x-2\right )-x \]

[In]

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

[Out]

log(x^2 - 2) - log(x - 2) - x