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

Optimal. Leaf size=24 \[ -x+\log \left (\frac {6480 (2-x)^2 x^2}{(1-x)^2}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {1594, 1628} \begin {gather*} -x-2 \log (1-x)+2 \log (2-x)+2 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1594

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 1628

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {4-6 x+5 x^2-x^3}{x \left (2-3 x+x^2\right )} \, dx\\ &=\int \left (-1+\frac {2}{-2+x}-\frac {2}{-1+x}+\frac {2}{x}\right ) \, dx\\ &=-x-2 \log (1-x)+2 \log (2-x)+2 \log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 24, normalized size = 1.00 \begin {gather*} -x-2 \log (1-x)+2 \log (2-x)+2 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.21, size = 20, normalized size = 0.83 \begin {gather*} -x + 2 \, \log \left (x^{2} - 2 \, x\right ) - 2 \, \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 23, normalized size = 0.96 \begin {gather*} -x - 2 \, \log \left ({\left | x - 1 \right |}\right ) + 2 \, \log \left ({\left | x - 2 \right |}\right ) + 2 \, \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 21, normalized size = 0.88




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 20, normalized size = 0.83 \begin {gather*} -x - 2 \, \log \left (x - 1\right ) + 2 \, \log \left (x - 2\right ) + 2 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 3.46, size = 18, normalized size = 0.75 \begin {gather*} 2\,\ln \left (x\,\left (x-2\right )\right )-x-2\,\ln \left (x-1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________