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]
________________________________________________________________________________________
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 verified.
[In]
[Out]
Rule 2523
Rule 2528
Rule 773
Rule 634
Rule 618
Rule 206
Rule 628
Rule 2524
Rule 2418
Rule 2390
Rule 2301
Rule 2394
Rule 2393
Rule 2391
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 verified.
[In]
[Out]
________________________________________________________________________________________
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*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
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*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]