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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.204897, antiderivative size = 151, 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 \left (a C e^2-c e (2 B d-A e)+3 c C d^2\right )}{e^4}-\frac{\left (a e^2+c d^2\right ) \left (A e^2-B d e+C d^2\right )}{e^5 (d+e x)}-\frac{\log (d+e x) \left (a e^2 (2 C d-B e)-c d e (3 B d-2 A e)+4 c C d^3\right )}{e^5}-\frac{c x^2 (2 C d-B e)}{2 e^3}+\frac{c C x^3}{3 e^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((3*c*C*d^2 + a*C*e^2 - c*e*(2*B*d - A*e))*x)/e^4 - (c*(2*C*d - B*e)*x^2)/(2*e^3) + (c*C*x^3)/(3*e^2) - ((c*d^
2 + a*e^2)*(C*d^2 - B*d*e + A*e^2))/(e^5*(d + e*x)) - ((4*c*C*d^3 - c*d*e*(3*B*d - 2*A*e) + a*e^2*(2*C*d - B*e
))*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)^2} \, dx &=\int \left (\frac{3 c C d^2+a C e^2-c e (2 B d-A e)}{e^4}+\frac{c (-2 C d+B e) x}{e^3}+\frac{c C x^2}{e^2}+\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)^2}+\frac{-4 c C d^3+c d e (3 B d-2 A e)-a e^2 (2 C d-B e)}{e^4 (d+e x)}\right ) \, dx\\ &=\frac{\left (3 c C d^2+a C e^2-c e (2 B d-A e)\right ) x}{e^4}-\frac{c (2 C d-B e) x^2}{2 e^3}+\frac{c C x^3}{3 e^2}-\frac{\left (c d^2+a e^2\right ) \left (C d^2-B d e+A e^2\right )}{e^5 (d+e x)}-\frac{\left (4 c C d^3-c d e (3 B d-2 A e)+a e^2 (2 C d-B e)\right ) \log (d+e x)}{e^5}\\ \end{align*}

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 234, normalized size = 1.5 \begin{align*}{\frac{Cc{x}^{3}}{3\,{e}^{2}}}+{\frac{Bc{x}^{2}}{2\,{e}^{2}}}-{\frac{C{x}^{2}cd}{{e}^{3}}}+{\frac{Acx}{{e}^{2}}}-2\,{\frac{Bcdx}{{e}^{3}}}+{\frac{aCx}{{e}^{2}}}+3\,{\frac{Cc{d}^{2}x}{{e}^{4}}}-2\,{\frac{\ln \left ( ex+d \right ) Acd}{{e}^{3}}}+{\frac{\ln \left ( ex+d \right ) Ba}{{e}^{2}}}+3\,{\frac{\ln \left ( ex+d \right ) Bc{d}^{2}}{{e}^{4}}}-2\,{\frac{\ln \left ( ex+d \right ) Cad}{{e}^{3}}}-4\,{\frac{\ln \left ( ex+d \right ) Cc{d}^{3}}{{e}^{5}}}-{\frac{aA}{e \left ( ex+d \right ) }}-{\frac{Ac{d}^{2}}{{e}^{3} \left ( ex+d \right ) }}+{\frac{Bda}{{e}^{2} \left ( ex+d \right ) }}+{\frac{Bc{d}^{3}}{{e}^{4} \left ( ex+d \right ) }}-{\frac{aC{d}^{2}}{{e}^{3} \left ( ex+d \right ) }}-{\frac{Cc{d}^{4}}{{e}^{5} \left ( ex+d \right ) }} \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)^2,x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.998793, size = 228, normalized size = 1.49 \begin{align*} -\frac{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}}{e^{6} x + d e^{5}} + \frac{2 \, C c e^{2} x^{3} - 3 \,{\left (2 \, C c d e - B c e^{2}\right )} x^{2} + 6 \,{\left (3 \, C c d^{2} - 2 \, B c d e +{\left (C a + A c\right )} e^{2}\right )} x}{6 \, e^{4}} - \frac{{\left (4 \, C c d^{3} - 3 \, B c d^{2} e - B a e^{3} + 2 \,{\left (C a + A c\right )} d 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)^2,x, algorithm="maxima")

[Out]

-(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)/(e^6*x + d*e^5) + 1/6*(2*C*c*e^2*x^3 - 3*(2
*C*c*d*e - B*c*e^2)*x^2 + 6*(3*C*c*d^2 - 2*B*c*d*e + (C*a + A*c)*e^2)*x)/e^4 - (4*C*c*d^3 - 3*B*c*d^2*e - B*a*
e^3 + 2*(C*a + A*c)*d*e^2)*log(e*x + d)/e^5

________________________________________________________________________________________

Fricas [A]  time = 1.58326, size = 545, normalized size = 3.56 \begin{align*} \frac{2 \, C c e^{4} x^{4} - 6 \, C c d^{4} + 6 \, B c d^{3} e + 6 \, B a d e^{3} - 6 \, A a e^{4} - 6 \,{\left (C a + A c\right )} d^{2} e^{2} -{\left (4 \, C c d e^{3} - 3 \, B c e^{4}\right )} x^{3} + 3 \,{\left (4 \, C c d^{2} e^{2} - 3 \, B c d e^{3} + 2 \,{\left (C a + A c\right )} e^{4}\right )} x^{2} + 6 \,{\left (3 \, C c d^{3} e - 2 \, B c d^{2} e^{2} +{\left (C a + A c\right )} d e^{3}\right )} x - 6 \,{\left (4 \, C c d^{4} - 3 \, B c d^{3} e - B a d e^{3} + 2 \,{\left (C a + A c\right )} d^{2} e^{2} +{\left (4 \, C c d^{3} e - 3 \, B c d^{2} e^{2} - B a e^{4} + 2 \,{\left (C a + A c\right )} d e^{3}\right )} x\right )} \log \left (e x + d\right )}{6 \,{\left (e^{6} x + d e^{5}\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)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 1.56747, size = 184, normalized size = 1.2 \begin{align*} \frac{C c x^{3}}{3 e^{2}} - \frac{A a e^{4} + A c d^{2} e^{2} - B a d e^{3} - B c d^{3} e + C a d^{2} e^{2} + C c d^{4}}{d e^{5} + e^{6} x} - \frac{x^{2} \left (- B c e + 2 C c d\right )}{2 e^{3}} + \frac{x \left (A c e^{2} - 2 B c d e + C a e^{2} + 3 C c d^{2}\right )}{e^{4}} - \frac{\left (2 A c d e^{2} - B a e^{3} - 3 B c d^{2} e + 2 C a d e^{2} + 4 C c d^{3}\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)**2,x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.14848, size = 324, normalized size = 2.12 \begin{align*} \frac{1}{6} \,{\left (2 \, C c - \frac{3 \,{\left (4 \, C c d e - B c e^{2}\right )} e^{\left (-1\right )}}{x e + d} + \frac{6 \,{\left (6 \, C c d^{2} e^{2} - 3 \, B c d e^{3} + C a e^{4} + A c e^{4}\right )} e^{\left (-2\right )}}{{\left (x e + d\right )}^{2}}\right )}{\left (x e + d\right )}^{3} e^{\left (-5\right )} +{\left (4 \, C c d^{3} - 3 \, B c d^{2} e + 2 \, C a d e^{2} + 2 \, A c d e^{2} - B a e^{3}\right )} e^{\left (-5\right )} \log \left (\frac{{\left | x e + d \right |} e^{\left (-1\right )}}{{\left (x e + d\right )}^{2}}\right ) -{\left (\frac{C c d^{4} e^{3}}{x e + d} - \frac{B c d^{3} e^{4}}{x e + d} + \frac{C a d^{2} e^{5}}{x e + d} + \frac{A c d^{2} e^{5}}{x e + d} - \frac{B a d e^{6}}{x e + d} + \frac{A a e^{7}}{x e + d}\right )} e^{\left (-8\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)^2,x, algorithm="giac")

[Out]

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