\(\int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx\) [356]

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

Optimal result

Integrand size = 33, antiderivative size = 285 \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\frac {\left (8 a^2 A-15 A b^2+12 a b B\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{4 a^{7/2} d}-\frac {(A-i B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{(a-i b)^{3/2} d}-\frac {(A+i B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{(a+i b)^{3/2} d}+\frac {b \left (7 a^2 A b+15 A b^3-4 a^3 B-12 a b^2 B\right )}{4 a^3 \left (a^2+b^2\right ) d \sqrt {a+b \tan (c+d x)}}+\frac {(5 A b-4 a B) \cot (c+d x)}{4 a^2 d \sqrt {a+b \tan (c+d x)}}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}} \] Output:

1/4*(8*A*a^2-15*A*b^2+12*B*a*b)*arctanh((a+b*tan(d*x+c))^(1/2)/a^(1/2))/a^ 
(7/2)/d-(A-I*B)*arctanh((a+b*tan(d*x+c))^(1/2)/(a-I*b)^(1/2))/(a-I*b)^(3/2 
)/d-(A+I*B)*arctanh((a+b*tan(d*x+c))^(1/2)/(a+I*b)^(1/2))/(a+I*b)^(3/2)/d+ 
1/4*b*(7*A*a^2*b+15*A*b^3-4*B*a^3-12*B*a*b^2)/a^3/(a^2+b^2)/d/(a+b*tan(d*x 
+c))^(1/2)+1/4*(5*A*b-4*B*a)*cot(d*x+c)/a^2/d/(a+b*tan(d*x+c))^(1/2)-1/2*A 
*cot(d*x+c)^2/a/d/(a+b*tan(d*x+c))^(1/2)
 

Mathematica [A] (verified)

Time = 6.18 (sec) , antiderivative size = 409, normalized size of antiderivative = 1.44 \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {\frac {2 \left (\frac {\left (a^2+b^2\right ) \left (8 a^2 A-15 A b^2+12 a b B\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{4 \sqrt {a} d}+\frac {i \sqrt {a-i b} \left (a^3 (A b-a B)-i a^3 (a A+b B)\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{(-a+i b) d}-\frac {i \sqrt {a+i b} \left (a^3 (A b-a B)+i a^3 (a A+b B)\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{(-a-i b) d}\right )}{a \left (a^2+b^2\right )}+\frac {2 \left (\frac {1}{4} b^2 \left (-8 a^2 A+15 A b^2-12 a b B\right )-a \left (-2 a^2 b B-\frac {3}{4} a b (5 A b-4 a B)\right )\right )}{a \left (a^2+b^2\right ) d \sqrt {a+b \tan (c+d x)}}}{a}}{2 a} \] Input:

Integrate[(Cot[c + d*x]^3*(A + B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^(3/2) 
,x]
 

Output:

-1/2*(A*Cot[c + d*x]^2)/(a*d*Sqrt[a + b*Tan[c + d*x]]) - (-1/2*((5*A*b - 4 
*a*B)*Cot[c + d*x])/(a*d*Sqrt[a + b*Tan[c + d*x]]) - ((2*(((a^2 + b^2)*(8* 
a^2*A - 15*A*b^2 + 12*a*b*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/(4 
*Sqrt[a]*d) + (I*Sqrt[a - I*b]*(a^3*(A*b - a*B) - I*a^3*(a*A + b*B))*ArcTa 
nh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a - I*b]])/((-a + I*b)*d) - (I*Sqrt[a + I 
*b]*(a^3*(A*b - a*B) + I*a^3*(a*A + b*B))*ArcTanh[Sqrt[a + b*Tan[c + d*x]] 
/Sqrt[a + I*b]])/((-a - I*b)*d)))/(a*(a^2 + b^2)) + (2*((b^2*(-8*a^2*A + 1 
5*A*b^2 - 12*a*b*B))/4 - a*(-2*a^2*b*B - (3*a*b*(5*A*b - 4*a*B))/4)))/(a*( 
a^2 + b^2)*d*Sqrt[a + b*Tan[c + d*x]]))/a)/(2*a)
 

Rubi [A] (warning: unable to verify)

Time = 2.38 (sec) , antiderivative size = 324, normalized size of antiderivative = 1.14, number of steps used = 23, number of rules used = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 4092, 27, 3042, 4132, 27, 3042, 4132, 27, 3042, 4136, 27, 3042, 4022, 3042, 4020, 25, 73, 221, 4117, 73, 221}

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 {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A+B \tan (c+d x)}{\tan (c+d x)^3 (a+b \tan (c+d x))^{3/2}}dx\)

\(\Big \downarrow \) 4092

\(\displaystyle -\frac {\int \frac {\cot ^2(c+d x) \left (5 A b \tan ^2(c+d x)+4 a A \tan (c+d x)+5 A b-4 a B\right )}{2 (a+b \tan (c+d x))^{3/2}}dx}{2 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\int \frac {\cot ^2(c+d x) \left (5 A b \tan ^2(c+d x)+4 a A \tan (c+d x)+5 A b-4 a B\right )}{(a+b \tan (c+d x))^{3/2}}dx}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\int \frac {5 A b \tan (c+d x)^2+4 a A \tan (c+d x)+5 A b-4 a B}{\tan (c+d x)^2 (a+b \tan (c+d x))^{3/2}}dx}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 4132

\(\displaystyle -\frac {-\frac {\int -\frac {\cot (c+d x) \left (8 A a^2+8 B \tan (c+d x) a^2+12 b B a-15 A b^2-3 b (5 A b-4 a B) \tan ^2(c+d x)\right )}{2 (a+b \tan (c+d x))^{3/2}}dx}{a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\frac {\int \frac {\cot (c+d x) \left (8 A a^2+8 B \tan (c+d x) a^2+12 b B a-15 A b^2-3 b (5 A b-4 a B) \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^{3/2}}dx}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {\int \frac {8 A a^2+8 B \tan (c+d x) a^2+12 b B a-15 A b^2-3 b (5 A b-4 a B) \tan (c+d x)^2}{\tan (c+d x) (a+b \tan (c+d x))^{3/2}}dx}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 4132

\(\displaystyle -\frac {\frac {\frac {2 \int \frac {\cot (c+d x) \left (-8 (A b-a B) \tan (c+d x) a^3-b \left (-4 B a^3+7 A b a^2-12 b^2 B a+15 A b^3\right ) \tan ^2(c+d x)+\left (a^2+b^2\right ) \left (8 A a^2+12 b B a-15 A b^2\right )\right )}{2 \sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\frac {\frac {\int \frac {\cot (c+d x) \left (-8 (A b-a B) \tan (c+d x) a^3-b \left (-4 B a^3+7 A b a^2-12 b^2 B a+15 A b^3\right ) \tan ^2(c+d x)+\left (a^2+b^2\right ) \left (8 A a^2+12 b B a-15 A b^2\right )\right )}{\sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {\frac {\int \frac {-8 (A b-a B) \tan (c+d x) a^3-b \left (-4 B a^3+7 A b a^2-12 b^2 B a+15 A b^3\right ) \tan (c+d x)^2+\left (a^2+b^2\right ) \left (8 A a^2+12 b B a-15 A b^2\right )}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 4136

\(\displaystyle -\frac {\frac {\frac {\int -\frac {8 \left ((A b-a B) a^3+(a A+b B) \tan (c+d x) a^3\right )}{\sqrt {a+b \tan (c+d x)}}dx+\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\cot (c+d x) \left (\tan ^2(c+d x)+1\right )}{\sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\frac {\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\cot (c+d x) \left (\tan ^2(c+d x)+1\right )}{\sqrt {a+b \tan (c+d x)}}dx-8 \int \frac {(A b-a B) a^3+(a A+b B) \tan (c+d x) a^3}{\sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \int \frac {(A b-a B) a^3+(a A+b B) \tan (c+d x) a^3}{\sqrt {a+b \tan (c+d x)}}dx}{a \left (a^2+b^2\right )}-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}}{2 a}-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}}{4 a}-\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}\)

\(\Big \downarrow \) 4022

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (\frac {1}{2} a^3 (b+i a) (A+i B) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx-\frac {1}{2} a^3 (-b+i a) (A-i B) \int \frac {i \tan (c+d x)+1}{\sqrt {a+b \tan (c+d x)}}dx\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (\frac {1}{2} a^3 (b+i a) (A+i B) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx-\frac {1}{2} a^3 (-b+i a) (A-i B) \int \frac {i \tan (c+d x)+1}{\sqrt {a+b \tan (c+d x)}}dx\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 4020

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (-\frac {i a^3 (-b+i a) (A-i B) \int -\frac {1}{(1-i \tan (c+d x)) \sqrt {a+b \tan (c+d x)}}d(i \tan (c+d x))}{2 d}-\frac {i a^3 (b+i a) (A+i B) \int -\frac {1}{(i \tan (c+d x)+1) \sqrt {a+b \tan (c+d x)}}d(-i \tan (c+d x))}{2 d}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (\frac {i a^3 (-b+i a) (A-i B) \int \frac {1}{(1-i \tan (c+d x)) \sqrt {a+b \tan (c+d x)}}d(i \tan (c+d x))}{2 d}+\frac {i a^3 (b+i a) (A+i B) \int \frac {1}{(i \tan (c+d x)+1) \sqrt {a+b \tan (c+d x)}}d(-i \tan (c+d x))}{2 d}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (\frac {a^3 (b+i a) (A+i B) \int \frac {1}{-\frac {i \tan ^2(c+d x)}{b}-\frac {i a}{b}+1}d\sqrt {a+b \tan (c+d x)}}{b d}-\frac {a^3 (-b+i a) (A-i B) \int \frac {1}{\frac {i \tan ^2(c+d x)}{b}+\frac {i a}{b}+1}d\sqrt {a+b \tan (c+d x)}}{b d}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-8 \left (\frac {a^3 (b+i a) (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}-\frac {a^3 (-b+i a) (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d \sqrt {a-i b}}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 4117

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\frac {\left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {\cot (c+d x)}{\sqrt {a+b \tan (c+d x)}}d\tan (c+d x)}{d}-8 \left (\frac {a^3 (b+i a) (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}-\frac {a^3 (-b+i a) (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d \sqrt {a-i b}}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {\frac {2 \left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \int \frac {1}{\frac {a+b \tan (c+d x)}{b}-\frac {a}{b}}d\sqrt {a+b \tan (c+d x)}}{b d}-8 \left (\frac {a^3 (b+i a) (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}-\frac {a^3 (-b+i a) (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d \sqrt {a-i b}}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {A \cot ^2(c+d x)}{2 a d \sqrt {a+b \tan (c+d x)}}-\frac {-\frac {(5 A b-4 a B) \cot (c+d x)}{a d \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 b \left (-4 a^3 B+7 a^2 A b-12 a b^2 B+15 A b^3\right )}{a d \left (a^2+b^2\right ) \sqrt {a+b \tan (c+d x)}}+\frac {-\frac {2 \left (a^2+b^2\right ) \left (8 a^2 A+12 a b B-15 A b^2\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d}-8 \left (\frac {a^3 (b+i a) (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}-\frac {a^3 (-b+i a) (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d \sqrt {a-i b}}\right )}{a \left (a^2+b^2\right )}}{2 a}}{4 a}\)

Input:

Int[(Cot[c + d*x]^3*(A + B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^(3/2),x]
 

Output:

-1/2*(A*Cot[c + d*x]^2)/(a*d*Sqrt[a + b*Tan[c + d*x]]) - (-(((5*A*b - 4*a* 
B)*Cot[c + d*x])/(a*d*Sqrt[a + b*Tan[c + d*x]])) + ((-8*(-((a^3*(I*a - b)* 
(A - I*B)*ArcTan[Tan[c + d*x]/Sqrt[a - I*b]])/(Sqrt[a - I*b]*d)) + (a^3*(I 
*a + b)*(A + I*B)*ArcTan[Tan[c + d*x]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)) - 
 (2*(a^2 + b^2)*(8*a^2*A - 15*A*b^2 + 12*a*b*B)*ArcTanh[Sqrt[a + b*Tan[c + 
 d*x]]/Sqrt[a]])/(Sqrt[a]*d))/(a*(a^2 + b^2)) - (2*b*(7*a^2*A*b + 15*A*b^3 
 - 4*a^3*B - 12*a*b^2*B))/(a*(a^2 + b^2)*d*Sqrt[a + b*Tan[c + d*x]]))/(2*a 
))/(4*a)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4020
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f)   Subst[Int[(a + (b/d)*x)^m/(d^2 + 
c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ 
b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
 

rule 4022
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2   Int[(a + b*Tan[e + f*x])^m*( 
1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2   Int[(a + b*Tan[e + f*x])^m 
*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c 
 - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]
 

rule 4092
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si 
mp[b*(A*b - a*B)*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1) 
/(f*(m + 1)*(b*c - a*d)*(a^2 + b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^ 
2 + b^2))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[b* 
B*(b*c*(m + 1) + a*d*(n + 1)) + A*(a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2 
)) - (A*b - a*B)*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b*d*(A*b - a*B)*(m + n 
+ 2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && 
 NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m, -1] 
&& (IntegerQ[m] || IntegersQ[2*m, 2*n]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] 
 || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4117
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) 
+ (f_.)*(x_)])^(n_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> 
 Simp[A/f   Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x] /; 
FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]
 

rule 4132
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) 
 + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b^2 - a*(b*B - a*C))*(a + b*Tan[e + 
 f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(b*c - a*d)*(a^2 + 
b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 + b^2))   Int[(a + b*Tan[e + 
f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(a*(b*c - a*d)*(m + 1) - b^2*d* 
(m + n + 2)) + (b*B - a*C)*(b*c*(m + 1) + a*d*(n + 1)) - (m + 1)*(b*c - a*d 
)*(A*b - a*B - b*C)*Tan[e + f*x] - d*(A*b^2 - a*(b*B - a*C))*(m + n + 2)*Ta 
n[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ 
[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m, -1] && 
!(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4136
Int[(((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2))/((a_.) + (b_.)*tan[(e_.) 
+ (f_.)*(x_)]), x_Symbol] :> Simp[1/(a^2 + b^2)   Int[(c + d*Tan[e + f*x])^ 
n*Simp[b*B + a*(A - C) + (a*B - b*(A - C))*Tan[e + f*x], x], x], x] + Simp[ 
(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2)   Int[(c + d*Tan[e + f*x])^n*((1 + Tan[ 
e + f*x]^2)/(a + b*Tan[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, 
 C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] & 
&  !GtQ[n, 0] &&  !LeQ[n, -1]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(8163\) vs. \(2(247)=494\).

Time = 0.17 (sec) , antiderivative size = 8164, normalized size of antiderivative = 28.65

method result size
derivativedivides \(\text {Expression too large to display}\) \(8164\)
default \(\text {Expression too large to display}\) \(8164\)

Input:

int(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x,method=_RETURNV 
ERBOSE)
 

Output:

result too large to display
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 4598 vs. \(2 (241) = 482\).

Time = 40.93 (sec) , antiderivative size = 9216, normalized size of antiderivative = 32.34 \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\text {Too large to display} \] Input:

integrate(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x, algorith 
m="fricas")
 

Output:

Too large to include
 

Sympy [F]

\[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\int \frac {\left (A + B \tan {\left (c + d x \right )}\right ) \cot ^{3}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{\frac {3}{2}}}\, dx \] Input:

integrate(cot(d*x+c)**3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))**(3/2),x)
 

Output:

Integral((A + B*tan(c + d*x))*cot(c + d*x)**3/(a + b*tan(c + d*x))**(3/2), 
 x)
 

Maxima [F(-1)]

Timed out. \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\text {Timed out} \] Input:

integrate(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x, algorith 
m="maxima")
 

Output:

Timed out
 

Giac [F(-2)]

Exception generated. \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\text {Exception raised: TypeError} \] Input:

integrate(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x, algorith 
m="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro 
unding error%%%{%%%{-1,[6,21,6]%%%}+%%%{-10,[6,19,6]%%%}+%%%{-45,[6,17,6]% 
%%}+%%%{-
 

Mupad [B] (verification not implemented)

Time = 7.91 (sec) , antiderivative size = 42371, normalized size of antiderivative = 148.67 \[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\text {Too large to display} \] Input:

int((cot(c + d*x)^3*(A + B*tan(c + d*x)))/(a + b*tan(c + d*x))^(3/2),x)
 

Output:

((2*(A*b^4 - B*a*b^3))/(a*(a^2 + b^2)) + ((a + b*tan(c + d*x))^2*(15*A*b^4 
 + 7*A*a^2*b^2 - 12*B*a*b^3 - 4*B*a^3*b))/(4*a^3*(a^2 + b^2)) - ((a + b*ta 
n(c + d*x))*(25*A*b^4 + 9*A*a^2*b^2 - 20*B*a*b^3 - 4*B*a^3*b))/(4*a^2*(a^2 
 + b^2)))/(d*(a + b*tan(c + d*x))^(5/2) - 2*a*d*(a + b*tan(c + d*x))^(3/2) 
 + a^2*d*(a + b*tan(c + d*x))^(1/2)) + atan((((a + b*tan(c + d*x))^(1/2)*( 
704643072*A^4*a^29*b^20*d^5 - 290979840*A^4*a^23*b^26*d^5 - 465043456*A^4* 
a^25*b^24*d^5 - 37224448*A^4*a^27*b^22*d^5 - 58982400*A^4*a^21*b^28*d^5 + 
767033344*A^4*a^31*b^18*d^5 + 238551040*A^4*a^33*b^16*d^5 + 1572864*A^4*a^ 
35*b^14*d^5 + 92536832*A^4*a^37*b^12*d^5 + 96468992*A^4*a^39*b^10*d^5 + 25 
165824*A^4*a^41*b^8*d^5 + 37748736*B^4*a^23*b^26*d^5 + 226492416*B^4*a^25* 
b^24*d^5 + 536870912*B^4*a^27*b^22*d^5 + 587202560*B^4*a^29*b^20*d^5 + 176 
160768*B^4*a^31*b^18*d^5 - 234881024*B^4*a^33*b^16*d^5 - 234881024*B^4*a^3 
5*b^14*d^5 - 50331648*B^4*a^37*b^12*d^5 + 20971520*B^4*a^39*b^10*d^5 + 838 
8608*B^4*a^41*b^8*d^5 - 94371840*A*B^3*a^22*b^27*d^5 - 364904448*A*B^3*a^2 
4*b^25*d^5 + 37748736*A*B^3*a^26*b^23*d^5 + 2554331136*A*B^3*a^28*b^21*d^5 
 + 5989466112*A*B^3*a^30*b^19*d^5 + 6606028800*A*B^3*a^32*b^17*d^5 + 37874 
56512*A*B^3*a^34*b^15*d^5 + 918552576*A*B^3*a^36*b^13*d^5 - 56623104*A*B^3 
*a^38*b^11*d^5 - 50331648*A*B^3*a^40*b^9*d^5 + 330301440*A^3*B*a^22*b^27*d 
^5 + 1915748352*A^3*B*a^24*b^25*d^5 + 4279238656*A^3*B*a^26*b^23*d^5 + 405 
9037696*A^3*B*a^28*b^21*d^5 + 154140672*A^3*B*a^30*b^19*d^5 - 282591232...
 

Reduce [F]

\[ \int \frac {\cot ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx=\int \frac {\cot \left (d x +c \right )^{3} \left (A +B \tan \left (d x +c \right )\right )}{\left (a +\tan \left (d x +c \right ) b \right )^{\frac {3}{2}}}d x \] Input:

int(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x)
 

Output:

int(cot(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(3/2),x)