\(\int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx\) [5889]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [C] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 21 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=-2+2 x-\log ^2(4)+x \log (3 (3-x)) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {6874, 45, 2436, 2332} \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=2 x-(3-x) \log (9-3 x)+3 \log (3-x) \]

[In]

Int[(-6 + 3*x + (-3 + x)*Log[9 - 3*x])/(-3 + x),x]

[Out]

2*x - (3 - x)*Log[9 - 3*x] + 3*Log[3 - x]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

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 2436

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

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {3 (-2+x)}{-3+x}+\log (9-3 x)\right ) \, dx \\ & = 3 \int \frac {-2+x}{-3+x} \, dx+\int \log (9-3 x) \, dx \\ & = -\left (\frac {1}{3} \text {Subst}(\int \log (x) \, dx,x,9-3 x)\right )+3 \int \left (1+\frac {1}{-3+x}\right ) \, dx \\ & = 2 x-(3-x) \log (9-3 x)+3 \log (3-x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.90 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=x (2+\log (3))-\log (27)+x \log (3-x) \]

[In]

Integrate[(-6 + 3*x + (-3 + x)*Log[9 - 3*x])/(-3 + x),x]

[Out]

x*(2 + Log[3]) - Log[27] + x*Log[3 - x]

Maple [A] (verified)

Time = 0.46 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.62

method result size
norman \(\ln \left (-3 x +9\right ) x +2 x\) \(13\)
risch \(\ln \left (-3 x +9\right ) x +2 x\) \(13\)
parallelrisch \(12+\ln \left (-3 x +9\right ) x +2 x\) \(14\)
parts \(2 x +3 \ln \left (-3+x \right )-\frac {\ln \left (-3 x +9\right ) \left (-3 x +9\right )}{3}+3\) \(25\)
derivativedivides \(-\frac {\ln \left (-3 x +9\right ) \left (-3 x +9\right )}{3}+2 x -6+3 \ln \left (-3 x +9\right )\) \(27\)
default \(-\frac {\ln \left (-3 x +9\right ) \left (-3 x +9\right )}{3}+2 x -6+3 \ln \left (-3 x +9\right )\) \(27\)

[In]

int(((-3+x)*ln(-3*x+9)+3*x-6)/(-3+x),x,method=_RETURNVERBOSE)

[Out]

ln(-3*x+9)*x+2*x

Fricas [A] (verification not implemented)

none

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

[In]

integrate(((-3+x)*log(-3*x+9)+3*x-6)/(-3+x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.48 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=x \log {\left (9 - 3 x \right )} + 2 x \]

[In]

integrate(((-3+x)*ln(-3*x+9)+3*x-6)/(-3+x),x)

[Out]

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

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.95 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=3 \, {\left (-i \, \pi - \log \left (3\right )\right )} \log \left (x - 3\right ) - 3 \, \log \left (x - 3\right )^{2} + {\left (x + 3 \, \log \left (x - 3\right )\right )} \log \left (-3 \, x + 9\right ) + 2 \, x \]

[In]

integrate(((-3+x)*log(-3*x+9)+3*x-6)/(-3+x),x, algorithm="maxima")

[Out]

3*(-I*pi - log(3))*log(x - 3) - 3*log(x - 3)^2 + (x + 3*log(x - 3))*log(-3*x + 9) + 2*x

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.57 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=x \log \left (-3 \, x + 9\right ) + 2 \, x \]

[In]

integrate(((-3+x)*log(-3*x+9)+3*x-6)/(-3+x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.48 \[ \int \frac {-6+3 x+(-3+x) \log (9-3 x)}{-3+x} \, dx=x\,\left (\ln \left (9-3\,x\right )+2\right ) \]

[In]

int((3*x + log(9 - 3*x)*(x - 3) - 6)/(x - 3),x)

[Out]

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