\(\int \frac {-12+4 x+(-4 x-24 x^3+8 x^4) \log (x)+(-36 x^3+8 x^4) \log ^2(x)}{9 x-6 x^2+x^3} \, dx\) [8505]

   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 [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 53, antiderivative size = 27 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=-2-\frac {4 x \left (\frac {\log (x)}{x}+x^2 \log ^2(x)\right )}{3-x} \]

[Out]

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

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.89, number of steps used = 24, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.283, Rules used = {1608, 27, 6874, 36, 31, 29, 2404, 2332, 2351, 2353, 2352, 2341, 2333, 2355, 2342} \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=4 x^2 \log ^2(x)-\frac {36 x \log ^2(x)}{3-x}+12 x \log ^2(x)-\frac {4 x \log (x)}{3 (3-x)}-\frac {4 \log (x)}{3} \]

[In]

Int[(-12 + 4*x + (-4*x - 24*x^3 + 8*x^4)*Log[x] + (-36*x^3 + 8*x^4)*Log[x]^2)/(9*x - 6*x^2 + x^3),x]

[Out]

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

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

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 1608

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 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2341

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

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2351

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

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2353

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

Rule 2355

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_))^2, x_Symbol] :> Simp[x*((a + b*Log[c*x^n])
^p/(d*(d + e*x))), x] - Dist[b*n*(p/d), Int[(a + b*Log[c*x^n])^(p - 1)/(d + e*x), x], x] /; FreeQ[{a, b, c, d,
 e, n, p}, x] && GtQ[p, 0]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{x \left (9-6 x+x^2\right )} \, dx \\ & = \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{(-3+x)^2 x} \, dx \\ & = \int \left (\frac {4}{(-3+x) x}+\frac {4 \left (-1-6 x^2+2 x^3\right ) \log (x)}{(-3+x)^2}+\frac {4 x^2 (-9+2 x) \log ^2(x)}{(-3+x)^2}\right ) \, dx \\ & = 4 \int \frac {1}{(-3+x) x} \, dx+4 \int \frac {\left (-1-6 x^2+2 x^3\right ) \log (x)}{(-3+x)^2} \, dx+4 \int \frac {x^2 (-9+2 x) \log ^2(x)}{(-3+x)^2} \, dx \\ & = \frac {4}{3} \int \frac {1}{-3+x} \, dx-\frac {4}{3} \int \frac {1}{x} \, dx+4 \int \left (6 \log (x)-\frac {\log (x)}{(-3+x)^2}+\frac {18 \log (x)}{-3+x}+2 x \log (x)\right ) \, dx+4 \int \left (3 \log ^2(x)-\frac {27 \log ^2(x)}{(-3+x)^2}+2 x \log ^2(x)\right ) \, dx \\ & = \frac {4}{3} \log (3-x)-\frac {4 \log (x)}{3}-4 \int \frac {\log (x)}{(-3+x)^2} \, dx+8 \int x \log (x) \, dx+8 \int x \log ^2(x) \, dx+12 \int \log ^2(x) \, dx+24 \int \log (x) \, dx+72 \int \frac {\log (x)}{-3+x} \, dx-108 \int \frac {\log ^2(x)}{(-3+x)^2} \, dx \\ & = -24 x-2 x^2+\frac {4}{3} \log (3-x)+72 \log (3) \log (-3+x)-\frac {4 \log (x)}{3}+24 x \log (x)-\frac {4 x \log (x)}{3 (3-x)}+4 x^2 \log (x)+12 x \log ^2(x)-\frac {36 x \log ^2(x)}{3-x}+4 x^2 \log ^2(x)-\frac {4}{3} \int \frac {1}{-3+x} \, dx-8 \int x \log (x) \, dx-24 \int \log (x) \, dx+72 \int \frac {\log \left (\frac {x}{3}\right )}{-3+x} \, dx-72 \int \frac {\log (x)}{-3+x} \, dx \\ & = -\frac {4 \log (x)}{3}-\frac {4 x \log (x)}{3 (3-x)}+12 x \log ^2(x)-\frac {36 x \log ^2(x)}{3-x}+4 x^2 \log ^2(x)-72 \operatorname {PolyLog}\left (2,1-\frac {x}{3}\right )-72 \int \frac {\log \left (\frac {x}{3}\right )}{-3+x} \, dx \\ & = -\frac {4 \log (x)}{3}-\frac {4 x \log (x)}{3 (3-x)}+12 x \log ^2(x)-\frac {36 x \log ^2(x)}{3-x}+4 x^2 \log ^2(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.26 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\frac {4}{3} \left (-\log (3-x)+\log (-3+x)+\frac {3 \log (x) \left (1+x^3 \log (x)\right )}{-3+x}\right ) \]

[In]

Integrate[(-12 + 4*x + (-4*x - 24*x^3 + 8*x^4)*Log[x] + (-36*x^3 + 8*x^4)*Log[x]^2)/(9*x - 6*x^2 + x^3),x]

[Out]

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

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.78

method result size
norman \(\frac {4 \ln \left (x \right )+4 x^{3} \ln \left (x \right )^{2}}{-3+x}\) \(21\)
parallelrisch \(\frac {4 \ln \left (x \right )+4 x^{3} \ln \left (x \right )^{2}}{-3+x}\) \(21\)
risch \(\frac {4 x^{3} \ln \left (x \right )^{2}}{-3+x}+\frac {4 \ln \left (x \right )}{-3+x}\) \(25\)

[In]

int(((8*x^4-36*x^3)*ln(x)^2+(8*x^4-24*x^3-4*x)*ln(x)+4*x-12)/(x^3-6*x^2+9*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.67 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\frac {4 \, {\left (x^{3} \log \left (x\right )^{2} + \log \left (x\right )\right )}}{x - 3} \]

[In]

integrate(((8*x^4-36*x^3)*log(x)^2+(8*x^4-24*x^3-4*x)*log(x)+4*x-12)/(x^3-6*x^2+9*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.74 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\frac {4 x^{3} \log {\left (x \right )}^{2}}{x - 3} + \frac {4 \log {\left (x \right )}}{x - 3} \]

[In]

integrate(((8*x**4-36*x**3)*ln(x)**2+(8*x**4-24*x**3-4*x)*ln(x)+4*x-12)/(x**3-6*x**2+9*x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\frac {4 \, x^{3} \log \left (x\right )^{2}}{x - 3} + \frac {4 \, \log \left (x\right )}{x - 3} \]

[In]

integrate(((8*x^4-36*x^3)*log(x)^2+(8*x^4-24*x^3-4*x)*log(x)+4*x-12)/(x^3-6*x^2+9*x),x, algorithm="maxima")

[Out]

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

Giac [F]

\[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\int { \frac {4 \, {\left ({\left (2 \, x^{4} - 9 \, x^{3}\right )} \log \left (x\right )^{2} + {\left (2 \, x^{4} - 6 \, x^{3} - x\right )} \log \left (x\right ) + x - 3\right )}}{x^{3} - 6 \, x^{2} + 9 \, x} \,d x } \]

[In]

integrate(((8*x^4-36*x^3)*log(x)^2+(8*x^4-24*x^3-4*x)*log(x)+4*x-12)/(x^3-6*x^2+9*x),x, algorithm="giac")

[Out]

integrate(4*((2*x^4 - 9*x^3)*log(x)^2 + (2*x^4 - 6*x^3 - x)*log(x) + x - 3)/(x^3 - 6*x^2 + 9*x), x)

Mupad [B] (verification not implemented)

Time = 12.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.63 \[ \int \frac {-12+4 x+\left (-4 x-24 x^3+8 x^4\right ) \log (x)+\left (-36 x^3+8 x^4\right ) \log ^2(x)}{9 x-6 x^2+x^3} \, dx=\frac {4\,\ln \left (x\right )\,\left (x^3\,\ln \left (x\right )+1\right )}{x-3} \]

[In]

int(-(log(x)^2*(36*x^3 - 8*x^4) - 4*x + log(x)*(4*x + 24*x^3 - 8*x^4) + 12)/(9*x - 6*x^2 + x^3),x)

[Out]

(4*log(x)*(x^3*log(x) + 1))/(x - 3)