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

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

Optimal result

Integrand size = 21, antiderivative size = 29 \[ \int \frac {6-x+(-3+x) \log (3-x)}{-3+x} \, dx=e^3-i \pi -x^2-\log (5)+x (-2+x+\log (3-x)) \]

[Out]

(x+ln(-x+3)-2)*x-x^2+exp(3)-ln(5)-I*Pi

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86, 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-x+(-3+x) \log (3-x)}{-3+x} \, dx=-2 x-(3-x) \log (3-x)+3 \log (3-x) \]

[In]

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

[Out]

-2*x + 3*Log[3 - x] - (3 - x)*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 {6-x}{-3+x}+\log (3-x)\right ) \, dx \\ & = \int \frac {6-x}{-3+x} \, dx+\int \log (3-x) \, dx \\ & = \int \left (-1+\frac {3}{-3+x}\right ) \, dx-\text {Subst}(\int \log (x) \, dx,x,3-x) \\ & = -2 x+3 \log (3-x)-(3-x) \log (3-x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.41 \[ \int \frac {6-x+(-3+x) \log (3-x)}{-3+x} \, dx=-2 x+x \log (3-x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.45

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.28 \[ \int \frac {6-x+(-3+x) \log (3-x)}{-3+x} \, dx=-\frac {3}{2} \, \log \left (x - 3\right )^{2} + {\left (x + 3 \, \log \left (x - 3\right )\right )} \log \left (-x + 3\right ) - \frac {3}{2} \, \log \left (-x + 3\right )^{2} - 2 \, x \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.79 \[ \int \frac {6-x+(-3+x) \log (3-x)}{-3+x} \, dx={\left (x - 3\right )} \log \left (-x + 3\right ) - 2 \, x + 3 \, \log \left (-x + 3\right ) + 6 \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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