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

Optimal. Leaf size=587 $-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \text{PolyLog}\left (2,-\frac{-\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \text{PolyLog}\left (2,\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}+\frac{n \left (b-\sqrt{b^2-4 a c}\right ) \log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d \left (a+b x+c x^2\right )^n\right )}{c}+\frac{n \left (\sqrt{b^2-4 a c}+b\right ) \log \left (\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d \left (a+b x+c x^2\right )^n\right )}{c}-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \log ^2\left (-\sqrt{b^2-4 a c}+b+2 c x\right )}{2 c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \log ^2\left (\sqrt{b^2-4 a c}+b+2 c x\right )}{2 c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \log \left (-\frac{-\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right ) \log \left (\sqrt{b^2-4 a c}+b+2 c x\right )}{c}-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}-\frac{4 n^2 \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c}+x \log ^2\left (d \left (a+b x+c x^2\right )^n\right )-4 n x \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac{2 b n^2 \log \left (a+b x+c x^2\right )}{c}+8 n^2 x$

[Out]

8*n^2*x - (4*Sqrt[b^2 - 4*a*c]*n^2*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/c - ((b - Sqrt[b^2 - 4*a*c])*n^2*Lo
g[b - Sqrt[b^2 - 4*a*c] + 2*c*x]^2)/(2*c) - ((b + Sqrt[b^2 - 4*a*c])*n^2*Log[-(b - Sqrt[b^2 - 4*a*c] + 2*c*x)/
(2*Sqrt[b^2 - 4*a*c])]*Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x])/c - ((b + Sqrt[b^2 - 4*a*c])*n^2*Log[b + Sqrt[b^2 -
4*a*c] + 2*c*x]^2)/(2*c) - ((b - Sqrt[b^2 - 4*a*c])*n^2*Log[b - Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[(b + Sqrt[b^2
- 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c - (2*b*n^2*Log[a + b*x + c*x^2])/c - 4*n*x*Log[d*(a + b*x + c*x^2)
^n] + ((b - Sqrt[b^2 - 4*a*c])*n*Log[b - Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[d*(a + b*x + c*x^2)^n])/c + ((b + Sqrt
[b^2 - 4*a*c])*n*Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[d*(a + b*x + c*x^2)^n])/c + x*Log[d*(a + b*x + c*x^2)^
n]^2 - ((b - Sqrt[b^2 - 4*a*c])*n^2*PolyLog[2, -(b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c - ((
b + Sqrt[b^2 - 4*a*c])*n^2*PolyLog[2, (b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c

________________________________________________________________________________________

Rubi [A]  time = 0.949104, antiderivative size = 587, normalized size of antiderivative = 1., number of steps used = 27, number of rules used = 14, integrand size = 17, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.824, Rules used = {2523, 2528, 773, 634, 618, 206, 628, 2524, 2418, 2390, 2301, 2394, 2393, 2391} $-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \text{PolyLog}\left (2,-\frac{-\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \text{PolyLog}\left (2,\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}+\frac{n \left (b-\sqrt{b^2-4 a c}\right ) \log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d \left (a+b x+c x^2\right )^n\right )}{c}+\frac{n \left (\sqrt{b^2-4 a c}+b\right ) \log \left (\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d \left (a+b x+c x^2\right )^n\right )}{c}-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \log ^2\left (-\sqrt{b^2-4 a c}+b+2 c x\right )}{2 c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \log ^2\left (\sqrt{b^2-4 a c}+b+2 c x\right )}{2 c}-\frac{n^2 \left (\sqrt{b^2-4 a c}+b\right ) \log \left (-\frac{-\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right ) \log \left (\sqrt{b^2-4 a c}+b+2 c x\right )}{c}-\frac{n^2 \left (b-\sqrt{b^2-4 a c}\right ) \log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )}{c}-\frac{4 n^2 \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c}+x \log ^2\left (d \left (a+b x+c x^2\right )^n\right )-4 n x \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac{2 b n^2 \log \left (a+b x+c x^2\right )}{c}+8 n^2 x$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

8*n^2*x - (4*Sqrt[b^2 - 4*a*c]*n^2*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/c - ((b - Sqrt[b^2 - 4*a*c])*n^2*Lo
g[b - Sqrt[b^2 - 4*a*c] + 2*c*x]^2)/(2*c) - ((b + Sqrt[b^2 - 4*a*c])*n^2*Log[-(b - Sqrt[b^2 - 4*a*c] + 2*c*x)/
(2*Sqrt[b^2 - 4*a*c])]*Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x])/c - ((b + Sqrt[b^2 - 4*a*c])*n^2*Log[b + Sqrt[b^2 -
4*a*c] + 2*c*x]^2)/(2*c) - ((b - Sqrt[b^2 - 4*a*c])*n^2*Log[b - Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[(b + Sqrt[b^2
- 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c - (2*b*n^2*Log[a + b*x + c*x^2])/c - 4*n*x*Log[d*(a + b*x + c*x^2)
^n] + ((b - Sqrt[b^2 - 4*a*c])*n*Log[b - Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[d*(a + b*x + c*x^2)^n])/c + ((b + Sqrt
[b^2 - 4*a*c])*n*Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[d*(a + b*x + c*x^2)^n])/c + x*Log[d*(a + b*x + c*x^2)^
n]^2 - ((b - Sqrt[b^2 - 4*a*c])*n^2*PolyLog[2, -(b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c - ((
b + Sqrt[b^2 - 4*a*c])*n^2*PolyLog[2, (b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/c

Rule 2523

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.), x_Symbol] :> Simp[x*(a + b*Log[c*RFx^p])^n, x] - Dist[b*n*p
, Int[SimplifyIntegrand[(x*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, p}, x] &
& RationalFunctionQ[RFx, x] && IGtQ[n, 0]

Rule 2528

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*(RGx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*
RFx^p])^n, RGx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, p}, x] && RationalFunctionQ[RFx, x] && RationalF
unctionQ[RGx, x] && IGtQ[n, 0]

Rule 773

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*g*x)/
c, x] + Dist[1/c, Int[(c*d*f - a*e*g + (c*e*f + c*d*g - b*e*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]

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]

Rule 2524

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

Rule 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

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 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 2394

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

Rule 2393

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

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
e, n}, x] && EqQ[c*d, 1]

Rubi steps

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

Mathematica [A]  time = 0.823967, size = 478, normalized size = 0.81 $\frac{n \left (n \left (\sqrt{b^2-4 a c}-b\right ) \left (2 \text{PolyLog}\left (2,\frac{\sqrt{b^2-4 a c}-b-2 c x}{2 \sqrt{b^2-4 a c}}\right )+\log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \left (\log \left (-\sqrt{b^2-4 a c}+b+2 c x\right )+2 \log \left (\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )\right )\right )-n \left (\sqrt{b^2-4 a c}+b\right ) \left (2 \text{PolyLog}\left (2,\frac{\sqrt{b^2-4 a c}+b+2 c x}{2 \sqrt{b^2-4 a c}}\right )+\log \left (\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 \log \left (\frac{\sqrt{b^2-4 a c}-b-2 c x}{2 \sqrt{b^2-4 a c}}\right )+\log \left (\sqrt{b^2-4 a c}+b+2 c x\right )\right )\right )+2 \left (b-\sqrt{b^2-4 a c}\right ) \log \left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d (a+x (b+c x))^n\right )+2 \left (\sqrt{b^2-4 a c}+b\right ) \log \left (\sqrt{b^2-4 a c}+b+2 c x\right ) \log \left (d (a+x (b+c x))^n\right )+4 n \left (-2 \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )-b \log (a+x (b+c x))+4 c x\right )-8 c x \log \left (d (a+x (b+c x))^n\right )\right )}{2 c}+x \log ^2\left (d (a+x (b+c x))^n\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x*Log[d*(a + x*(b + c*x))^n]^2 + (n*(4*n*(4*c*x - 2*Sqrt[b^2 - 4*a*c]*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]] -
b*Log[a + x*(b + c*x)]) - 8*c*x*Log[d*(a + x*(b + c*x))^n] + 2*(b - Sqrt[b^2 - 4*a*c])*Log[b - Sqrt[b^2 - 4*a
*c] + 2*c*x]*Log[d*(a + x*(b + c*x))^n] + 2*(b + Sqrt[b^2 - 4*a*c])*Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x]*Log[d*(
a + x*(b + c*x))^n] + (-b + Sqrt[b^2 - 4*a*c])*n*(Log[b - Sqrt[b^2 - 4*a*c] + 2*c*x]*(Log[b - Sqrt[b^2 - 4*a*c
] + 2*c*x] + 2*Log[(b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])]) + 2*PolyLog[2, (-b + Sqrt[b^2 - 4*a
*c] - 2*c*x)/(2*Sqrt[b^2 - 4*a*c])]) - (b + Sqrt[b^2 - 4*a*c])*n*(Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x]*(2*Log[(-
b + Sqrt[b^2 - 4*a*c] - 2*c*x)/(2*Sqrt[b^2 - 4*a*c])] + Log[b + Sqrt[b^2 - 4*a*c] + 2*c*x]) + 2*PolyLog[2, (b
+ Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])))/(2*c)

________________________________________________________________________________________

Maple [F]  time = 0.205, size = 0, normalized size = 0. \begin{align*} \int \left ( \ln \left ( d \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) \right ) ^{2}\, dx \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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(log(d*(c*x^2+b*x+a)^n)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\log \left ({\left (c x^{2} + b x + a\right )}^{n} d\right )^{2}, x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log{\left (d \left (a + b x + c x^{2}\right )^{n} \right )}^{2}\, dx \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log \left ({\left (c x^{2} + b x + a\right )}^{n} d\right )^{2}\,{d x} \end{align*}

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

[In]

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

[Out]

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