Optimal. Leaf size=86 \[ \frac{n \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}-\frac{b n \log \left (a+b x+c x^2\right )}{2 a}+\frac{b n \log (x)}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.113233, antiderivative size = 86, normalized size of antiderivative = 1., 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 \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}-\frac{b n \log \left (a+b x+c x^2\right )}{2 a}+\frac{b n \log (x)}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2525
Rule 800
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x^2} \, dx &=-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+n \int \frac{b+2 c x}{x \left (a+b x+c x^2\right )} \, dx\\ &=-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+n \int \left (\frac{b}{a x}+\frac{-b^2+2 a c-b c x}{a \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac{b n \log (x)}{a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+\frac{n \int \frac{-b^2+2 a c-b c x}{a+b x+c x^2} \, dx}{a}\\ &=\frac{b n \log (x)}{a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}-\frac{(b n) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 a}-\frac{\left (\left (b^2-4 a c\right ) n\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 a}\\ &=\frac{b n \log (x)}{a}-\frac{b n \log \left (a+b x+c x^2\right )}{2 a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+\frac{\left (\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 )}{a}\\ &=\frac{\sqrt{b^2-4 a c} n \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{a}+\frac{b n \log (x)}{a}-\frac{b n \log \left (a+b x+c x^2\right )}{2 a}-\frac{\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}\\ \end{align*}
Mathematica [A] time = 0.10475, size = 87, normalized size = 1.01 \[ \frac{2 n \sqrt{4 a c-b^2} \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )-\frac{2 a \log \left (d (a+x (b+c x))^n\right )}{x}-b n \log (a+x (b+c x))+2 b n \log (x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.069, size = 261, normalized size = 3. \begin{align*} -{\frac{\ln \left ( \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) }{x}}-{\frac{-i\pi \,a{\it csgn} \left ( id \right ){\it csgn} \left ( i \left ( c{x}^{2}+bx+a \right ) ^{n} \right ){\it csgn} \left ( id \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) +i\pi \,a{\it csgn} \left ( id \right ) \left ({\it csgn} \left ( id \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) \right ) ^{2}+i\pi \,a{\it csgn} \left ( i \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) \left ({\it csgn} \left ( id \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) \right ) ^{2}-i\pi \,a \left ({\it csgn} \left ( id \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) \right ) ^{3}-2\,bn\ln \left ( x \right ) x-2\,\sum _{{\it \_R}={\it RootOf} \left ( a{{\it \_Z}}^{2}+bn{\it \_Z}+c{n}^{2} \right ) }{\it \_R}\,\ln \left ( \left ( \left ( 6\,ac-2\,{b}^{2} \right ){{\it \_R}}^{2}+{\it \_R}\,bcn+4\,{c}^{2}{n}^{2} \right ) x-ab{{\it \_R}}^{2}+ \left ( -2\,acn+{b}^{2}n \right ){\it \_R}+2\,bc{n}^{2} \right ) ax+2\,\ln \left ( d \right ) a}{2\,ax}} \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 [A] time = 2.35201, size = 486, normalized size = 5.65 \begin{align*} \left [\frac{2 \, b n x \log \left (x\right ) + \sqrt{b^{2} - 4 \, a c} n x \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 ) -{\left (b n x + 2 \, a n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, a \log \left (d\right )}{2 \, a x}, \frac{2 \, b n x \log \left (x\right ) + 2 \, \sqrt{-b^{2} + 4 \, a c} n x \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left (b n x + 2 \, a n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, a \log \left (d\right )}{2 \, a x}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20994, size = 134, normalized size = 1.56 \begin{align*} -\frac{b n \log \left (c x^{2} + b x + a\right )}{2 \, a} + \frac{b n \log \left (x\right )}{a} - \frac{n \log \left (c x^{2} + b x + a\right )}{x} - \frac{{\left (b^{2} n - 4 \, a c n\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} a} - \frac{\log \left (d\right )}{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]