\(\int x^2 \log (d (a+b x+c x^2)^n) \, dx\) [73]

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

Optimal result

Integrand size = 19, antiderivative size = 136 \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\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 {\sqrt {b^2-4 a c} \left (b^2-a c\right ) n \text {arctanh}\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 ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2605, 814, 648, 632, 212, 642} \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\frac {n \sqrt {b^2-4 a c} \left (b^2-a c\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{3 c^3}+\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 {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} \]

[In]

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

[Out]

-1/3*((b^2 - 2*a*c)*n*x)/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 212

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

Rule 632

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 642

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]

Rule 648

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 814

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 2605

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]

Rubi steps \begin{align*} \text {integral}& = \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 ) \text {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] (verified)

Time = 0.07 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.90 \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\frac {c n x \left (-6 b^2+3 b c x-4 c \left (-3 a+c x^2\right )\right )+6 \sqrt {b^2-4 a c} \left (b^2-a c\right ) n \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )+3 b \left (b^2-3 a c\right ) n \log (a+x (b+c x))+6 c^3 x^3 \log \left (d (a+x (b+c x))^n\right )}{18 c^3} \]

[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 [A] (verified)

Time = 0.62 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.13

method result size
parts \(\frac {x^{3} \ln \left (d \left (c \,x^{2}+b x +a \right )^{n}\right )}{3}-\frac {n \left (-\frac {-\frac {2}{3} x^{3} c^{2}+\frac {1}{2} c b \,x^{2}+2 x c a -b^{2} x}{c^{2}}+\frac {\frac {\left (3 a b c -b^{3}\right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (2 a^{2} c -a \,b^{2}-\frac {\left (3 a b c -b^{3}\right ) b}{2 c}\right ) \arctan \left (\frac {2 x c +b}{\sqrt {4 c a -b^{2}}}\right )}{\sqrt {4 c a -b^{2}}}}{c^{2}}\right )}{3}\) \(154\)
risch \(\frac {x^{3} \ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )}{3}+\frac {i \pi \,x^{3} \operatorname {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{2}}{6}+\frac {i \pi \,x^{3} {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{2} \operatorname {csgn}\left (i d \right )}{6}-\frac {i \pi \,x^{3} \operatorname {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right ) \operatorname {csgn}\left (i d \right )}{6}-\frac {i \pi \,x^{3} {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{3}}{6}+\frac {\ln \left (d \right ) x^{3}}{3}-\frac {2 x^{3} n}{9}+\frac {b n \,x^{2}}{6 c}-\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}-2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x -\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) a b}{2 c^{2}}+\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}-2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x -\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) b^{3}}{6 c^{3}}-\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}+2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x +\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) a b}{2 c^{2}}+\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}+2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x +\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) b^{3}}{6 c^{3}}+\frac {2 x a n}{3 c}-\frac {b^{2} n x}{3 c^{2}}+\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}-2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x -\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}}{6 c^{3}}-\frac {n \ln \left (-4 c^{2} a^{2}+5 a \,b^{2} c -b^{4}+2 \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, c x +\sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}\, b \right ) \sqrt {-4 c^{3} a^{3}+9 c^{2} a^{2} b^{2}-6 a \,b^{4} c +b^{6}}}{6 c^{3}}\) \(870\)

[In]

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

[Out]

1/3*x^3*ln(d*(c*x^2+b*x+a)^n)-1/3*n*(-1/c^2*(-2/3*x^3*c^2+1/2*c*b*x^2+2*x*c*a-b^2*x)+1/c^2*(1/2*(3*a*b*c-b^3)/
c*ln(c*x^2+b*x+a)+2*(2*a^2*c-a*b^2-1/2*(3*a*b*c-b^3)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)
)))

Fricas [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 299, normalized size of antiderivative = 2.20 \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\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 ] \]

[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)]

Timed out. \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\text {Timed out} \]

[In]

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

[Out]

Timed out

Maxima [F(-2)]

Exception generated. \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\text {Exception raised: ValueError} \]

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.07 \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\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}} \]

[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)

Mupad [B] (verification not implemented)

Time = 1.66 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.68 \[ \int x^2 \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\frac {x^3\,\ln \left (d\,{\left (c\,x^2+b\,x+a\right )}^n\right )}{3}-\frac {2\,n\,x^3}{9}-x\,\left (\frac {b^2\,n}{3\,c^2}-\frac {2\,a\,n}{3\,c}\right )-\frac {\ln \left (4\,a\,c+b\,\sqrt {b^2-4\,a\,c}-b^2+2\,c\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (c\,\left (\frac {a\,b\,n}{2}-\frac {a\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )-\frac {b^3\,n}{6}+\frac {b^2\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )}{c^3}+\frac {\ln \left (b\,\sqrt {b^2-4\,a\,c}-4\,a\,c+b^2+2\,c\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (\frac {b^3\,n}{6}-c\,\left (\frac {a\,b\,n}{2}+\frac {a\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )+\frac {b^2\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )}{c^3}+\frac {b\,n\,x^2}{6\,c} \]

[In]

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

[Out]

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