### 3.73 $$\int x^2 \log (d (a+b x+c x^2)^n) \, dx$$

Optimal. Leaf size=136 $\frac{b n \left (b^2-3 a c\right ) \log \left (a+b x+c x^2\right )}{6 c^3}-\frac{n x \left (b^2-2 a c\right )}{3 c^2}+\frac{n \sqrt{b^2-4 a c} \left (b^2-a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{3 c^3}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}$

[Out]

-((b^2 - 2*a*c)*n*x)/(3*c^2) + (b*n*x^2)/(6*c) - (2*n*x^3)/9 + (Sqrt[b^2 - 4*a*c]*(b^2 - a*c)*n*ArcTanh[(b + 2
*c*x)/Sqrt[b^2 - 4*a*c]])/(3*c^3) + (b*(b^2 - 3*a*c)*n*Log[a + b*x + c*x^2])/(6*c^3) + (x^3*Log[d*(a + b*x + c
*x^2)^n])/3

________________________________________________________________________________________

Rubi [A]  time = 0.149037, antiderivative size = 136, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 19, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.316, Rules used = {2525, 800, 634, 618, 206, 628} $\frac{b n \left (b^2-3 a c\right ) \log \left (a+b x+c x^2\right )}{6 c^3}-\frac{n x \left (b^2-2 a c\right )}{3 c^2}+\frac{n \sqrt{b^2-4 a c} \left (b^2-a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{3 c^3}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}$

Antiderivative was successfully veriﬁed.

[In]

Int[x^2*Log[d*(a + b*x + c*x^2)^n],x]

[Out]

-((b^2 - 2*a*c)*n*x)/(3*c^2) + (b*n*x^2)/(6*c) - (2*n*x^3)/9 + (Sqrt[b^2 - 4*a*c]*(b^2 - a*c)*n*ArcTanh[(b + 2
*c*x)/Sqrt[b^2 - 4*a*c]])/(3*c^3) + (b*(b^2 - 3*a*c)*n*Log[a + b*x + c*x^2])/(6*c^3) + (x^3*Log[d*(a + b*x + c
*x^2)^n])/3

Rule 2525

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 634

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

Rule 618

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

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

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

Rubi steps

\begin{align*} \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx &=\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac{1}{3} n \int \frac{x^3 (b+2 c x)}{a+b x+c x^2} \, dx\\ &=\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac{1}{3} n \int \left (\frac{b^2-2 a c}{c^2}-\frac{b x}{c}+2 x^2-\frac{a \left (b^2-2 a c\right )+b \left (b^2-3 a c\right ) x}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac{\left (b^2-2 a c\right ) n x}{3 c^2}+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{n \int \frac{a \left (b^2-2 a c\right )+b \left (b^2-3 a c\right ) x}{a+b x+c x^2} \, dx}{3 c^2}\\ &=-\frac{\left (b^2-2 a c\right ) n x}{3 c^2}+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{\left (b \left (b^2-3 a c\right ) n\right ) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{6 c^3}-\frac{\left (\left (b^4-5 a b^2 c+4 a^2 c^2\right ) n\right ) \int \frac{1}{a+b x+c x^2} \, dx}{6 c^3}\\ &=-\frac{\left (b^2-2 a c\right ) n x}{3 c^2}+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}+\frac{b \left (b^2-3 a c\right ) n \log \left (a+b x+c x^2\right )}{6 c^3}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{\left (\left (b^4-5 a b^2 c+4 a^2 c^2\right ) n\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{3 c^3}\\ &=-\frac{\left (b^2-2 a c\right ) n x}{3 c^2}+\frac{b n x^2}{6 c}-\frac{2 n x^3}{9}+\frac{\sqrt{b^2-4 a c} \left (b^2-a c\right ) n \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{3 c^3}+\frac{b \left (b^2-3 a c\right ) n \log \left (a+b x+c x^2\right )}{6 c^3}+\frac{1}{3} x^3 \log \left (d \left (a+b x+c x^2\right )^n\right )\\ \end{align*}

Mathematica [A]  time = 0.109442, size = 122, normalized size = 0.9 $\frac{c n x \left (-4 c \left (c x^2-3 a\right )-6 b^2+3 b c x\right )+3 b n \left (b^2-3 a c\right ) \log (a+x (b+c x))+6 n \sqrt{b^2-4 a c} \left (b^2-a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )+6 c^3 x^3 \log \left (d (a+x (b+c x))^n\right )}{18 c^3}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x^2*Log[d*(a + b*x + c*x^2)^n],x]

[Out]

(c*n*x*(-6*b^2 + 3*b*c*x - 4*c*(-3*a + c*x^2)) + 6*Sqrt[b^2 - 4*a*c]*(b^2 - a*c)*n*ArcTanh[(b + 2*c*x)/Sqrt[b^
2 - 4*a*c]] + 3*b*(b^2 - 3*a*c)*n*Log[a + x*(b + c*x)] + 6*c^3*x^3*Log[d*(a + x*(b + c*x))^n])/(18*c^3)

________________________________________________________________________________________

Maple [C]  time = 0.089, size = 870, normalized size = 6.4 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*ln(d*(c*x^2+b*x+a)^n),x)

[Out]

1/3*x^3*ln((c*x^2+b*x+a)^n)-1/6*I*Pi*x^3*csgn(I*d)*csgn(I*(c*x^2+b*x+a)^n)*csgn(I*d*(c*x^2+b*x+a)^n)+1/6*I*Pi*
x^3*csgn(I*d)*csgn(I*d*(c*x^2+b*x+a)^n)^2+1/6*I*Pi*x^3*csgn(I*(c*x^2+b*x+a)^n)*csgn(I*d*(c*x^2+b*x+a)^n)^2-1/6
*I*Pi*x^3*csgn(I*d*(c*x^2+b*x+a)^n)^3+1/3*ln(d)*x^3-2/9*n*x^3+1/6*b*n*x^2/c-1/2/c^2*n*ln(-4*a^2*c^2+5*a*b^2*c-
b^4-2*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*c*x-(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*b)*a*b
+1/6/c^3*n*ln(-4*a^2*c^2+5*a*b^2*c-b^4-2*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*c*x-(-4*a^3*c^3+9*a^2*
b^2*c^2-6*a*b^4*c+b^6)^(1/2)*b)*b^3-1/2/c^2*n*ln(-4*a^2*c^2+5*a*b^2*c-b^4+2*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*
c+b^6)^(1/2)*c*x+(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*b)*a*b+1/6/c^3*n*ln(-4*a^2*c^2+5*a*b^2*c-b^4+2
*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*c*x+(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*b)*b^3+2/3/
c*a*n*x-1/3*b^2*n*x/c^2+1/6/c^3*n*ln(-4*a^2*c^2+5*a*b^2*c-b^4-2*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)
*c*x-(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*b)*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)-1/6/c^3*
n*ln(-4*a^2*c^2+5*a*b^2*c-b^4+2*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)*c*x+(-4*a^3*c^3+9*a^2*b^2*c^2-6
*a*b^4*c+b^6)^(1/2)*b)*(-4*a^3*c^3+9*a^2*b^2*c^2-6*a*b^4*c+b^6)^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(d*(c*x^2+b*x+a)^n),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.9961, size = 691, normalized size = 5.08 \begin{align*} \left [-\frac{4 \, c^{3} n x^{3} - 6 \, c^{3} x^{3} \log \left (d\right ) - 3 \, b c^{2} n x^{2} + 3 \,{\left (b^{2} - a c\right )} \sqrt{b^{2} - 4 \, a c} n \log \left (\frac{2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt{b^{2} - 4 \, a c}{\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 6 \,{\left (b^{2} c - 2 \, a c^{2}\right )} n x - 3 \,{\left (2 \, c^{3} n x^{3} +{\left (b^{3} - 3 \, a b c\right )} n\right )} \log \left (c x^{2} + b x + a\right )}{18 \, c^{3}}, -\frac{4 \, c^{3} n x^{3} - 6 \, c^{3} x^{3} \log \left (d\right ) - 3 \, b c^{2} n x^{2} - 6 \,{\left (b^{2} - a c\right )} \sqrt{-b^{2} + 4 \, a c} n \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 6 \,{\left (b^{2} c - 2 \, a c^{2}\right )} n x - 3 \,{\left (2 \, c^{3} n x^{3} +{\left (b^{3} - 3 \, a b c\right )} n\right )} \log \left (c x^{2} + b x + a\right )}{18 \, c^{3}}\right ] \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(d*(c*x^2+b*x+a)^n),x, algorithm="fricas")

[Out]

[-1/18*(4*c^3*n*x^3 - 6*c^3*x^3*log(d) - 3*b*c^2*n*x^2 + 3*(b^2 - a*c)*sqrt(b^2 - 4*a*c)*n*log((2*c^2*x^2 + 2*
b*c*x + b^2 - 2*a*c - sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) + 6*(b^2*c - 2*a*c^2)*n*x - 3*(2*c^3*n
*x^3 + (b^3 - 3*a*b*c)*n)*log(c*x^2 + b*x + a))/c^3, -1/18*(4*c^3*n*x^3 - 6*c^3*x^3*log(d) - 3*b*c^2*n*x^2 - 6
*(b^2 - a*c)*sqrt(-b^2 + 4*a*c)*n*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + 6*(b^2*c - 2*a*c^2)*
n*x - 3*(2*c^3*n*x^3 + (b^3 - 3*a*b*c)*n)*log(c*x^2 + b*x + a))/c^3]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*ln(d*(c*x**2+b*x+a)**n),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.29281, size = 197, normalized size = 1.45 \begin{align*} \frac{1}{3} \, n x^{3} \log \left (c x^{2} + b x + a\right ) - \frac{1}{9} \,{\left (2 \, n - 3 \, \log \left (d\right )\right )} x^{3} + \frac{b n x^{2}}{6 \, c} - \frac{{\left (b^{2} n - 2 \, a c n\right )} x}{3 \, c^{2}} + \frac{{\left (b^{3} n - 3 \, a b c n\right )} \log \left (c x^{2} + b x + a\right )}{6 \, c^{3}} - \frac{{\left (b^{4} n - 5 \, a b^{2} c n + 4 \, a^{2} c^{2} n\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{3 \, \sqrt{-b^{2} + 4 \, a c} c^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(d*(c*x^2+b*x+a)^n),x, algorithm="giac")

[Out]

1/3*n*x^3*log(c*x^2 + b*x + a) - 1/9*(2*n - 3*log(d))*x^3 + 1/6*b*n*x^2/c - 1/3*(b^2*n - 2*a*c*n)*x/c^2 + 1/6*
(b^3*n - 3*a*b*c*n)*log(c*x^2 + b*x + a)/c^3 - 1/3*(b^4*n - 5*a*b^2*c*n + 4*a^2*c^2*n)*arctan((2*c*x + b)/sqrt
(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^3)