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

Optimal. Leaf size=156 $\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (c d (2 a B e+a C d+3 A c d)+a e^2 (3 a C+A c)\right )}{8 a^{5/2} c^{5/2}}-\frac{(d+e x) (a e (3 a C+A c)-c x (2 a B e+a C d+3 A c d))}{8 a^2 c^2 \left (a+c x^2\right )}-\frac{(d+e x)^2 (a B-x (A c-a C))}{4 a c \left (a+c x^2\right )^2}$

[Out]

-((a*B - (A*c - a*C)*x)*(d + e*x)^2)/(4*a*c*(a + c*x^2)^2) - ((d + e*x)*(a*(A*c + 3*a*C)*e - c*(3*A*c*d + a*C*
d + 2*a*B*e)*x))/(8*a^2*c^2*(a + c*x^2)) + ((a*(A*c + 3*a*C)*e^2 + c*d*(3*A*c*d + a*C*d + 2*a*B*e))*ArcTan[(Sq
rt[c]*x)/Sqrt[a]])/(8*a^(5/2)*c^(5/2))

________________________________________________________________________________________

Rubi [A]  time = 0.230675, antiderivative size = 175, normalized size of antiderivative = 1.12, number of steps used = 3, number of rules used = 3, integrand size = 27, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.111, Rules used = {1645, 778, 205} $-\frac{x \left (a e^2 (3 a C+A c)-c d (2 a B e+a C d+3 A c d)\right )+2 a e (a B e+2 a C d+2 A c d)}{8 a^2 c^2 \left (a+c x^2\right )}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (c d (2 a B e+a C d+3 A c d)+a e^2 (3 a C+A c)\right )}{8 a^{5/2} c^{5/2}}-\frac{(d+e x)^2 (a B-x (A c-a C))}{4 a c \left (a+c x^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1645

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq,
a + c*x^2, x], f = Coeff[PolynomialRemainder[Pq, a + c*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + c
*x^2, x], x, 1]}, Simp[((d + e*x)^m*(a + c*x^2)^(p + 1)*(a*g - c*f*x))/(2*a*c*(p + 1)), x] + Dist[1/(2*a*c*(p
+ 1)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^(p + 1)*ExpandToSum[2*a*c*(p + 1)*(d + e*x)*Q - a*e*g*m + c*d*f*(2*p
+ 3) + c*e*f*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, c, d, e}, x] && PolyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] &
& LtQ[p, -1] && GtQ[m, 0] &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))

Rule 778

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((a*(e*f + d*g) -
(c*d*f - a*e*g)*x)*(a + c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(2*a*c*(p + 1)),
Int[(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && LtQ[p, -1]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

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

Mathematica [A]  time = 0.153778, size = 211, normalized size = 1.35 $\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (A c \left (a e^2+3 c d^2\right )+a \left (3 a C e^2+c d (2 B e+C d)\right )\right )}{8 a^{5/2} c^{5/2}}+\frac{a^2 (-e) (4 B e+8 C d+5 C e x)+a c x \left (e (A e+2 B d)+C d^2\right )+3 A c^2 d^2 x}{8 a^2 c^2 \left (a+c x^2\right )}+\frac{a^2 e (B e+2 C d+C e x)-a c \left (A e (2 d+e x)+B d (d+2 e x)+C d^2 x\right )+A c^2 d^2 x}{4 a c^2 \left (a+c x^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 283, normalized size = 1.8 \begin{align*}{\frac{1}{ \left ( c{x}^{2}+a \right ) ^{2}} \left ({\frac{ \left ( aA{e}^{2}c+3\,A{c}^{2}{d}^{2}+2\,Bacde-5\,{a}^{2}C{e}^{2}+Cac{d}^{2} \right ){x}^{3}}{8\,{a}^{2}c}}-{\frac{e \left ( Be+2\,Cd \right ){x}^{2}}{2\,c}}-{\frac{ \left ( aA{e}^{2}c-5\,A{c}^{2}{d}^{2}+2\,Bacde+3\,{a}^{2}C{e}^{2}+Cac{d}^{2} \right ) x}{8\,a{c}^{2}}}-{\frac{2\,Acde+aB{e}^{2}+Bc{d}^{2}+2\,Cade}{4\,{c}^{2}}} \right ) }+{\frac{A{e}^{2}}{8\,ac}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{3\,A{d}^{2}}{8\,{a}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{Bde}{4\,ac}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{3\,C{e}^{2}}{8\,{c}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{C{d}^{2}}{8\,ac}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

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

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.48735, size = 1644, normalized size = 10.54 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 163.039, size = 389, normalized size = 2.49 \begin{align*} - \frac{\sqrt{- \frac{1}{a^{5} c^{5}}} \left (A a c e^{2} + 3 A c^{2} d^{2} + 2 B a c d e + 3 C a^{2} e^{2} + C a c d^{2}\right ) \log{\left (- a^{3} c^{2} \sqrt{- \frac{1}{a^{5} c^{5}}} + x \right )}}{16} + \frac{\sqrt{- \frac{1}{a^{5} c^{5}}} \left (A a c e^{2} + 3 A c^{2} d^{2} + 2 B a c d e + 3 C a^{2} e^{2} + C a c d^{2}\right ) \log{\left (a^{3} c^{2} \sqrt{- \frac{1}{a^{5} c^{5}}} + x \right )}}{16} - \frac{4 A a^{2} c d e + 2 B a^{3} e^{2} + 2 B a^{2} c d^{2} + 4 C a^{3} d e + x^{3} \left (- A a c^{2} e^{2} - 3 A c^{3} d^{2} - 2 B a c^{2} d e + 5 C a^{2} c e^{2} - C a c^{2} d^{2}\right ) + x^{2} \left (4 B a^{2} c e^{2} + 8 C a^{2} c d e\right ) + x \left (A a^{2} c e^{2} - 5 A a c^{2} d^{2} + 2 B a^{2} c d e + 3 C a^{3} e^{2} + C a^{2} c d^{2}\right )}{8 a^{4} c^{2} + 16 a^{3} c^{3} x^{2} + 8 a^{2} c^{4} x^{4}} \end{align*}

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

[In]

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

[Out]

-sqrt(-1/(a**5*c**5))*(A*a*c*e**2 + 3*A*c**2*d**2 + 2*B*a*c*d*e + 3*C*a**2*e**2 + C*a*c*d**2)*log(-a**3*c**2*s
qrt(-1/(a**5*c**5)) + x)/16 + sqrt(-1/(a**5*c**5))*(A*a*c*e**2 + 3*A*c**2*d**2 + 2*B*a*c*d*e + 3*C*a**2*e**2 +
C*a*c*d**2)*log(a**3*c**2*sqrt(-1/(a**5*c**5)) + x)/16 - (4*A*a**2*c*d*e + 2*B*a**3*e**2 + 2*B*a**2*c*d**2 +
4*C*a**3*d*e + x**3*(-A*a*c**2*e**2 - 3*A*c**3*d**2 - 2*B*a*c**2*d*e + 5*C*a**2*c*e**2 - C*a*c**2*d**2) + x**2
*(4*B*a**2*c*e**2 + 8*C*a**2*c*d*e) + x*(A*a**2*c*e**2 - 5*A*a*c**2*d**2 + 2*B*a**2*c*d*e + 3*C*a**3*e**2 + C*
a**2*c*d**2))/(8*a**4*c**2 + 16*a**3*c**3*x**2 + 8*a**2*c**4*x**4)

________________________________________________________________________________________

Giac [A]  time = 1.15984, size = 343, normalized size = 2.2 \begin{align*} \frac{{\left (C a c d^{2} + 3 \, A c^{2} d^{2} + 2 \, B a c d e + 3 \, C a^{2} e^{2} + A a c e^{2}\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{8 \, \sqrt{a c} a^{2} c^{2}} + \frac{C a c^{2} d^{2} x^{3} + 3 \, A c^{3} d^{2} x^{3} + 2 \, B a c^{2} d x^{3} e - 5 \, C a^{2} c x^{3} e^{2} + A a c^{2} x^{3} e^{2} - 8 \, C a^{2} c d x^{2} e - C a^{2} c d^{2} x + 5 \, A a c^{2} d^{2} x - 4 \, B a^{2} c x^{2} e^{2} - 2 \, B a^{2} c d x e - 2 \, B a^{2} c d^{2} - 3 \, C a^{3} x e^{2} - A a^{2} c x e^{2} - 4 \, C a^{3} d e - 4 \, A a^{2} c d e - 2 \, B a^{3} e^{2}}{8 \,{\left (c x^{2} + a\right )}^{2} a^{2} c^{2}} \end{align*}

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

[In]

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

[Out]

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