\(\int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx\) [34]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F(-2)]
Mupad [F(-1)]
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 47, antiderivative size = 179 \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=-\frac {c \left (c^2 C-B c d+A d^2-\frac {c^3 D}{d}\right )-\left (c^2 C d-B c d^2+A d^3-c^3 D\right ) x}{3 c d^3 \left (c^2-d^2 x^2\right )^{3/2}}+\frac {3 c^3 (C d-c D)-d \left (c^2 C d-B c d^2-2 A d^3-4 c^3 D\right ) x}{3 c^3 d^4 \sqrt {c^2-d^2 x^2}}-\frac {D \arctan \left (\frac {d x}{\sqrt {c^2-d^2 x^2}}\right )}{d^4} \] Output:

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

Mathematica [A] (verified)

Time = 0.72 (sec) , antiderivative size = 156, normalized size of antiderivative = 0.87 \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=\frac {\frac {\sqrt {c^2-d^2 x^2} \left (-2 c^5 D+2 A d^5 x^2+c d^4 x (2 A+B x)+c^4 d (2 C+D x)-c^2 d^3 (A+x (-B+C x))+c^3 d^2 (B+2 x (C+2 D x))\right )}{c^3 (c-d x) (c+d x)^2}+6 D \arctan \left (\frac {d x}{\sqrt {c^2}-\sqrt {c^2-d^2 x^2}}\right )}{3 d^4} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.97 (sec) , antiderivative size = 260, normalized size of antiderivative = 1.45, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {2348, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx\)

\(\Big \downarrow \) 2348

\(\displaystyle \int \left (\frac {A d^3+B c d^2+c^3 D+c^2 C d}{4 c^2 d^3 (c-d x) \sqrt {c^2-d^2 x^2}}+\frac {A d^3+B c d^2+5 c^3 D-3 c^2 C d}{4 c^2 d^3 (c+d x) \sqrt {c^2-d^2 x^2}}+\frac {A d^3-B c d^2+c^3 (-D)+c^2 C d}{2 c d^3 (c+d x)^2 \sqrt {c^2-d^2 x^2}}-\frac {D}{d^3 \sqrt {c^2-d^2 x^2}}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\sqrt {c^2-d^2 x^2} \left (-A d^3-B c d^2-5 c^3 D+3 c^2 C d\right )}{4 c^3 d^4 (c+d x)}+\frac {\sqrt {c^2-d^2 x^2} \left (A d^3+B c d^2+c^3 D+c^2 C d\right )}{4 c^3 d^4 (c-d x)}-\frac {\sqrt {c^2-d^2 x^2} \left (A d^3-B c d^2+c^3 (-D)+c^2 C d\right )}{6 c^3 d^4 (c+d x)}-\frac {\sqrt {c^2-d^2 x^2} \left (A d^3-B c d^2+c^3 (-D)+c^2 C d\right )}{6 c^2 d^4 (c+d x)^2}-\frac {D \arctan \left (\frac {d x}{\sqrt {c^2-d^2 x^2}}\right )}{d^4}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2348
Int[(Px_)*((c_) + (d_.)*(x_))^(m_.)*((e_) + (f_.)*(x_))^(n_.)*((a_.) + (b_. 
)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(c + d*x)^m*(e + f*x)^ 
n*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && PolyQ[P 
x, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ[m] && ILtQ[n, 0])) && 
!(IGtQ[m, 0] && IGtQ[n, 0])
 
Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 297, normalized size of antiderivative = 1.66

method result size
default \(-\frac {D \arctan \left (\frac {\sqrt {d^{2}}\, x}{\sqrt {-d^{2} x^{2}+c^{2}}}\right )}{d^{3} \sqrt {d^{2}}}-\frac {\left (A \,d^{3}+B c \,d^{2}+C \,c^{2} d +D c^{3}\right ) \sqrt {-d^{2} \left (x -\frac {c}{d}\right )^{2}-2 c d \left (x -\frac {c}{d}\right )}}{4 d^{5} c^{3} \left (x -\frac {c}{d}\right )}+\frac {\left (A \,d^{3}-B c \,d^{2}+C \,c^{2} d -D c^{3}\right ) \left (-\frac {\sqrt {-d^{2} \left (x +\frac {c}{d}\right )^{2}+2 c d \left (x +\frac {c}{d}\right )}}{3 c d \left (x +\frac {c}{d}\right )^{2}}-\frac {\sqrt {-d^{2} \left (x +\frac {c}{d}\right )^{2}+2 c d \left (x +\frac {c}{d}\right )}}{3 c^{2} \left (x +\frac {c}{d}\right )}\right )}{2 d^{5} c}-\frac {\left (A \,d^{3}+B c \,d^{2}-3 C \,c^{2} d +5 D c^{3}\right ) \sqrt {-d^{2} \left (x +\frac {c}{d}\right )^{2}+2 c d \left (x +\frac {c}{d}\right )}}{4 d^{5} c^{3} \left (x +\frac {c}{d}\right )}\) \(297\)

Input:

int((D*x^3+C*x^2+B*x+A)/(-d*x+c)/(d*x+c)^2/(-d^2*x^2+c^2)^(1/2),x,method=_ 
RETURNVERBOSE)
 

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 366 vs. \(2 (168) = 336\).

Time = 0.09 (sec) , antiderivative size = 366, normalized size of antiderivative = 2.04 \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=\frac {2 \, D c^{6} - 2 \, C c^{5} d - B c^{4} d^{2} + A c^{3} d^{3} - {\left (2 \, D c^{3} d^{3} - 2 \, C c^{2} d^{4} - B c d^{5} + A d^{6}\right )} x^{3} - {\left (2 \, D c^{4} d^{2} - 2 \, C c^{3} d^{3} - B c^{2} d^{4} + A c d^{5}\right )} x^{2} + {\left (2 \, D c^{5} d - 2 \, C c^{4} d^{2} - B c^{3} d^{3} + A c^{2} d^{4}\right )} x + 6 \, {\left (D c^{3} d^{3} x^{3} + D c^{4} d^{2} x^{2} - D c^{5} d x - D c^{6}\right )} \arctan \left (-\frac {c - \sqrt {-d^{2} x^{2} + c^{2}}}{d x}\right ) + {\left (2 \, D c^{5} - 2 \, C c^{4} d - B c^{3} d^{2} + A c^{2} d^{3} - {\left (4 \, D c^{3} d^{2} - C c^{2} d^{3} + B c d^{4} + 2 \, A d^{5}\right )} x^{2} - {\left (D c^{4} d + 2 \, C c^{3} d^{2} + B c^{2} d^{3} + 2 \, A c d^{4}\right )} x\right )} \sqrt {-d^{2} x^{2} + c^{2}}}{3 \, {\left (c^{3} d^{7} x^{3} + c^{4} d^{6} x^{2} - c^{5} d^{5} x - c^{6} d^{4}\right )}} \] Input:

integrate((D*x^3+C*x^2+B*x+A)/(-d*x+c)/(d*x+c)^2/(-d^2*x^2+c^2)^(1/2),x, a 
lgorithm="fricas")
 

Output:

1/3*(2*D*c^6 - 2*C*c^5*d - B*c^4*d^2 + A*c^3*d^3 - (2*D*c^3*d^3 - 2*C*c^2* 
d^4 - B*c*d^5 + A*d^6)*x^3 - (2*D*c^4*d^2 - 2*C*c^3*d^3 - B*c^2*d^4 + A*c* 
d^5)*x^2 + (2*D*c^5*d - 2*C*c^4*d^2 - B*c^3*d^3 + A*c^2*d^4)*x + 6*(D*c^3* 
d^3*x^3 + D*c^4*d^2*x^2 - D*c^5*d*x - D*c^6)*arctan(-(c - sqrt(-d^2*x^2 + 
c^2))/(d*x)) + (2*D*c^5 - 2*C*c^4*d - B*c^3*d^2 + A*c^2*d^3 - (4*D*c^3*d^2 
 - C*c^2*d^3 + B*c*d^4 + 2*A*d^5)*x^2 - (D*c^4*d + 2*C*c^3*d^2 + B*c^2*d^3 
 + 2*A*c*d^4)*x)*sqrt(-d^2*x^2 + c^2))/(c^3*d^7*x^3 + c^4*d^6*x^2 - c^5*d^ 
5*x - c^6*d^4)
 

Sympy [F]

\[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=- \int \frac {A}{- c^{3} \sqrt {c^{2} - d^{2} x^{2}} - c^{2} d x \sqrt {c^{2} - d^{2} x^{2}} + c d^{2} x^{2} \sqrt {c^{2} - d^{2} x^{2}} + d^{3} x^{3} \sqrt {c^{2} - d^{2} x^{2}}}\, dx - \int \frac {B x}{- c^{3} \sqrt {c^{2} - d^{2} x^{2}} - c^{2} d x \sqrt {c^{2} - d^{2} x^{2}} + c d^{2} x^{2} \sqrt {c^{2} - d^{2} x^{2}} + d^{3} x^{3} \sqrt {c^{2} - d^{2} x^{2}}}\, dx - \int \frac {C x^{2}}{- c^{3} \sqrt {c^{2} - d^{2} x^{2}} - c^{2} d x \sqrt {c^{2} - d^{2} x^{2}} + c d^{2} x^{2} \sqrt {c^{2} - d^{2} x^{2}} + d^{3} x^{3} \sqrt {c^{2} - d^{2} x^{2}}}\, dx - \int \frac {D x^{3}}{- c^{3} \sqrt {c^{2} - d^{2} x^{2}} - c^{2} d x \sqrt {c^{2} - d^{2} x^{2}} + c d^{2} x^{2} \sqrt {c^{2} - d^{2} x^{2}} + d^{3} x^{3} \sqrt {c^{2} - d^{2} x^{2}}}\, dx \] Input:

integrate((D*x**3+C*x**2+B*x+A)/(-d*x+c)/(d*x+c)**2/(-d**2*x**2+c**2)**(1/ 
2),x)
 

Output:

-Integral(A/(-c**3*sqrt(c**2 - d**2*x**2) - c**2*d*x*sqrt(c**2 - d**2*x**2 
) + c*d**2*x**2*sqrt(c**2 - d**2*x**2) + d**3*x**3*sqrt(c**2 - d**2*x**2)) 
, x) - Integral(B*x/(-c**3*sqrt(c**2 - d**2*x**2) - c**2*d*x*sqrt(c**2 - d 
**2*x**2) + c*d**2*x**2*sqrt(c**2 - d**2*x**2) + d**3*x**3*sqrt(c**2 - d** 
2*x**2)), x) - Integral(C*x**2/(-c**3*sqrt(c**2 - d**2*x**2) - c**2*d*x*sq 
rt(c**2 - d**2*x**2) + c*d**2*x**2*sqrt(c**2 - d**2*x**2) + d**3*x**3*sqrt 
(c**2 - d**2*x**2)), x) - Integral(D*x**3/(-c**3*sqrt(c**2 - d**2*x**2) - 
c**2*d*x*sqrt(c**2 - d**2*x**2) + c*d**2*x**2*sqrt(c**2 - d**2*x**2) + d** 
3*x**3*sqrt(c**2 - d**2*x**2)), x)
 

Maxima [F]

\[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=\int { -\frac {D x^{3} + C x^{2} + B x + A}{\sqrt {-d^{2} x^{2} + c^{2}} {\left (d x + c\right )}^{2} {\left (d x - c\right )}} \,d x } \] Input:

integrate((D*x^3+C*x^2+B*x+A)/(-d*x+c)/(d*x+c)^2/(-d^2*x^2+c^2)^(1/2),x, a 
lgorithm="maxima")
 

Output:

-integrate((D*x^3 + C*x^2 + B*x + A)/(sqrt(-d^2*x^2 + c^2)*(d*x + c)^2*(d* 
x - c)), x)
 

Giac [F(-2)]

Exception generated. \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=\text {Exception raised: NotImplementedError} \] Input:

integrate((D*x^3+C*x^2+B*x+A)/(-d*x+c)/(d*x+c)^2/(-d^2*x^2+c^2)^(1/2),x, a 
lgorithm="giac")
 

Output:

Exception raised: NotImplementedError >> unable to parse Giac output: -1/a 
bs(sageVARd)*(-1/4*(sageVARA*sageVARd^3+sageVARD*sageVARc^3+sageVARB*sageV 
ARc*sageVARd^2+sageVARC*sageVARc^2*sageVARd)/sageVARc^3/sageVARd^3/sqrt(2* 
sageVARc*sageVARd*(
                                                                                    
                                                                                    
 

Mupad [F(-1)]

Timed out. \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx=\int \frac {A+B\,x+C\,x^2+x^3\,D}{\sqrt {c^2-d^2\,x^2}\,{\left (c+d\,x\right )}^2\,\left (c-d\,x\right )} \,d x \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 550, normalized size of antiderivative = 3.07 \[ \int \frac {A+B x+C x^2+D x^3}{(c-d x) (c+d x)^2 \sqrt {c^2-d^2 x^2}} \, dx =\text {Too large to display} \] Input:

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

Output:

( - 3*sqrt(c**2 - d**2*x**2)*asin((d*x)/c)*tan(asin((d*x)/c)/2)**4*c**3 - 
6*sqrt(c**2 - d**2*x**2)*asin((d*x)/c)*tan(asin((d*x)/c)/2)**3*c**3 + 6*sq 
rt(c**2 - d**2*x**2)*asin((d*x)/c)*tan(asin((d*x)/c)/2)*c**3 + 3*sqrt(c**2 
 - d**2*x**2)*asin((d*x)/c)*c**3 + 3*sqrt(c**2 - d**2*x**2)*tan(asin((d*x) 
/c)/2)**4*a*d**2 + 3*sqrt(c**2 - d**2*x**2)*tan(asin((d*x)/c)/2)**4*c**3 - 
 6*sqrt(c**2 - d**2*x**2)*tan(asin((d*x)/c)/2)**2*a*d**2 - 6*sqrt(c**2 - d 
**2*x**2)*tan(asin((d*x)/c)/2)**2*c**3 - 8*sqrt(c**2 - d**2*x**2)*tan(asin 
((d*x)/c)/2)*a*d**2 + 8*sqrt(c**2 - d**2*x**2)*tan(asin((d*x)/c)/2)*b*c*d 
- sqrt(c**2 - d**2*x**2)*a*d**2 + 4*sqrt(c**2 - d**2*x**2)*b*c*d + 3*sqrt( 
c**2 - d**2*x**2)*c**3 + 3*tan(asin((d*x)/c)/2)**4*b*c**2*d + 3*tan(asin(( 
d*x)/c)/2)**4*c**4 + 6*tan(asin((d*x)/c)/2)**3*b*c**2*d + 6*tan(asin((d*x) 
/c)/2)**3*c**4 - 6*tan(asin((d*x)/c)/2)*b*c**2*d - 6*tan(asin((d*x)/c)/2)* 
c**4 - 3*b*c**2*d - 3*c**4)/(3*sqrt(c**2 - d**2*x**2)*c**3*d**3*(tan(asin( 
(d*x)/c)/2)**4 + 2*tan(asin((d*x)/c)/2)**3 - 2*tan(asin((d*x)/c)/2) - 1))