3.67.27 \(\int \frac {(32+16 x+2 x^2) \log (-2+x)+(-16+4 x+2 x^2) \log ^2(-2+x)}{-2+x} \, dx\)

Optimal. Leaf size=12 \[ (4+x)^2 \log ^2(-2+x) \]

________________________________________________________________________________________

Rubi [B]  time = 0.40, antiderivative size = 89, normalized size of antiderivative = 7.42, number of steps used = 16, number of rules used = 15, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {6741, 12, 6742, 43, 2395, 2411, 2334, 2301, 2401, 2389, 2296, 2295, 2390, 2305, 2304} \begin {gather*} (2-x)^2 \log ^2(x-2)-12 (2-x) \log ^2(x-2)-36 \log ^2(x-2)-(2-x)^2 \log (x-2)+24 (2-x) \log (x-2)-\left (-(2-x)^2+24 (2-x)-72 \log (x-2)\right ) \log (x-2) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((32 + 16*x + 2*x^2)*Log[-2 + x] + (-16 + 4*x + 2*x^2)*Log[-2 + x]^2)/(-2 + x),x]

[Out]

24*(2 - x)*Log[-2 + x] - (2 - x)^2*Log[-2 + x] - (24*(2 - x) - (2 - x)^2 - 72*Log[-2 + x])*Log[-2 + x] - 36*Lo
g[-2 + x]^2 - 12*(2 - x)*Log[-2 + x]^2 + (2 - x)^2*Log[-2 + x]^2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 43

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 2295

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

Rule 2296

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 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2304

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 2305

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 2334

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

Rule 2389

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 2390

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

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 2401

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

Rule 2411

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((g*x)/e)^q*((e*h - d*i)/e + (i*x)/e)^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rule 6741

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

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 {2 (4+x) \log (-2+x) (-4-x+2 \log (-2+x)-x \log (-2+x))}{2-x} \, dx\\ &=2 \int \frac {(4+x) \log (-2+x) (-4-x+2 \log (-2+x)-x \log (-2+x))}{2-x} \, dx\\ &=2 \int \left (\frac {(4+x)^2 \log (-2+x)}{-2+x}+(4+x) \log ^2(-2+x)\right ) \, dx\\ &=2 \int \frac {(4+x)^2 \log (-2+x)}{-2+x} \, dx+2 \int (4+x) \log ^2(-2+x) \, dx\\ &=2 \int \left (6 \log ^2(-2+x)+(-2+x) \log ^2(-2+x)\right ) \, dx+2 \operatorname {Subst}\left (\int \frac {(6+x)^2 \log (x)}{x} \, dx,x,-2+x\right )\\ &=-\left (\left (24 (2-x)-(-2+x)^2-72 \log (-2+x)\right ) \log (-2+x)\right )+2 \int (-2+x) \log ^2(-2+x) \, dx-2 \operatorname {Subst}\left (\int \left (12+\frac {x}{2}+\frac {36 \log (x)}{x}\right ) \, dx,x,-2+x\right )+12 \int \log ^2(-2+x) \, dx\\ &=-\frac {1}{2} (2-x)^2-24 x-\left (24 (2-x)-(-2+x)^2-72 \log (-2+x)\right ) \log (-2+x)+2 \operatorname {Subst}\left (\int x \log ^2(x) \, dx,x,-2+x\right )+12 \operatorname {Subst}\left (\int \log ^2(x) \, dx,x,-2+x\right )-72 \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,-2+x\right )\\ &=-\frac {1}{2} (2-x)^2-24 x-\left (24 (2-x)-(-2+x)^2-72 \log (-2+x)\right ) \log (-2+x)-36 \log ^2(-2+x)-12 (2-x) \log ^2(-2+x)+(2-x)^2 \log ^2(-2+x)-2 \operatorname {Subst}(\int x \log (x) \, dx,x,-2+x)-24 \operatorname {Subst}(\int \log (x) \, dx,x,-2+x)\\ &=24 (2-x) \log (-2+x)-(2-x)^2 \log (-2+x)-\left (24 (2-x)-(-2+x)^2-72 \log (-2+x)\right ) \log (-2+x)-36 \log ^2(-2+x)-12 (2-x) \log ^2(-2+x)+(2-x)^2 \log ^2(-2+x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [B]  time = 0.05, size = 47, normalized size = 3.92 \begin {gather*} 2 \left (-2 \log (2-x)+2 \log (-2+x)+8 \log ^2(-2+x)+4 x \log ^2(-2+x)+\frac {1}{2} x^2 \log ^2(-2+x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((32 + 16*x + 2*x^2)*Log[-2 + x] + (-16 + 4*x + 2*x^2)*Log[-2 + x]^2)/(-2 + x),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 15, normalized size = 1.25 \begin {gather*} {\left (x^{2} + 8 \, x + 16\right )} \log \left (x - 2\right )^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2+4*x-16)*log(x-2)^2+(2*x^2+16*x+32)*log(x-2))/(x-2),x, algorithm="fricas")

[Out]

(x^2 + 8*x + 16)*log(x - 2)^2

________________________________________________________________________________________

giac [A]  time = 0.25, size = 15, normalized size = 1.25 \begin {gather*} {\left (x^{2} + 8 \, x + 16\right )} \log \left (x - 2\right )^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2+4*x-16)*log(x-2)^2+(2*x^2+16*x+32)*log(x-2))/(x-2),x, algorithm="giac")

[Out]

(x^2 + 8*x + 16)*log(x - 2)^2

________________________________________________________________________________________

maple [A]  time = 0.08, size = 16, normalized size = 1.33




method result size



risch \(\left (x^{2}+8 x +16\right ) \ln \left (x -2\right )^{2}\) \(16\)
norman \(\ln \left (x -2\right )^{2} x^{2}+16 \ln \left (x -2\right )^{2}+8 \ln \left (x -2\right )^{2} x\) \(29\)
derivativedivides \(\left (x -2\right )^{2} \ln \left (x -2\right )^{2}+12 \left (x -2\right ) \ln \left (x -2\right )^{2}+36 \ln \left (x -2\right )^{2}\) \(33\)
default \(\left (x -2\right )^{2} \ln \left (x -2\right )^{2}+12 \left (x -2\right ) \ln \left (x -2\right )^{2}+36 \ln \left (x -2\right )^{2}\) \(33\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((2*x^2+4*x-16)*ln(x-2)^2+(2*x^2+16*x+32)*ln(x-2))/(x-2),x,method=_RETURNVERBOSE)

[Out]

(x^2+8*x+16)*ln(x-2)^2

________________________________________________________________________________________

maxima [B]  time = 0.38, size = 97, normalized size = 8.08 \begin {gather*} \frac {1}{2} \, {\left (2 \, \log \left (x - 2\right )^{2} - 2 \, \log \left (x - 2\right ) + 1\right )} {\left (x - 2\right )}^{2} + 12 \, {\left (\log \left (x - 2\right )^{2} - 2 \, \log \left (x - 2\right ) + 2\right )} {\left (x - 2\right )} - \frac {1}{2} \, x^{2} + {\left (x^{2} + 4 \, x + 8 \, \log \left (x - 2\right )\right )} \log \left (x - 2\right ) + 16 \, {\left (x + 2 \, \log \left (x - 2\right )\right )} \log \left (x - 2\right ) - 4 \, \log \left (x - 2\right )^{2} - 22 \, x - 44 \, \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2+4*x-16)*log(x-2)^2+(2*x^2+16*x+32)*log(x-2))/(x-2),x, algorithm="maxima")

[Out]

1/2*(2*log(x - 2)^2 - 2*log(x - 2) + 1)*(x - 2)^2 + 12*(log(x - 2)^2 - 2*log(x - 2) + 2)*(x - 2) - 1/2*x^2 + (
x^2 + 4*x + 8*log(x - 2))*log(x - 2) + 16*(x + 2*log(x - 2))*log(x - 2) - 4*log(x - 2)^2 - 22*x - 44*log(x - 2
)

________________________________________________________________________________________

mupad [B]  time = 4.32, size = 12, normalized size = 1.00 \begin {gather*} {\ln \left (x-2\right )}^2\,{\left (x+4\right )}^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((log(x - 2)*(16*x + 2*x^2 + 32) + log(x - 2)^2*(4*x + 2*x^2 - 16))/(x - 2),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 14, normalized size = 1.17 \begin {gather*} \left (x^{2} + 8 x + 16\right ) \log {\left (x - 2 \right )}^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x**2+4*x-16)*ln(x-2)**2+(2*x**2+16*x+32)*ln(x-2))/(x-2),x)

[Out]

(x**2 + 8*x + 16)*log(x - 2)**2

________________________________________________________________________________________