Optimal. Leaf size=154 \[ -\frac{n \left (-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2\right ) \log \left (a+b x+c x^2\right )}{4 c^2 e}+\frac{n \sqrt{b^2-4 a c} (2 c d-b e) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{2 c^2}+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{1}{2} n x \left (4 d-\frac{b e}{c}\right )-\frac{1}{2} e n x^2 \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.186291, antiderivative size = 154, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {2525, 800, 634, 618, 206, 628} \[ -\frac{n \left (-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2\right ) \log \left (a+b x+c x^2\right )}{4 c^2 e}+\frac{n \sqrt{b^2-4 a c} (2 c d-b e) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{2 c^2}+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{1}{2} n x \left (4 d-\frac{b e}{c}\right )-\frac{1}{2} e n x^2 \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2525
Rule 800
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int (d+e x) \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx &=\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{n \int \frac{(b+2 c x) (d+e x)^2}{a+b x+c x^2} \, dx}{2 e}\\ &=\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{n \int \left (e \left (4 d-\frac{b e}{c}\right )+2 e^2 x+\frac{b c d^2-4 a c d e+a b e^2+\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) x}{c \left (a+b x+c x^2\right )}\right ) \, dx}{2 e}\\ &=-\frac{1}{2} \left (4 d-\frac{b e}{c}\right ) n x-\frac{1}{2} e n x^2+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{n \int \frac{b c d^2-4 a c d e+a b e^2+\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) x}{a+b x+c x^2} \, dx}{2 c e}\\ &=-\frac{1}{2} \left (4 d-\frac{b e}{c}\right ) n x-\frac{1}{2} e n x^2+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}-\frac{\left (\left (b^2-4 a c\right ) (2 c d-b e) n\right ) \int \frac{1}{a+b x+c x^2} \, dx}{4 c^2}-\frac{\left (\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) n\right ) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{4 c^2 e}\\ &=-\frac{1}{2} \left (4 d-\frac{b e}{c}\right ) n x-\frac{1}{2} e n x^2-\frac{\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) n \log \left (a+b x+c x^2\right )}{4 c^2 e}+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}+\frac{\left (\left (b^2-4 a c\right ) (2 c d-b e) n\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{2 c^2}\\ &=-\frac{1}{2} \left (4 d-\frac{b e}{c}\right ) n x-\frac{1}{2} e n x^2+\frac{\sqrt{b^2-4 a c} (2 c d-b e) n \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{2 c^2}-\frac{\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) n \log \left (a+b x+c x^2\right )}{4 c^2 e}+\frac{(d+e x)^2 \log \left (d \left (a+b x+c x^2\right )^n\right )}{2 e}\\ \end{align*}
Mathematica [A] time = 0.186405, size = 123, normalized size = 0.8 \[ \frac{n \left (2 a c e+b^2 (-e)+2 b c d\right ) \log (a+x (b+c x))-2 n \sqrt{b^2-4 a c} (b e-2 c d) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )+2 c x \left (c (2 d+e x) \log \left (d (a+x (b+c x))^n\right )+b e n-c n (4 d+e x)\right )}{4 c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.145, size = 1706, normalized size = 11.1 \begin{align*} \text{result too large to display} \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.2663, size = 767, normalized size = 4.98 \begin{align*} \left [-\frac{2 \, c^{2} e n x^{2} + \sqrt{b^{2} - 4 \, a c}{\left (2 \, c d - b e\right )} 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 ) + 2 \,{\left (4 \, c^{2} d - b c e\right )} n x -{\left (2 \, c^{2} e n x^{2} + 4 \, c^{2} d n x +{\left (2 \, b c d -{\left (b^{2} - 2 \, a c\right )} e\right )} n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \,{\left (c^{2} e x^{2} + 2 \, c^{2} d x\right )} \log \left (d\right )}{4 \, c^{2}}, -\frac{2 \, c^{2} e n x^{2} - 2 \, \sqrt{-b^{2} + 4 \, a c}{\left (2 \, c d - b e\right )} n \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \,{\left (4 \, c^{2} d - b c e\right )} n x -{\left (2 \, c^{2} e n x^{2} + 4 \, c^{2} d n x +{\left (2 \, b c d -{\left (b^{2} - 2 \, a c\right )} e\right )} n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \,{\left (c^{2} e x^{2} + 2 \, c^{2} d x\right )} \log \left (d\right )}{4 \, c^{2}}\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.36214, size = 315, normalized size = 2.05 \begin{align*} \frac{b d n \log \left (c x^{2} + b x + a\right )}{2 \, c} - \frac{{\left (b^{2} d n - 4 \, a c d n\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c} + \frac{c n x^{2} e \log \left (c x^{2} + b x + a\right ) - c n x^{2} e + 2 \, c d n x \log \left (c x^{2} + b x + a\right ) + c x^{2} e \log \left (d\right ) - 4 \, c d n x + b n x e + 2 \, c d x \log \left (d\right )}{2 \, c} - \frac{{\left (b^{2} n e - 2 \, a c n e\right )} \log \left (c x^{2} + b x + a\right )}{4 \, c^{2}} + \frac{{\left (b^{3} n e - 4 \, a b c n e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{2 \, \sqrt{-b^{2} + 4 \, a c} c^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]