Optimal. Leaf size=121 \[ -\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} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, 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 = {2605, 814, 648,
632, 212, 642} \begin {gather*} \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} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 814
Rule 2605
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 ) \text {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.17, size = 105, normalized size = 0.87 \begin {gather*} -\frac {\frac {n x \left (2 a b+2 b \sqrt {b^2-4 a c} x \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )+2 \left (b^2-2 a c\right ) x \log (x)-\left (b^2-2 a c\right ) x \log (a+x (b+c x))\right )}{a^2}+2 \log \left (d (a+x (b+c x))^n\right )}{4 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.06, size = 1178, normalized size = 9.74
method | result | size |
risch | \(-\frac {\ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )}{2 x^{2}}-\frac {-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 n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) c a \,x^{2}-n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) b^{2} x^{2}+2 n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) c a \,x^{2}-n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) b^{2} x^{2}-4 n \ln \left (x \right ) c a \,x^{2}+2 n \ln \left (x \right ) b^{2} x^{2}-n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) \sqrt {-4 a \,b^{2} c +b^{4}}\, x^{2}+n \ln \left (\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 -12 a^{3} b \,c^{2}+11 b^{3} c \,a^{2}-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}\right ) \sqrt {-4 a \,b^{2} c +b^{4}}\, x^{2}+2 a b n x +2 \ln \left (d \right ) a^{2}}{4 a^{2} x^{2}}\) | \(1178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 261, normalized size = 2.16 \begin {gather*} \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 \left (x\right ) - 2 \, a b n x - 2 \, a^{2} \log \left (d\right ) + {\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 \left (x\right ) + 2 \, a b n x + 2 \, a^{2} \log \left (d\right ) - {\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 ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.15, size = 129, normalized size = 1.07 \begin {gather*} \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 \left (x\right )}{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 \left (d\right )}{2 \, a x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.76, size = 474, normalized size = 3.92 \begin {gather*} \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 \left (x\right )\,\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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________