Optimal. Leaf size=79 \[ \frac{n \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{b n \log \left (a+b x+c x^2\right )}{2 c}-2 n x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0617153, antiderivative size = 79, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {2523, 773, 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 )}{c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{b n \log \left (a+b x+c x^2\right )}{2 c}-2 n x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2523
Rule 773
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx &=x \log \left (d \left (a+b x+c x^2\right )^n\right )-n \int \frac{x (b+2 c x)}{a+b x+c x^2} \, dx\\ &=-2 n x+x \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac{n \int \frac{-2 a c-b c x}{a+b x+c x^2} \, dx}{c}\\ &=-2 n x+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac{(b n) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c}-\frac{\left (\left (b^2-4 a c\right ) n\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c}\\ &=-2 n x+\frac{b n \log \left (a+b x+c x^2\right )}{2 c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\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 )}{c}\\ &=-2 n x+\frac{\sqrt{b^2-4 a c} n \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c}+\frac{b n \log \left (a+b x+c x^2\right )}{2 c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )\\ \end{align*}
Mathematica [A] time = 0.0586933, size = 78, normalized size = 0.99 \[ \frac{2 n \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )+2 c x \left (\log \left (d (a+x (b+c x))^n\right )-2 n\right )+b n \log (a+x (b+c x))}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.015, size = 118, normalized size = 1.5 \begin{align*} x\ln \left ( d \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) -2\,nx+{\frac{bn\ln \left ( c{x}^{2}+bx+a \right ) }{2\,c}}+4\,{\frac{na}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{{b}^{2}n}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \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.14705, size = 459, normalized size = 5.81 \begin{align*} \left [-\frac{4 \, c n x - 2 \, c x \log \left (d\right ) - \sqrt{b^{2} - 4 \, a c} n \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 (2 \, c n x + b n\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}, -\frac{4 \, c n x - 2 \, c x \log \left (d\right ) - 2 \, \sqrt{-b^{2} + 4 \, a c} n \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left (2 \, c n x + b n\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 106.601, size = 275, normalized size = 3.48 \begin{align*} \begin{cases} \frac{b n \log{\left (\frac{b^{2}}{4 c} + b x + c x^{2} \right )}}{2 c} + n x \log{\left (\frac{b^{2}}{4 c} + b x + c x^{2} \right )} - 2 n x + x \log{\left (d \right )} & \text{for}\: a = \frac{b^{2}}{4 c} \\\frac{a n \log{\left (a + b x \right )}}{b} + n x \log{\left (a + b x \right )} - n x + x \log{\left (d \right )} & \text{for}\: c = 0 \\\frac{2 a n \log{\left (a + b x + c x^{2} \right )}}{\sqrt{- 4 a c + b^{2}}} - \frac{4 a n \log{\left (\frac{b}{2 c} + x + \frac{\sqrt{- 4 a c + b^{2}}}{2 c} \right )}}{\sqrt{- 4 a c + b^{2}}} - \frac{b^{2} n \log{\left (a + b x + c x^{2} \right )}}{2 c \sqrt{- 4 a c + b^{2}}} + \frac{b^{2} n \log{\left (\frac{b}{2 c} + x + \frac{\sqrt{- 4 a c + b^{2}}}{2 c} \right )}}{c \sqrt{- 4 a c + b^{2}}} + \frac{b n \log{\left (a + b x + c x^{2} \right )}}{2 c} + n x \log{\left (a + b x + c x^{2} \right )} - 2 n x + x \log{\left (d \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.31276, size = 124, normalized size = 1.57 \begin{align*} n x \log \left (c x^{2} + b x + a\right ) -{\left (2 \, n - \log \left (d\right )\right )} x + \frac{b n \log \left (c x^{2} + b x + a\right )}{2 \, c} - \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} c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]