### 3.11 $$\int \frac{(d+e x)^2 (A+B x+C x^2)}{\sqrt{d^2-e^2 x^2}} \, dx$$

Optimal. Leaf size=191 $-\frac{x \sqrt{d^2-e^2 x^2} \left (4 e (A e+2 B d)+7 C d^2\right )}{8 e^2}-\frac{d \sqrt{d^2-e^2 x^2} \left (e (6 A e+5 B d)+4 C d^2\right )}{3 e^3}+\frac{d^2 \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (12 A e^2+8 B d e+7 C d^2\right )}{8 e^3}-\frac{x^2 \sqrt{d^2-e^2 x^2} (B e+2 C d)}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.378195, antiderivative size = 191, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 34, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.118, Rules used = {1815, 641, 217, 203} $-\frac{x \sqrt{d^2-e^2 x^2} \left (4 e (A e+2 B d)+7 C d^2\right )}{8 e^2}-\frac{d \sqrt{d^2-e^2 x^2} \left (e (6 A e+5 B d)+4 C d^2\right )}{3 e^3}+\frac{d^2 \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (12 A e^2+8 B d e+7 C d^2\right )}{8 e^3}-\frac{x^2 \sqrt{d^2-e^2 x^2} (B e+2 C d)}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1815

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], e = Coeff[Pq, x, Expon[Pq, x]]}, Si
mp[(e*x^(q - 1)*(a + b*x^2)^(p + 1))/(b*(q + 2*p + 1)), x] + Dist[1/(b*(q + 2*p + 1)), Int[(a + b*x^2)^p*Expan
dToSum[b*(q + 2*p + 1)*Pq - a*e*(q - 1)*x^(q - 2) - b*e*(q + 2*p + 1)*x^q, x], x], x]] /; FreeQ[{a, b, p}, x]
&& PolyQ[Pq, x] &&  !LeQ[p, -1]

Rule 641

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

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 203

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

Rubi steps

\begin{align*} \int \frac{(d+e x)^2 \left (A+B x+C x^2\right )}{\sqrt{d^2-e^2 x^2}} \, dx &=-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}-\frac{\int \frac{-4 A d^2 e^2-4 d e^2 (B d+2 A e) x-e^2 \left (7 C d^2+4 e (2 B d+A e)\right ) x^2-4 e^3 (2 C d+B e) x^3}{\sqrt{d^2-e^2 x^2}} \, dx}{4 e^2}\\ &=-\frac{(2 C d+B e) x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}+\frac{\int \frac{12 A d^2 e^4+4 d e^3 \left (4 C d^2+e (5 B d+6 A e)\right ) x+3 e^4 \left (7 C d^2+4 e (2 B d+A e)\right ) x^2}{\sqrt{d^2-e^2 x^2}} \, dx}{12 e^4}\\ &=-\frac{\left (7 C d^2+4 e (2 B d+A e)\right ) x \sqrt{d^2-e^2 x^2}}{8 e^2}-\frac{(2 C d+B e) x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}-\frac{\int \frac{-3 d^2 e^4 \left (7 C d^2+8 B d e+12 A e^2\right )-8 d e^5 \left (4 C d^2+e (5 B d+6 A e)\right ) x}{\sqrt{d^2-e^2 x^2}} \, dx}{24 e^6}\\ &=-\frac{d \left (4 C d^2+e (5 B d+6 A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{\left (7 C d^2+4 e (2 B d+A e)\right ) x \sqrt{d^2-e^2 x^2}}{8 e^2}-\frac{(2 C d+B e) x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}+\frac{\left (d^2 \left (7 C d^2+8 B d e+12 A e^2\right )\right ) \int \frac{1}{\sqrt{d^2-e^2 x^2}} \, dx}{8 e^2}\\ &=-\frac{d \left (4 C d^2+e (5 B d+6 A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{\left (7 C d^2+4 e (2 B d+A e)\right ) x \sqrt{d^2-e^2 x^2}}{8 e^2}-\frac{(2 C d+B e) x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}+\frac{\left (d^2 \left (7 C d^2+8 B d e+12 A e^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+e^2 x^2} \, dx,x,\frac{x}{\sqrt{d^2-e^2 x^2}}\right )}{8 e^2}\\ &=-\frac{d \left (4 C d^2+e (5 B d+6 A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{\left (7 C d^2+4 e (2 B d+A e)\right ) x \sqrt{d^2-e^2 x^2}}{8 e^2}-\frac{(2 C d+B e) x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{1}{4} C x^3 \sqrt{d^2-e^2 x^2}+\frac{d^2 \left (7 C d^2+8 B d e+12 A e^2\right ) \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right )}{8 e^3}\\ \end{align*}

Mathematica [A]  time = 0.183379, size = 139, normalized size = 0.73 $\frac{3 d^2 \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (4 e (3 A e+2 B d)+7 C d^2\right )-\sqrt{d^2-e^2 x^2} \left (4 e \left (3 A e (4 d+e x)+2 B \left (5 d^2+3 d e x+e^2 x^2\right )\right )+C \left (21 d^2 e x+32 d^3+16 d e^2 x^2+6 e^3 x^3\right )\right )}{24 e^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(-(Sqrt[d^2 - e^2*x^2]*(C*(32*d^3 + 21*d^2*e*x + 16*d*e^2*x^2 + 6*e^3*x^3) + 4*e*(3*A*e*(4*d + e*x) + 2*B*(5*d
^2 + 3*d*e*x + e^2*x^2)))) + 3*d^2*(7*C*d^2 + 4*e*(2*B*d + 3*A*e))*ArcTan[(e*x)/Sqrt[d^2 - e^2*x^2]])/(24*e^3)

________________________________________________________________________________________

Maple [A]  time = 0.062, size = 301, normalized size = 1.6 \begin{align*} -{\frac{C{x}^{3}}{4}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{7\,C{d}^{2}x}{8\,{e}^{2}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}+{\frac{7\,C{d}^{4}}{8\,{e}^{2}}\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}}-{\frac{{x}^{2}B}{3}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{2\,Cd{x}^{2}}{3\,e}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{5\,B{d}^{2}}{3\,{e}^{2}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{4\,{d}^{3}C}{3\,{e}^{3}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{Ax}{2}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{Bdx}{e}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}+{\frac{3\,{d}^{2}A}{2}\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}}+{\frac{B{d}^{3}}{e}\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}}-2\,{\frac{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}Ad}{e}} \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)/(-e^2*x^2+d^2)^(1/2),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.51843, size = 390, normalized size = 2.04 \begin{align*} -\frac{1}{4} \, \sqrt{-e^{2} x^{2} + d^{2}} C x^{3} + \frac{A d^{2} \arcsin \left (\frac{e^{2} x}{\sqrt{d^{2} e^{2}}}\right )}{\sqrt{e^{2}}} + \frac{3 \, C d^{4} \arcsin \left (\frac{e^{2} x}{\sqrt{d^{2} e^{2}}}\right )}{8 \, \sqrt{e^{2}} e^{2}} - \frac{3 \, \sqrt{-e^{2} x^{2} + d^{2}} C d^{2} x}{8 \, e^{2}} - \frac{\sqrt{-e^{2} x^{2} + d^{2}} B d^{2}}{e^{2}} - \frac{2 \, \sqrt{-e^{2} x^{2} + d^{2}} A d}{e} - \frac{\sqrt{-e^{2} x^{2} + d^{2}}{\left (2 \, C d e + B e^{2}\right )} x^{2}}{3 \, e^{2}} + \frac{{\left (C d^{2} + 2 \, B d e + A e^{2}\right )} d^{2} \arcsin \left (\frac{e^{2} x}{\sqrt{d^{2} e^{2}}}\right )}{2 \, \sqrt{e^{2}} e^{2}} - \frac{\sqrt{-e^{2} x^{2} + d^{2}}{\left (C d^{2} + 2 \, B d e + A e^{2}\right )} x}{2 \, e^{2}} - \frac{2 \, \sqrt{-e^{2} x^{2} + d^{2}}{\left (2 \, C d e + B e^{2}\right )} d^{2}}{3 \, e^{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)/(-e^2*x^2+d^2)^(1/2),x, algorithm="maxima")

[Out]

-1/4*sqrt(-e^2*x^2 + d^2)*C*x^3 + A*d^2*arcsin(e^2*x/sqrt(d^2*e^2))/sqrt(e^2) + 3/8*C*d^4*arcsin(e^2*x/sqrt(d^
2*e^2))/(sqrt(e^2)*e^2) - 3/8*sqrt(-e^2*x^2 + d^2)*C*d^2*x/e^2 - sqrt(-e^2*x^2 + d^2)*B*d^2/e^2 - 2*sqrt(-e^2*
x^2 + d^2)*A*d/e - 1/3*sqrt(-e^2*x^2 + d^2)*(2*C*d*e + B*e^2)*x^2/e^2 + 1/2*(C*d^2 + 2*B*d*e + A*e^2)*d^2*arcs
in(e^2*x/sqrt(d^2*e^2))/(sqrt(e^2)*e^2) - 1/2*sqrt(-e^2*x^2 + d^2)*(C*d^2 + 2*B*d*e + A*e^2)*x/e^2 - 2/3*sqrt(
-e^2*x^2 + d^2)*(2*C*d*e + B*e^2)*d^2/e^4

________________________________________________________________________________________

Fricas [A]  time = 2.38753, size = 319, normalized size = 1.67 \begin{align*} -\frac{6 \,{\left (7 \, C d^{4} + 8 \, B d^{3} e + 12 \, A d^{2} e^{2}\right )} \arctan \left (-\frac{d - \sqrt{-e^{2} x^{2} + d^{2}}}{e x}\right ) +{\left (6 \, C e^{3} x^{3} + 32 \, C d^{3} + 40 \, B d^{2} e + 48 \, A d e^{2} + 8 \,{\left (2 \, C d e^{2} + B e^{3}\right )} x^{2} + 3 \,{\left (7 \, C d^{2} e + 8 \, B d e^{2} + 4 \, A e^{3}\right )} x\right )} \sqrt{-e^{2} x^{2} + d^{2}}}{24 \, e^{3}} \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)/(-e^2*x^2+d^2)^(1/2),x, algorithm="fricas")

[Out]

-1/24*(6*(7*C*d^4 + 8*B*d^3*e + 12*A*d^2*e^2)*arctan(-(d - sqrt(-e^2*x^2 + d^2))/(e*x)) + (6*C*e^3*x^3 + 32*C*
d^3 + 40*B*d^2*e + 48*A*d*e^2 + 8*(2*C*d*e^2 + B*e^3)*x^2 + 3*(7*C*d^2*e + 8*B*d*e^2 + 4*A*e^3)*x)*sqrt(-e^2*x
^2 + d^2))/e^3

________________________________________________________________________________________

Sympy [A]  time = 14.1762, size = 898, normalized size = 4.7 \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)/(-e**2*x**2+d**2)**(1/2),x)

[Out]

A*d**2*Piecewise((sqrt(d**2/e**2)*asin(x*sqrt(e**2/d**2))/sqrt(d**2), (d**2 > 0) & (e**2 > 0)), (sqrt(-d**2/e*
*2)*asinh(x*sqrt(-e**2/d**2))/sqrt(d**2), (d**2 > 0) & (e**2 < 0)), (sqrt(d**2/e**2)*acosh(x*sqrt(e**2/d**2))/
sqrt(-d**2), (d**2 < 0) & (e**2 < 0))) + 2*A*d*e*Piecewise((x**2/(2*sqrt(d**2)), Eq(e**2, 0)), (-sqrt(d**2 - e
**2*x**2)/e**2, True)) + A*e**2*Piecewise((-I*d**2*acosh(e*x/d)/(2*e**3) - I*d*x*sqrt(-1 + e**2*x**2/d**2)/(2*
e**2), Abs(e**2*x**2)/Abs(d**2) > 1), (d**2*asin(e*x/d)/(2*e**3) - d*x/(2*e**2*sqrt(1 - e**2*x**2/d**2)) + x**
3/(2*d*sqrt(1 - e**2*x**2/d**2)), True)) + B*d**2*Piecewise((x**2/(2*sqrt(d**2)), Eq(e**2, 0)), (-sqrt(d**2 -
e**2*x**2)/e**2, True)) + 2*B*d*e*Piecewise((-I*d**2*acosh(e*x/d)/(2*e**3) - I*d*x*sqrt(-1 + e**2*x**2/d**2)/(
2*e**2), Abs(e**2*x**2)/Abs(d**2) > 1), (d**2*asin(e*x/d)/(2*e**3) - d*x/(2*e**2*sqrt(1 - e**2*x**2/d**2)) + x
**3/(2*d*sqrt(1 - e**2*x**2/d**2)), True)) + B*e**2*Piecewise((-2*d**2*sqrt(d**2 - e**2*x**2)/(3*e**4) - x**2*
sqrt(d**2 - e**2*x**2)/(3*e**2), Ne(e, 0)), (x**4/(4*sqrt(d**2)), True)) + C*d**2*Piecewise((-I*d**2*acosh(e*x
/d)/(2*e**3) - I*d*x*sqrt(-1 + e**2*x**2/d**2)/(2*e**2), Abs(e**2*x**2)/Abs(d**2) > 1), (d**2*asin(e*x/d)/(2*e
**3) - d*x/(2*e**2*sqrt(1 - e**2*x**2/d**2)) + x**3/(2*d*sqrt(1 - e**2*x**2/d**2)), True)) + 2*C*d*e*Piecewise
((-2*d**2*sqrt(d**2 - e**2*x**2)/(3*e**4) - x**2*sqrt(d**2 - e**2*x**2)/(3*e**2), Ne(e, 0)), (x**4/(4*sqrt(d**
2)), True)) + C*e**2*Piecewise((-3*I*d**4*acosh(e*x/d)/(8*e**5) + 3*I*d**3*x/(8*e**4*sqrt(-1 + e**2*x**2/d**2)
) - I*d*x**3/(8*e**2*sqrt(-1 + e**2*x**2/d**2)) - I*x**5/(4*d*sqrt(-1 + e**2*x**2/d**2)), Abs(e**2*x**2)/Abs(d
**2) > 1), (3*d**4*asin(e*x/d)/(8*e**5) - 3*d**3*x/(8*e**4*sqrt(1 - e**2*x**2/d**2)) + d*x**3/(8*e**2*sqrt(1 -
e**2*x**2/d**2)) + x**5/(4*d*sqrt(1 - e**2*x**2/d**2)), True))

________________________________________________________________________________________

Giac [A]  time = 1.17706, size = 177, normalized size = 0.93 \begin{align*} \frac{1}{8} \,{\left (7 \, C d^{4} + 8 \, B d^{3} e + 12 \, A d^{2} e^{2}\right )} \arcsin \left (\frac{x e}{d}\right ) e^{\left (-3\right )} \mathrm{sgn}\left (d\right ) - \frac{1}{24} \, \sqrt{-x^{2} e^{2} + d^{2}}{\left ({\left (2 \,{\left (3 \, C x + 4 \,{\left (2 \, C d e^{4} + B e^{5}\right )} e^{\left (-5\right )}\right )} x + 3 \,{\left (7 \, C d^{2} e^{3} + 8 \, B d e^{4} + 4 \, A e^{5}\right )} e^{\left (-5\right )}\right )} x + 8 \,{\left (4 \, C d^{3} e^{2} + 5 \, B d^{2} e^{3} + 6 \, A d e^{4}\right )} e^{\left (-5\right )}\right )} \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)/(-e^2*x^2+d^2)^(1/2),x, algorithm="giac")

[Out]

1/8*(7*C*d^4 + 8*B*d^3*e + 12*A*d^2*e^2)*arcsin(x*e/d)*e^(-3)*sgn(d) - 1/24*sqrt(-x^2*e^2 + d^2)*((2*(3*C*x +
4*(2*C*d*e^4 + B*e^5)*e^(-5))*x + 3*(7*C*d^2*e^3 + 8*B*d*e^4 + 4*A*e^5)*e^(-5))*x + 8*(4*C*d^3*e^2 + 5*B*d^2*e
^3 + 6*A*d*e^4)*e^(-5))