Optimal. Leaf size=121 \[ \frac {n \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{4 a^2}-\frac {n \log (x) \left (b^2-2 a c\right )}{2 a^2}-\frac {b n \sqrt {b^2-4 a c} \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{2 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}-\frac {b n}{2 a x} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 121, normalized size of antiderivative = 1.00, 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 {n \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{4 a^2}-\frac {n \log (x) \left (b^2-2 a c\right )}{2 a^2}-\frac {b n \sqrt {b^2-4 a c} \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{2 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}-\frac {b n}{2 a x} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 800
Rule 2525
Rubi steps
\begin {align*} \int \frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x^3} \, dx &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}+\frac {1}{2} n \int \frac {b+2 c x}{x^2 \left (a+b x+c x^2\right )} \, dx\\ &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}+\frac {1}{2} n \int \left (\frac {b}{a x^2}+\frac {-b^2+2 a c}{a^2 x}+\frac {b \left (b^2-3 a c\right )+c \left (b^2-2 a c\right ) x}{a^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac {b n}{2 a x}-\frac {\left (b^2-2 a c\right ) n \log (x)}{2 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}+\frac {n \int \frac {b \left (b^2-3 a c\right )+c \left (b^2-2 a c\right ) x}{a+b x+c x^2} \, dx}{2 a^2}\\ &=-\frac {b n}{2 a x}-\frac {\left (b^2-2 a c\right ) n \log (x)}{2 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}+\frac {\left (b \left (b^2-4 a c\right ) n\right ) \int \frac {1}{a+b x+c x^2} \, dx}{4 a^2}+\frac {\left (\left (b^2-2 a c\right ) n\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{4 a^2}\\ &=-\frac {b n}{2 a x}-\frac {\left (b^2-2 a c\right ) n \log (x)}{2 a^2}+\frac {\left (b^2-2 a c\right ) n \log \left (a+b x+c x^2\right )}{4 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}-\frac {\left (b \left (b^2-4 a c\right ) n\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{2 a^2}\\ &=-\frac {b n}{2 a x}-\frac {b \sqrt {b^2-4 a c} n \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{2 a^2}-\frac {\left (b^2-2 a c\right ) n \log (x)}{2 a^2}+\frac {\left (b^2-2 a c\right ) n \log \left (a+b x+c x^2\right )}{4 a^2}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{2 x^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.24, size = 105, normalized size = 0.87 \[ -\frac {\frac {n x \left (2 x \log (x) \left (b^2-2 a c\right )-x \left (b^2-2 a c\right ) \log (a+x (b+c x))+2 b x \sqrt {b^2-4 a c} \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )+2 a b\right )}{a^2}+2 \log \left (d (a+x (b+c x))^n\right )}{4 x^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 261, normalized size = 2.16 \[ \left [\frac {\sqrt {b^{2} - 4 \, a c} b n x^{2} \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 ) - 2 \, {\left (b^{2} - 2 \, a c\right )} n x^{2} \log \relax (x) - 2 \, a b n x - 2 \, a^{2} \log \relax (d) + {\left ({\left (b^{2} - 2 \, a c\right )} n x^{2} - 2 \, a^{2} n\right )} \log \left (c x^{2} + b x + a\right )}{4 \, a^{2} x^{2}}, -\frac {2 \, \sqrt {-b^{2} + 4 \, a c} b n x^{2} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left (b^{2} - 2 \, a c\right )} n x^{2} \log \relax (x) + 2 \, a b n x + 2 \, a^{2} \log \relax (d) - {\left ({\left (b^{2} - 2 \, a c\right )} n x^{2} - 2 \, a^{2} n\right )} \log \left (c x^{2} + b x + a\right )}{4 \, a^{2} x^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 129, normalized size = 1.07 \[ \frac {{\left (b^{2} n - 2 \, a c n\right )} \log \left (c x^{2} + b x + a\right )}{4 \, a^{2}} - \frac {n \log \left (c x^{2} + b x + a\right )}{2 \, x^{2}} - \frac {{\left (b^{2} n - 2 \, a c n\right )} \log \relax (x)}{2 \, a^{2}} + \frac {{\left (b^{3} n - 4 \, a b c n\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{2 \, \sqrt {-b^{2} + 4 \, a c} a^{2}} - \frac {b n x + a \log \relax (d)}{2 \, a x^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.46, size = 1178, normalized size = 9.74 \[ -\frac {\ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )}{2 x^{2}}-\frac {-4 a c n \,x^{2} \ln \relax (x )+2 a c n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}+5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}-6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}+8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )+2 a c n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}-5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}+6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}-8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )+2 b^{2} n \,x^{2} \ln \relax (x )-b^{2} n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}+5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}-6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}+8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )-b^{2} n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}-5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}+6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}-8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )-i \pi \,a^{2} \mathrm {csgn}\left (i d \right ) \mathrm {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )+i \pi \,a^{2} \mathrm {csgn}\left (i d \right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{2}+i \pi \,a^{2} \mathrm {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{2}-i \pi \,a^{2} \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{3}+2 a b n x -\sqrt {-4 a \,b^{2} c +b^{4}}\, n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}+5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}-6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}+8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c -2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )+\sqrt {-4 a \,b^{2} c +b^{4}}\, n \,x^{2} \ln \left (-12 a^{3} b \,c^{2}+11 a^{2} b^{3} c -2 a \,b^{5}-5 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} b c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{3}+\left (-16 a^{2} b^{2} c^{2}+12 a \,b^{4} c -2 b^{6}+6 \sqrt {-4 a \,b^{2} c +b^{4}}\, a^{2} c^{2}-8 \sqrt {-4 a \,b^{2} c +b^{4}}\, a \,b^{2} c +2 \sqrt {-4 a \,b^{2} c +b^{4}}\, b^{4}\right ) x \right )+2 a^{2} \ln \relax (d )}{4 a^{2} x^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.76, size = 474, normalized size = 3.92 \[ \frac {\ln \left (\frac {b^3\,c^2\,n^2-2\,a\,b\,c^3\,n^2}{4\,a^2}+\frac {\left (b^2\,n-2\,a\,c\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )\,\left (\frac {\left (\frac {x\,\left (24\,a^3\,c^2-8\,a^2\,b^2\,c\right )}{4\,a^2}-a\,b\,c\right )\,\left (b^2\,n-2\,a\,c\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )}{4\,a^2}-\frac {2\,a\,b^3\,c\,n-6\,a^2\,b\,c^2\,n}{4\,a^2}+\frac {x\,\left (12\,a^2\,c^3\,n-4\,a\,b^2\,c^2\,n\right )}{4\,a^2}\right )}{4\,a^2}+\frac {b^2\,c^3\,n^2\,x}{4\,a^2}\right )\,\left (b^2\,n-2\,a\,c\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )}{4\,a^2}-\frac {\ln \relax (x)\,\left (b^2\,n-2\,a\,c\,n\right )}{2\,a^2}-\frac {\ln \left (d\,{\left (c\,x^2+b\,x+a\right )}^n\right )}{2\,x^2}-\frac {\ln \left (\frac {b^3\,c^2\,n^2-2\,a\,b\,c^3\,n^2}{4\,a^2}+\frac {\left (2\,a\,c\,n-b^2\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )\,\left (\frac {2\,a\,b^3\,c\,n-6\,a^2\,b\,c^2\,n}{4\,a^2}+\frac {\left (\frac {x\,\left (24\,a^3\,c^2-8\,a^2\,b^2\,c\right )}{4\,a^2}-a\,b\,c\right )\,\left (2\,a\,c\,n-b^2\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )}{4\,a^2}-\frac {x\,\left (12\,a^2\,c^3\,n-4\,a\,b^2\,c^2\,n\right )}{4\,a^2}\right )}{4\,a^2}+\frac {b^2\,c^3\,n^2\,x}{4\,a^2}\right )\,\left (2\,a\,c\,n-b^2\,n+b\,n\,\sqrt {b^2-4\,a\,c}\right )}{4\,a^2}-\frac {b\,n}{2\,a\,x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________