Optimal. Leaf size=149 \[ -\frac {b n}{6 a x^2}+\frac {\left (b^2-2 a c\right ) n}{3 a^2 x}+\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 a^3}+\frac {b \left (b^2-3 a c\right ) n \log (x)}{3 a^3}-\frac {b \left (b^2-3 a c\right ) n \log \left (a+b x+c x^2\right )}{6 a^3}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 149, 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 {b n \left (b^2-3 a c\right ) \log \left (a+b x+c x^2\right )}{6 a^3}+\frac {b n \log (x) \left (b^2-3 a c\right )}{3 a^3}+\frac {n \sqrt {b^2-4 a c} \left (b^2-a c\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{3 a^3}+\frac {n \left (b^2-2 a c\right )}{3 a^2 x}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}-\frac {b n}{6 a x^2} \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^4} \, dx &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}+\frac {1}{3} n \int \frac {b+2 c x}{x^3 \left (a+b x+c x^2\right )} \, dx\\ &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}+\frac {1}{3} n \int \left (\frac {b}{a x^3}+\frac {-b^2+2 a c}{a^2 x^2}+\frac {b^3-3 a b c}{a^3 x}+\frac {-b^4+4 a b^2 c-2 a^2 c^2-b c \left (b^2-3 a c\right ) x}{a^3 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac {b n}{6 a x^2}+\frac {\left (b^2-2 a c\right ) n}{3 a^2 x}+\frac {b \left (b^2-3 a c\right ) n \log (x)}{3 a^3}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}+\frac {n \int \frac {-b^4+4 a b^2 c-2 a^2 c^2-b c \left (b^2-3 a c\right ) x}{a+b x+c x^2} \, dx}{3 a^3}\\ &=-\frac {b n}{6 a x^2}+\frac {\left (b^2-2 a c\right ) n}{3 a^2 x}+\frac {b \left (b^2-3 a c\right ) n \log (x)}{3 a^3}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}-\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 a^3}-\frac {\left (\left (b^2-4 a c\right ) \left (b^2-a c\right ) n\right ) \int \frac {1}{a+b x+c x^2} \, dx}{6 a^3}\\ &=-\frac {b n}{6 a x^2}+\frac {\left (b^2-2 a c\right ) n}{3 a^2 x}+\frac {b \left (b^2-3 a c\right ) n \log (x)}{3 a^3}-\frac {b \left (b^2-3 a c\right ) n \log \left (a+b x+c x^2\right )}{6 a^3}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}+\frac {\left (\left (b^2-4 a c\right ) \left (b^2-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 )}{3 a^3}\\ &=-\frac {b n}{6 a x^2}+\frac {\left (b^2-2 a c\right ) n}{3 a^2 x}+\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 a^3}+\frac {b \left (b^2-3 a c\right ) n \log (x)}{3 a^3}-\frac {b \left (b^2-3 a c\right ) n \log \left (a+b x+c x^2\right )}{6 a^3}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{3 x^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.26, size = 132, normalized size = 0.89 \begin {gather*} -\frac {\frac {n x \left (a^2 b-2 a \left (b^2-2 a c\right ) x-2 \sqrt {b^2-4 a c} \left (b^2-a c\right ) x^2 \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )-2 b \left (b^2-3 a c\right ) x^2 \log (x)+b \left (b^2-3 a c\right ) x^2 \log (a+x (b+c x))\right )}{a^3}+2 \log \left (d (a+x (b+c x))^n\right )}{6 x^3} \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 = 423, normalized size = 2.84
method | result | size |
risch | \(-\frac {\ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )}{3 x^{3}}-\frac {-i \pi \,a^{3} \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^{3} \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^{3} \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^{3} \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{3}+6 \ln \left (x \right ) a b c n \,x^{3}-2 \ln \left (x \right ) b^{3} n \,x^{3}-2 \left (\munderset {\textit {\_R} =\RootOf \left (a^{3} \textit {\_Z}^{2}+\left (-3 a b c n +b^{3} n \right ) \textit {\_Z} +c^{3} n^{2}\right )}{\sum }\textit {\_R} \ln \left (\left (\left (6 a^{5} c -2 a^{4} b^{2}\right ) \textit {\_R}^{2}+\left (-7 a^{3} b \,c^{2} n +2 a^{2} b^{3} c n \right ) \textit {\_R} +4 a^{2} c^{4} n^{2}-4 a \,b^{2} c^{3} n^{2}+b^{4} c^{2} n^{2}\right ) x -a^{5} b \,\textit {\_R}^{2}+\left (2 a^{4} c^{2} n -4 a^{3} b^{2} c n +a^{2} b^{4} n \right ) \textit {\_R} +6 a^{2} b \,c^{3} n^{2}-5 a \,b^{3} c^{2} n^{2}+b^{5} c \,n^{2}\right )\right ) a^{3} x^{3}+4 a^{2} c n \,x^{2}-2 a \,b^{2} n \,x^{2}+a^{2} b n x +2 \ln \left (d \right ) a^{3}}{6 a^{3} x^{3}}\) | \(423\) |
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.40, size = 318, normalized size = 2.13 \begin {gather*} \left [-\frac {{\left (b^{2} - a c\right )} \sqrt {b^{2} - 4 \, a c} n x^{3} \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^{3} - 3 \, a b c\right )} n x^{3} \log \left (x\right ) + a^{2} b n x - 2 \, {\left (a b^{2} - 2 \, a^{2} c\right )} n x^{2} + 2 \, a^{3} \log \left (d\right ) + {\left ({\left (b^{3} - 3 \, a b c\right )} n x^{3} + 2 \, a^{3} n\right )} \log \left (c x^{2} + b x + a\right )}{6 \, a^{3} x^{3}}, \frac {2 \, {\left (b^{2} - a c\right )} \sqrt {-b^{2} + 4 \, a c} n x^{3} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left (b^{3} - 3 \, a b c\right )} n x^{3} \log \left (x\right ) - a^{2} b n x + 2 \, {\left (a b^{2} - 2 \, a^{2} c\right )} n x^{2} - 2 \, a^{3} \log \left (d\right ) - {\left ({\left (b^{3} - 3 \, a b c\right )} n x^{3} + 2 \, a^{3} n\right )} \log \left (c x^{2} + b x + a\right )}{6 \, a^{3} x^{3}}\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 = 4.82, size = 164, normalized size = 1.10 \begin {gather*} -\frac {{\left (b^{3} n - 3 \, a b c n\right )} \log \left (c x^{2} + b x + a\right )}{6 \, a^{3}} - \frac {n \log \left (c x^{2} + b x + a\right )}{3 \, x^{3}} + \frac {{\left (b^{3} n - 3 \, a b c n\right )} \log \left (x\right )}{3 \, a^{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} a^{3}} + \frac {2 \, b^{2} n x^{2} - 4 \, a c n x^{2} - a b n x - 2 \, a^{2} \log \left (d\right )}{6 \, a^{2} x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.93, size = 505, normalized size = 3.39 \begin {gather*} \frac {\ln \left (2\,a\,b^4\,\sqrt {b^2-4\,a\,c}-2\,b^6\,x-2\,a\,b^5+2\,b^5\,x\,\sqrt {b^2-4\,a\,c}+13\,a^2\,b^3\,c-20\,a^3\,b\,c^2+4\,a^3\,c^3\,x+2\,a^3\,c^2\,\sqrt {b^2-4\,a\,c}-25\,a^2\,b^2\,c^2\,x+14\,a\,b^4\,c\,x-7\,a^2\,b^2\,c\,\sqrt {b^2-4\,a\,c}-10\,a\,b^3\,c\,x\,\sqrt {b^2-4\,a\,c}+11\,a^2\,b\,c^2\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (a\,\left (\frac {b\,c\,n}{2}-\frac {c\,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 )}{a^3}-\frac {\ln \left (d\,{\left (c\,x^2+b\,x+a\right )}^n\right )}{3\,x^3}-\frac {\frac {b\,n}{2\,a}+\frac {n\,x\,\left (2\,a\,c-b^2\right )}{a^2}}{3\,x^2}-\frac {\ln \left (2\,a\,b^5+2\,b^6\,x+2\,a\,b^4\,\sqrt {b^2-4\,a\,c}+2\,b^5\,x\,\sqrt {b^2-4\,a\,c}-13\,a^2\,b^3\,c+20\,a^3\,b\,c^2-4\,a^3\,c^3\,x+2\,a^3\,c^2\,\sqrt {b^2-4\,a\,c}+25\,a^2\,b^2\,c^2\,x-14\,a\,b^4\,c\,x-7\,a^2\,b^2\,c\,\sqrt {b^2-4\,a\,c}-10\,a\,b^3\,c\,x\,\sqrt {b^2-4\,a\,c}+11\,a^2\,b\,c^2\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (\frac {b^3\,n}{6}-a\,\left (\frac {b\,c\,n}{2}+\frac {c\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )+\frac {b^2\,n\,\sqrt {b^2-4\,a\,c}}{6}\right )}{a^3}+\frac {\ln \left (x\right )\,\left (b^3\,n-3\,a\,b\,c\,n\right )}{3\,a^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________