3.6.55 \(\int \frac {-36+16 x+5 x^2-2 x^3+(12-4 x) \log (-3+x)}{-3 x^2+x^3} \, dx\)

Optimal. Leaf size=23 \[ \frac {-x+(-4+x) (3-2 x-\log (-3+x))}{x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.22, antiderivative size = 26, normalized size of antiderivative = 1.13, number of steps used = 9, number of rules used = 7, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {1593, 6742, 1620, 2395, 36, 31, 29} \begin {gather*} -2 x-\frac {12}{x}-\log (3-x)+\frac {4 \log (x-3)}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-36 + 16*x + 5*x^2 - 2*x^3 + (12 - 4*x)*Log[-3 + x])/(-3*x^2 + x^3),x]

[Out]

-12/x - 2*x - Log[3 - x] + (4*Log[-3 + x])/x

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

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

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 1593

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

Rule 1620

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rule 2395

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[((f + g
*x)^(q + 1)*(a + b*Log[c*(d + e*x)^n]))/(g*(q + 1)), x] - Dist[(b*e*n)/(g*(q + 1)), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 25, normalized size = 1.09 \begin {gather*} -2 x-\log (3-x)-\frac {4 (3-\log (-3+x))}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-36 + 16*x + 5*x^2 - 2*x^3 + (12 - 4*x)*Log[-3 + x])/(-3*x^2 + x^3),x]

[Out]

-2*x - Log[3 - x] - (4*(3 - Log[-3 + x]))/x

________________________________________________________________________________________

fricas [A]  time = 0.59, size = 20, normalized size = 0.87 \begin {gather*} -\frac {2 \, x^{2} + {\left (x - 4\right )} \log \left (x - 3\right ) + 12}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-4*x+12)*log(x-3)-2*x^3+5*x^2+16*x-36)/(x^3-3*x^2),x, algorithm="fricas")

[Out]

-(2*x^2 + (x - 4)*log(x - 3) + 12)/x

________________________________________________________________________________________

giac [A]  time = 0.56, size = 24, normalized size = 1.04 \begin {gather*} -2 \, x + \frac {4 \, \log \left (x - 3\right )}{x} - \frac {12}{x} - \log \left (x - 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-4*x+12)*log(x-3)-2*x^3+5*x^2+16*x-36)/(x^3-3*x^2),x, algorithm="giac")

[Out]

-2*x + 4*log(x - 3)/x - 12/x - log(x - 3)

________________________________________________________________________________________

maple [A]  time = 0.29, size = 25, normalized size = 1.09




method result size



norman \(\frac {-12-\ln \left (x -3\right ) x -2 x^{2}+4 \ln \left (x -3\right )}{x}\) \(25\)
derivativedivides \(-\frac {4 \ln \left (x -3\right ) \left (x -3\right )}{3 x}-2 x +6-\frac {12}{x}+\frac {\ln \left (x -3\right )}{3}\) \(29\)
default \(-\frac {4 \ln \left (x -3\right ) \left (x -3\right )}{3 x}-2 x +6-\frac {12}{x}+\frac {\ln \left (x -3\right )}{3}\) \(29\)
risch \(\frac {4 \ln \left (x -3\right )}{x}-\frac {\ln \left (x -3\right ) x +2 x^{2}+12}{x}\) \(29\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-4*x+12)*ln(x-3)-2*x^3+5*x^2+16*x-36)/(x^3-3*x^2),x,method=_RETURNVERBOSE)

[Out]

(-12-ln(x-3)*x-2*x^2+4*ln(x-3))/x

________________________________________________________________________________________

maxima [A]  time = 0.90, size = 34, normalized size = 1.48 \begin {gather*} -\frac {2 \, x^{2} - {\left (3 \, x + 4\right )} \log \left (x - 3\right )}{x} - \frac {12}{x} - 4 \, \log \left (x - 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-4*x+12)*log(x-3)-2*x^3+5*x^2+16*x-36)/(x^3-3*x^2),x, algorithm="maxima")

[Out]

-(2*x^2 - (3*x + 4)*log(x - 3))/x - 12/x - 4*log(x - 3)

________________________________________________________________________________________

mupad [B]  time = 0.54, size = 22, normalized size = 0.96 \begin {gather*} \frac {4\,\ln \left (x-3\right )-12}{x}-\ln \left (x-3\right )-2\,x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x^3 - 5*x^2 - 16*x + log(x - 3)*(4*x - 12) + 36)/(3*x^2 - x^3),x)

[Out]

(4*log(x - 3) - 12)/x - log(x - 3) - 2*x

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 19, normalized size = 0.83 \begin {gather*} - 2 x - \log {\left (x - 3 \right )} + \frac {4 \log {\left (x - 3 \right )}}{x} - \frac {12}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-4*x+12)*ln(x-3)-2*x**3+5*x**2+16*x-36)/(x**3-3*x**2),x)

[Out]

-2*x - log(x - 3) + 4*log(x - 3)/x - 12/x

________________________________________________________________________________________