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

Optimal. Leaf size=30 \[ -x+\log \left (\left (2+\frac {5 e^2}{2}\right ) \left (2+x-\frac {x^2}{2-x}\right )\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 20, normalized size of antiderivative = 0.67, number of steps used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2074, 260} \begin {gather*} \log \left (2-x^2\right )-x-\log (2-x) \end {gather*}

Antiderivative was successfully verified.

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

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 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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 20, normalized size = 0.67 \begin {gather*} -x-\log (2-x)+\log \left (2-x^2\right ) \end {gather*}

Antiderivative was successfully verified.

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

________________________________________________________________________________________

fricas [A]  time = 0.55, size = 16, normalized size = 0.53 \begin {gather*} -x + \log \left (x^{2} - 2\right ) - \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

giac [A]  time = 0.14, size = 18, normalized size = 0.60 \begin {gather*} -x + \log \left ({\left | x^{2} - 2 \right |}\right ) - \log \left ({\left | x - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 17, normalized size = 0.57




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[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(x-2)

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 16, normalized size = 0.53 \begin {gather*} -x + \log \left (x^{2} - 2\right ) - \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

mupad [B]  time = 4.03, size = 16, normalized size = 0.53 \begin {gather*} \ln \left (x^2-2\right )-\ln \left (x-2\right )-x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 12, normalized size = 0.40 \begin {gather*} - x - \log {\left (x - 2 \right )} + \log {\left (x^{2} - 2 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________