### 3.22 $$\int \frac{(a+c x^2) (A+B x+C x^2)}{d+e x} \, dx$$

Optimal. Leaf size=145 $\frac{x^2 \left (a C e^2+c \left (C d^2-e (B d-A e)\right )\right )}{2 e^3}-\frac{x \left (a e^2 (C d-B e)+c d \left (C d^2-e (B d-A e)\right )\right )}{e^4}+\frac{\left (a e^2+c d^2\right ) \log (d+e x) \left (A e^2-B d e+C d^2\right )}{e^5}-\frac{c x^3 (C d-B e)}{3 e^2}+\frac{c C x^4}{4 e}$

[Out]

-(((a*e^2*(C*d - B*e) + c*d*(C*d^2 - e*(B*d - A*e)))*x)/e^4) + ((a*C*e^2 + c*(C*d^2 - e*(B*d - A*e)))*x^2)/(2*
e^3) - (c*(C*d - B*e)*x^3)/(3*e^2) + (c*C*x^4)/(4*e) + ((c*d^2 + a*e^2)*(C*d^2 - B*d*e + A*e^2)*Log[d + e*x])/
e^5

________________________________________________________________________________________

Rubi [A]  time = 0.245168, antiderivative size = 143, normalized size of antiderivative = 0.99, number of steps used = 2, number of rules used = 1, integrand size = 25, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.04, Rules used = {1628} $\frac{x^2 \left (a C e^2-c e (B d-A e)+c C d^2\right )}{2 e^3}-\frac{x \left (a e^2 (C d-B e)-c d e (B d-A e)+c C d^3\right )}{e^4}+\frac{\left (a e^2+c d^2\right ) \log (d+e x) \left (A e^2-B d e+C d^2\right )}{e^5}-\frac{c x^3 (C d-B e)}{3 e^2}+\frac{c C x^4}{4 e}$

Antiderivative was successfully veriﬁed.

[In]

Int[((a + c*x^2)*(A + B*x + C*x^2))/(d + e*x),x]

[Out]

-(((c*C*d^3 - c*d*e*(B*d - A*e) + a*e^2*(C*d - B*e))*x)/e^4) + ((c*C*d^2 + a*C*e^2 - c*e*(B*d - A*e))*x^2)/(2*
e^3) - (c*(C*d - B*e)*x^3)/(3*e^2) + (c*C*x^4)/(4*e) + ((c*d^2 + a*e^2)*(C*d^2 - B*d*e + A*e^2)*Log[d + e*x])/
e^5

Rule 1628

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin{align*} \int \frac{\left (a+c x^2\right ) \left (A+B x+C x^2\right )}{d+e x} \, dx &=\int \left (\frac{-a e^2 (C d-B e)-c \left (C d^3-d e (B d-A e)\right )}{e^4}+\frac{\left (c C d^2+a C e^2-c e (B d-A e)\right ) x}{e^3}+\frac{c (-C d+B e) x^2}{e^2}+\frac{c C x^3}{e}+\frac{\left (c d^2+a e^2\right ) \left (C d^2-B d e+A e^2\right )}{e^4 (d+e x)}\right ) \, dx\\ &=-\frac{\left (c C d^3-c d e (B d-A e)+a e^2 (C d-B e)\right ) x}{e^4}+\frac{\left (c C d^2+a C e^2-c e (B d-A e)\right ) x^2}{2 e^3}-\frac{c (C d-B e) x^3}{3 e^2}+\frac{c C x^4}{4 e}+\frac{\left (c d^2+a e^2\right ) \left (C d^2-B d e+A e^2\right ) \log (d+e x)}{e^5}\\ \end{align*}

Mathematica [A]  time = 0.0782833, size = 136, normalized size = 0.94 $\frac{e x \left (6 a e^2 (2 B e-2 C d+C e x)+2 c e \left (3 A e (e x-2 d)+B \left (6 d^2-3 d e x+2 e^2 x^2\right )\right )+c C \left (6 d^2 e x-12 d^3-4 d e^2 x^2+3 e^3 x^3\right )\right )+12 \left (a e^2+c d^2\right ) \log (d+e x) \left (e (A e-B d)+C d^2\right )}{12 e^5}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[((a + c*x^2)*(A + B*x + C*x^2))/(d + e*x),x]

[Out]

(e*x*(6*a*e^2*(-2*C*d + 2*B*e + C*e*x) + c*C*(-12*d^3 + 6*d^2*e*x - 4*d*e^2*x^2 + 3*e^3*x^3) + 2*c*e*(3*A*e*(-
2*d + e*x) + B*(6*d^2 - 3*d*e*x + 2*e^2*x^2))) + 12*(c*d^2 + a*e^2)*(C*d^2 + e*(-(B*d) + A*e))*Log[d + e*x])/(
12*e^5)

________________________________________________________________________________________

Maple [A]  time = 0.049, size = 210, normalized size = 1.5 \begin{align*}{\frac{Cc{x}^{4}}{4\,e}}+{\frac{Bc{x}^{3}}{3\,e}}-{\frac{C{x}^{3}cd}{3\,{e}^{2}}}+{\frac{A{x}^{2}c}{2\,e}}-{\frac{Bc{x}^{2}d}{2\,{e}^{2}}}+{\frac{C{x}^{2}a}{2\,e}}+{\frac{C{x}^{2}c{d}^{2}}{2\,{e}^{3}}}-{\frac{Acdx}{{e}^{2}}}+{\frac{aBx}{e}}+{\frac{Bc{d}^{2}x}{{e}^{3}}}-{\frac{aCdx}{{e}^{2}}}-{\frac{Cc{d}^{3}x}{{e}^{4}}}+{\frac{\ln \left ( ex+d \right ) Aa}{e}}+{\frac{\ln \left ( ex+d \right ) Ac{d}^{2}}{{e}^{3}}}-{\frac{\ln \left ( ex+d \right ) Bad}{{e}^{2}}}-{\frac{\ln \left ( ex+d \right ) Bc{d}^{3}}{{e}^{4}}}+{\frac{\ln \left ( ex+d \right ) Ca{d}^{2}}{{e}^{3}}}+{\frac{\ln \left ( ex+d \right ) Cc{d}^{4}}{{e}^{5}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((c*x^2+a)*(C*x^2+B*x+A)/(e*x+d),x)

[Out]

1/4*c*C*x^4/e+1/3/e*B*x^3*c-1/3/e^2*C*x^3*c*d+1/2/e*A*x^2*c-1/2/e^2*B*x^2*c*d+1/2/e*C*x^2*a+1/2/e^3*C*x^2*c*d^
2-1/e^2*A*c*d*x+1/e*B*a*x+1/e^3*B*c*d^2*x-1/e^2*C*a*d*x-1/e^4*C*c*d^3*x+1/e*ln(e*x+d)*A*a+1/e^3*ln(e*x+d)*A*c*
d^2-1/e^2*ln(e*x+d)*B*a*d-1/e^4*ln(e*x+d)*B*c*d^3+1/e^3*ln(e*x+d)*C*a*d^2+1/e^5*ln(e*x+d)*C*c*d^4

________________________________________________________________________________________

Maxima [A]  time = 1.00087, size = 215, normalized size = 1.48 \begin{align*} \frac{3 \, C c e^{3} x^{4} - 4 \,{\left (C c d e^{2} - B c e^{3}\right )} x^{3} + 6 \,{\left (C c d^{2} e - B c d e^{2} +{\left (C a + A c\right )} e^{3}\right )} x^{2} - 12 \,{\left (C c d^{3} - B c d^{2} e - B a e^{3} +{\left (C a + A c\right )} d e^{2}\right )} x}{12 \, e^{4}} + \frac{{\left (C c d^{4} - B c d^{3} e - B a d e^{3} + A a e^{4} +{\left (C a + A c\right )} d^{2} e^{2}\right )} \log \left (e x + d\right )}{e^{5}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)*(C*x^2+B*x+A)/(e*x+d),x, algorithm="maxima")

[Out]

1/12*(3*C*c*e^3*x^4 - 4*(C*c*d*e^2 - B*c*e^3)*x^3 + 6*(C*c*d^2*e - B*c*d*e^2 + (C*a + A*c)*e^3)*x^2 - 12*(C*c*
d^3 - B*c*d^2*e - B*a*e^3 + (C*a + A*c)*d*e^2)*x)/e^4 + (C*c*d^4 - B*c*d^3*e - B*a*d*e^3 + A*a*e^4 + (C*a + A*
c)*d^2*e^2)*log(e*x + d)/e^5

________________________________________________________________________________________

Fricas [A]  time = 1.68902, size = 344, normalized size = 2.37 \begin{align*} \frac{3 \, C c e^{4} x^{4} - 4 \,{\left (C c d e^{3} - B c e^{4}\right )} x^{3} + 6 \,{\left (C c d^{2} e^{2} - B c d e^{3} +{\left (C a + A c\right )} e^{4}\right )} x^{2} - 12 \,{\left (C c d^{3} e - B c d^{2} e^{2} - B a e^{4} +{\left (C a + A c\right )} d e^{3}\right )} x + 12 \,{\left (C c d^{4} - B c d^{3} e - B a d e^{3} + A a e^{4} +{\left (C a + A c\right )} d^{2} e^{2}\right )} \log \left (e x + d\right )}{12 \, e^{5}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)*(C*x^2+B*x+A)/(e*x+d),x, algorithm="fricas")

[Out]

1/12*(3*C*c*e^4*x^4 - 4*(C*c*d*e^3 - B*c*e^4)*x^3 + 6*(C*c*d^2*e^2 - B*c*d*e^3 + (C*a + A*c)*e^4)*x^2 - 12*(C*
c*d^3*e - B*c*d^2*e^2 - B*a*e^4 + (C*a + A*c)*d*e^3)*x + 12*(C*c*d^4 - B*c*d^3*e - B*a*d*e^3 + A*a*e^4 + (C*a
+ A*c)*d^2*e^2)*log(e*x + d))/e^5

________________________________________________________________________________________

Sympy [A]  time = 0.766002, size = 143, normalized size = 0.99 \begin{align*} \frac{C c x^{4}}{4 e} - \frac{x^{3} \left (- B c e + C c d\right )}{3 e^{2}} + \frac{x^{2} \left (A c e^{2} - B c d e + C a e^{2} + C c d^{2}\right )}{2 e^{3}} - \frac{x \left (A c d e^{2} - B a e^{3} - B c d^{2} e + C a d e^{2} + C c d^{3}\right )}{e^{4}} + \frac{\left (a e^{2} + c d^{2}\right ) \left (A e^{2} - B d e + C d^{2}\right ) \log{\left (d + e x \right )}}{e^{5}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x**2+a)*(C*x**2+B*x+A)/(e*x+d),x)

[Out]

C*c*x**4/(4*e) - x**3*(-B*c*e + C*c*d)/(3*e**2) + x**2*(A*c*e**2 - B*c*d*e + C*a*e**2 + C*c*d**2)/(2*e**3) - x
*(A*c*d*e**2 - B*a*e**3 - B*c*d**2*e + C*a*d*e**2 + C*c*d**3)/e**4 + (a*e**2 + c*d**2)*(A*e**2 - B*d*e + C*d**
2)*log(d + e*x)/e**5

________________________________________________________________________________________

Giac [A]  time = 1.12377, size = 230, normalized size = 1.59 \begin{align*}{\left (C c d^{4} - B c d^{3} e + C a d^{2} e^{2} + A c d^{2} e^{2} - B a d e^{3} + A a e^{4}\right )} e^{\left (-5\right )} \log \left ({\left | x e + d \right |}\right ) + \frac{1}{12} \,{\left (3 \, C c x^{4} e^{3} - 4 \, C c d x^{3} e^{2} + 6 \, C c d^{2} x^{2} e - 12 \, C c d^{3} x + 4 \, B c x^{3} e^{3} - 6 \, B c d x^{2} e^{2} + 12 \, B c d^{2} x e + 6 \, C a x^{2} e^{3} + 6 \, A c x^{2} e^{3} - 12 \, C a d x e^{2} - 12 \, A c d x e^{2} + 12 \, B a x e^{3}\right )} e^{\left (-4\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)*(C*x^2+B*x+A)/(e*x+d),x, algorithm="giac")

[Out]

(C*c*d^4 - B*c*d^3*e + C*a*d^2*e^2 + A*c*d^2*e^2 - B*a*d*e^3 + A*a*e^4)*e^(-5)*log(abs(x*e + d)) + 1/12*(3*C*c
*x^4*e^3 - 4*C*c*d*x^3*e^2 + 6*C*c*d^2*x^2*e - 12*C*c*d^3*x + 4*B*c*x^3*e^3 - 6*B*c*d*x^2*e^2 + 12*B*c*d^2*x*e
+ 6*C*a*x^2*e^3 + 6*A*c*x^2*e^3 - 12*C*a*d*x*e^2 - 12*A*c*d*x*e^2 + 12*B*a*x*e^3)*e^(-4)