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

Optimal. Leaf size=143 $-\frac{\sqrt{d^2-e^2 x^2} \left (3 e (A e+B d)+2 C d^2\right )}{3 e^3}+\frac{d \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (e (2 A e+B d)+C d^2\right )}{2 e^3}-\frac{x \sqrt{d^2-e^2 x^2} (B e+C d)}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.198975, antiderivative size = 143, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 32, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.125, Rules used = {1815, 641, 217, 203} $-\frac{\sqrt{d^2-e^2 x^2} \left (3 e (A e+B d)+2 C d^2\right )}{3 e^3}+\frac{d \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (e (2 A e+B d)+C d^2\right )}{2 e^3}-\frac{x \sqrt{d^2-e^2 x^2} (B e+C d)}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-((2*C*d^2 + 3*e*(B*d + A*e))*Sqrt[d^2 - e^2*x^2])/(3*e^3) - ((C*d + B*e)*x*Sqrt[d^2 - e^2*x^2])/(2*e^2) - (C*
x^2*Sqrt[d^2 - e^2*x^2])/(3*e) + (d*(C*d^2 + e*(B*d + 2*A*e))*ArcTan[(e*x)/Sqrt[d^2 - e^2*x^2]])/(2*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) \left (A+B x+C x^2\right )}{\sqrt{d^2-e^2 x^2}} \, dx &=-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}-\frac{\int \frac{-3 A d e^2-e \left (2 C d^2+3 e (B d+A e)\right ) x-3 e^2 (C d+B e) x^2}{\sqrt{d^2-e^2 x^2}} \, dx}{3 e^2}\\ &=-\frac{(C d+B e) x \sqrt{d^2-e^2 x^2}}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}+\frac{\int \frac{3 d e^2 \left (C d^2+e (B d+2 A e)\right )+2 e^3 \left (2 C d^2+3 e (B d+A e)\right ) x}{\sqrt{d^2-e^2 x^2}} \, dx}{6 e^4}\\ &=-\frac{\left (2 C d^2+3 e (B d+A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{(C d+B e) x \sqrt{d^2-e^2 x^2}}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}+\frac{\left (d \left (C d^2+e (B d+2 A e)\right )\right ) \int \frac{1}{\sqrt{d^2-e^2 x^2}} \, dx}{2 e^2}\\ &=-\frac{\left (2 C d^2+3 e (B d+A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{(C d+B e) x \sqrt{d^2-e^2 x^2}}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}+\frac{\left (d \left (C d^2+e (B d+2 A e)\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 )}{2 e^2}\\ &=-\frac{\left (2 C d^2+3 e (B d+A e)\right ) \sqrt{d^2-e^2 x^2}}{3 e^3}-\frac{(C d+B e) x \sqrt{d^2-e^2 x^2}}{2 e^2}-\frac{C x^2 \sqrt{d^2-e^2 x^2}}{3 e}+\frac{d \left (C d^2+e (B d+2 A e)\right ) \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right )}{2 e^3}\\ \end{align*}

Mathematica [A]  time = 0.115612, size = 103, normalized size = 0.72 $\frac{3 d \tan ^{-1}\left (\frac{e x}{\sqrt{d^2-e^2 x^2}}\right ) \left (e (2 A e+B d)+C d^2\right )-\sqrt{d^2-e^2 x^2} \left (3 e (2 A e+2 B d+B e x)+C \left (4 d^2+3 d e x+2 e^2 x^2\right )\right )}{6 e^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 234, normalized size = 1.6 \begin{align*} -{\frac{C{x}^{2}}{3\,e}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{2\,C{d}^{2}}{3\,{e}^{3}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{Bx}{2\,e}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{Cdx}{2\,{e}^{2}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}+{\frac{B{d}^{2}}{2\,e}\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}}+{\frac{C{d}^{3}}{2\,{e}^{2}}\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}}-{\frac{A}{e}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}-{\frac{Bd}{{e}^{2}}\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}+{Ad\arctan \left ({x\sqrt{{e}^{2}}{\frac{1}{\sqrt{-{x}^{2}{e}^{2}+{d}^{2}}}}} \right ){\frac{1}{\sqrt{{e}^{2}}}}} \end{align*}

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

[In]

int((e*x+d)*(C*x^2+B*x+A)/(-e^2*x^2+d^2)^(1/2),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.55194, size = 234, normalized size = 1.64 \begin{align*} -\frac{\sqrt{-e^{2} x^{2} + d^{2}} C x^{2}}{3 \, e} + \frac{A d \arcsin \left (\frac{e^{2} x}{\sqrt{d^{2} e^{2}}}\right )}{\sqrt{e^{2}}} + \frac{{\left (C d + B e\right )} d^{2} \arcsin \left (\frac{e^{2} x}{\sqrt{d^{2} e^{2}}}\right )}{2 \, \sqrt{e^{2}} e^{2}} - \frac{2 \, \sqrt{-e^{2} x^{2} + d^{2}} C d^{2}}{3 \, e^{3}} - \frac{\sqrt{-e^{2} x^{2} + d^{2}} B d}{e^{2}} - \frac{\sqrt{-e^{2} x^{2} + d^{2}} A}{e} - \frac{\sqrt{-e^{2} x^{2} + d^{2}}{\left (C d + B e\right )} x}{2 \, e^{2}} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.76141, size = 236, normalized size = 1.65 \begin{align*} -\frac{6 \,{\left (C d^{3} + B d^{2} e + 2 \, A d e^{2}\right )} \arctan \left (-\frac{d - \sqrt{-e^{2} x^{2} + d^{2}}}{e x}\right ) +{\left (2 \, C e^{2} x^{2} + 4 \, C d^{2} + 6 \, B d e + 6 \, A e^{2} + 3 \,{\left (C d e + B e^{2}\right )} x\right )} \sqrt{-e^{2} x^{2} + d^{2}}}{6 \, e^{3}} \end{align*}

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

[In]

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

[Out]

-1/6*(6*(C*d^3 + B*d^2*e + 2*A*d*e^2)*arctan(-(d - sqrt(-e^2*x^2 + d^2))/(e*x)) + (2*C*e^2*x^2 + 4*C*d^2 + 6*B
*d*e + 6*A*e^2 + 3*(C*d*e + B*e^2)*x)*sqrt(-e^2*x^2 + d^2))/e^3

________________________________________________________________________________________

Sympy [A]  time = 7.5767, size = 488, normalized size = 3.41 \begin{align*} A d \left (\begin{cases} \frac{\sqrt{\frac{d^{2}}{e^{2}}} \operatorname{asin}{\left (x \sqrt{\frac{e^{2}}{d^{2}}} \right )}}{\sqrt{d^{2}}} & \text{for}\: d^{2} > 0 \wedge e^{2} > 0 \\\frac{\sqrt{- \frac{d^{2}}{e^{2}}} \operatorname{asinh}{\left (x \sqrt{- \frac{e^{2}}{d^{2}}} \right )}}{\sqrt{d^{2}}} & \text{for}\: d^{2} > 0 \wedge e^{2} < 0 \\\frac{\sqrt{\frac{d^{2}}{e^{2}}} \operatorname{acosh}{\left (x \sqrt{\frac{e^{2}}{d^{2}}} \right )}}{\sqrt{- d^{2}}} & \text{for}\: d^{2} < 0 \wedge e^{2} < 0 \end{cases}\right ) + A e \left (\begin{cases} \frac{x^{2}}{2 \sqrt{d^{2}}} & \text{for}\: e^{2} = 0 \\- \frac{\sqrt{d^{2} - e^{2} x^{2}}}{e^{2}} & \text{otherwise} \end{cases}\right ) + B d \left (\begin{cases} \frac{x^{2}}{2 \sqrt{d^{2}}} & \text{for}\: e^{2} = 0 \\- \frac{\sqrt{d^{2} - e^{2} x^{2}}}{e^{2}} & \text{otherwise} \end{cases}\right ) + B e \left (\begin{cases} - \frac{i d^{2} \operatorname{acosh}{\left (\frac{e x}{d} \right )}}{2 e^{3}} - \frac{i d x \sqrt{-1 + \frac{e^{2} x^{2}}{d^{2}}}}{2 e^{2}} & \text{for}\: \frac{\left |{e^{2} x^{2}}\right |}{\left |{d^{2}}\right |} > 1 \\\frac{d^{2} \operatorname{asin}{\left (\frac{e x}{d} \right )}}{2 e^{3}} - \frac{d x}{2 e^{2} \sqrt{1 - \frac{e^{2} x^{2}}{d^{2}}}} + \frac{x^{3}}{2 d \sqrt{1 - \frac{e^{2} x^{2}}{d^{2}}}} & \text{otherwise} \end{cases}\right ) + C d \left (\begin{cases} - \frac{i d^{2} \operatorname{acosh}{\left (\frac{e x}{d} \right )}}{2 e^{3}} - \frac{i d x \sqrt{-1 + \frac{e^{2} x^{2}}{d^{2}}}}{2 e^{2}} & \text{for}\: \frac{\left |{e^{2} x^{2}}\right |}{\left |{d^{2}}\right |} > 1 \\\frac{d^{2} \operatorname{asin}{\left (\frac{e x}{d} \right )}}{2 e^{3}} - \frac{d x}{2 e^{2} \sqrt{1 - \frac{e^{2} x^{2}}{d^{2}}}} + \frac{x^{3}}{2 d \sqrt{1 - \frac{e^{2} x^{2}}{d^{2}}}} & \text{otherwise} \end{cases}\right ) + C e \left (\begin{cases} - \frac{2 d^{2} \sqrt{d^{2} - e^{2} x^{2}}}{3 e^{4}} - \frac{x^{2} \sqrt{d^{2} - e^{2} x^{2}}}{3 e^{2}} & \text{for}\: e \neq 0 \\\frac{x^{4}}{4 \sqrt{d^{2}}} & \text{otherwise} \end{cases}\right ) \end{align*}

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

[In]

integrate((e*x+d)*(C*x**2+B*x+A)/(-e**2*x**2+d**2)**(1/2),x)

[Out]

A*d*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))/sqr
t(-d**2), (d**2 < 0) & (e**2 < 0))) + A*e*Piecewise((x**2/(2*sqrt(d**2)), Eq(e**2, 0)), (-sqrt(d**2 - e**2*x**
2)/e**2, True)) + B*d*Piecewise((x**2/(2*sqrt(d**2)), Eq(e**2, 0)), (-sqrt(d**2 - e**2*x**2)/e**2, True)) + B*
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)) + C*d*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)) + C*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))

________________________________________________________________________________________

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

[Out]

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