\(\int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx\) [102]

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

Optimal result

Integrand size = 21, antiderivative size = 177 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {x}{a^3}+\frac {\cot (c+d x)}{a^3 d}-\frac {\cot ^3(c+d x)}{3 a^3 d}+\frac {\cot ^5(c+d x)}{5 a^3 d}-\frac {\cot ^7(c+d x)}{7 a^3 d}+\frac {4 \cot ^9(c+d x)}{9 a^3 d}-\frac {3 \csc (c+d x)}{a^3 d}+\frac {13 \csc ^3(c+d x)}{3 a^3 d}-\frac {21 \csc ^5(c+d x)}{5 a^3 d}+\frac {15 \csc ^7(c+d x)}{7 a^3 d}-\frac {4 \csc ^9(c+d x)}{9 a^3 d} \] Output:

x/a^3+cot(d*x+c)/a^3/d-1/3*cot(d*x+c)^3/a^3/d+1/5*cot(d*x+c)^5/a^3/d-1/7*c 
ot(d*x+c)^7/a^3/d+4/9*cot(d*x+c)^9/a^3/d-3*csc(d*x+c)/a^3/d+13/3*csc(d*x+c 
)^3/a^3/d-21/5*csc(d*x+c)^5/a^3/d+15/7*csc(d*x+c)^7/a^3/d-4/9*csc(d*x+c)^9 
/a^3/d
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(366\) vs. \(2(177)=354\).

Time = 1.62 (sec) , antiderivative size = 366, normalized size of antiderivative = 2.07 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {\csc \left (\frac {c}{2}\right ) \csc ^3(2 (c+d x)) \sec \left (\frac {c}{2}\right ) (181440 d x \cos (d x)-181440 d x \cos (2 c+d x)+136080 d x \cos (c+2 d x)-136080 d x \cos (3 c+2 d x)-10080 d x \cos (2 c+3 d x)+10080 d x \cos (4 c+3 d x)-60480 d x \cos (3 c+4 d x)+60480 d x \cos (5 c+4 d x)-30240 d x \cos (4 c+5 d x)+30240 d x \cos (6 c+5 d x)-5040 d x \cos (5 c+6 d x)+5040 d x \cos (7 c+6 d x)-169344 \sin (c)-338112 \sin (d x)+675036 \sin (c+d x)+506277 \sin (2 (c+d x))-37502 \sin (3 (c+d x))-225012 \sin (4 (c+d x))-112506 \sin (5 (c+d x))-18751 \sin (6 (c+d x))-431424 \sin (2 c+d x)-375552 \sin (c+2 d x)-201600 \sin (3 c+2 d x)-41248 \sin (2 c+3 d x)+84000 \sin (4 c+3 d x)+155712 \sin (3 c+4 d x)+100800 \sin (5 c+4 d x)+98016 \sin (4 c+5 d x)+30240 \sin (6 c+5 d x)+21376 \sin (5 c+6 d x))}{80640 a^3 d (1+\sec (c+d x))^3} \] Input:

Integrate[Cot[c + d*x]^4/(a + a*Sec[c + d*x])^3,x]
 

Output:

(Csc[c/2]*Csc[2*(c + d*x)]^3*Sec[c/2]*(181440*d*x*Cos[d*x] - 181440*d*x*Co 
s[2*c + d*x] + 136080*d*x*Cos[c + 2*d*x] - 136080*d*x*Cos[3*c + 2*d*x] - 1 
0080*d*x*Cos[2*c + 3*d*x] + 10080*d*x*Cos[4*c + 3*d*x] - 60480*d*x*Cos[3*c 
 + 4*d*x] + 60480*d*x*Cos[5*c + 4*d*x] - 30240*d*x*Cos[4*c + 5*d*x] + 3024 
0*d*x*Cos[6*c + 5*d*x] - 5040*d*x*Cos[5*c + 6*d*x] + 5040*d*x*Cos[7*c + 6* 
d*x] - 169344*Sin[c] - 338112*Sin[d*x] + 675036*Sin[c + d*x] + 506277*Sin[ 
2*(c + d*x)] - 37502*Sin[3*(c + d*x)] - 225012*Sin[4*(c + d*x)] - 112506*S 
in[5*(c + d*x)] - 18751*Sin[6*(c + d*x)] - 431424*Sin[2*c + d*x] - 375552* 
Sin[c + 2*d*x] - 201600*Sin[3*c + 2*d*x] - 41248*Sin[2*c + 3*d*x] + 84000* 
Sin[4*c + 3*d*x] + 155712*Sin[3*c + 4*d*x] + 100800*Sin[5*c + 4*d*x] + 980 
16*Sin[4*c + 5*d*x] + 30240*Sin[6*c + 5*d*x] + 21376*Sin[5*c + 6*d*x]))/(8 
0640*a^3*d*(1 + Sec[c + d*x])^3)
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.04, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4376, 25, 3042, 4374, 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 {\cot ^4(c+d x)}{(a \sec (c+d x)+a)^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\cot \left (c+d x+\frac {\pi }{2}\right )^4 \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^3}dx\)

\(\Big \downarrow \) 4376

\(\displaystyle \frac {\int -\cot ^{10}(c+d x) (a-a \sec (c+d x))^3dx}{a^6}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\int \cot ^{10}(c+d x) (a-a \sec (c+d x))^3dx}{a^6}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\int \frac {\left (a-a \csc \left (c+d x+\frac {\pi }{2}\right )\right )^3}{\cot \left (c+d x+\frac {\pi }{2}\right )^{10}}dx}{a^6}\)

\(\Big \downarrow \) 4374

\(\displaystyle -\frac {\int \left (a^3 \cot ^{10}(c+d x)-3 a^3 \csc (c+d x) \cot ^9(c+d x)+3 a^3 \csc ^2(c+d x) \cot ^8(c+d x)-a^3 \csc ^3(c+d x) \cot ^7(c+d x)\right )dx}{a^6}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-\frac {4 a^3 \cot ^9(c+d x)}{9 d}+\frac {a^3 \cot ^7(c+d x)}{7 d}-\frac {a^3 \cot ^5(c+d x)}{5 d}+\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {4 a^3 \csc ^9(c+d x)}{9 d}-\frac {15 a^3 \csc ^7(c+d x)}{7 d}+\frac {21 a^3 \csc ^5(c+d x)}{5 d}-\frac {13 a^3 \csc ^3(c+d x)}{3 d}+\frac {3 a^3 \csc (c+d x)}{d}-a^3 x}{a^6}\)

Input:

Int[Cot[c + d*x]^4/(a + a*Sec[c + d*x])^3,x]
 

Output:

-((-(a^3*x) - (a^3*Cot[c + d*x])/d + (a^3*Cot[c + d*x]^3)/(3*d) - (a^3*Cot 
[c + d*x]^5)/(5*d) + (a^3*Cot[c + d*x]^7)/(7*d) - (4*a^3*Cot[c + d*x]^9)/( 
9*d) + (3*a^3*Csc[c + d*x])/d - (13*a^3*Csc[c + d*x]^3)/(3*d) + (21*a^3*Cs 
c[c + d*x]^5)/(5*d) - (15*a^3*Csc[c + d*x]^7)/(7*d) + (4*a^3*Csc[c + d*x]^ 
9)/(9*d))/a^6)
 

Defintions of rubi rules used

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

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

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

rule 4374
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ 
c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
 

rule 4376
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_))^(n_), x_Symbol] :> Simp[a^(2*n)/e^(2*n)   Int[(e*Cot[c + d*x])^(m + 2* 
n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[a 
^2 - b^2, 0] && ILtQ[n, 0]
 
Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.63

method result size
derivativedivides \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{9}+\frac {8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{7}-\frac {29 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-99 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+128 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {8}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{64 d \,a^{3}}\) \(111\)
default \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{9}+\frac {8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{7}-\frac {29 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-99 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+128 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {8}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{64 d \,a^{3}}\) \(111\)
risch \(\frac {x}{a^{3}}-\frac {2 i \left (945 \,{\mathrm e}^{11 i \left (d x +c \right )}+3150 \,{\mathrm e}^{10 i \left (d x +c \right )}+2625 \,{\mathrm e}^{9 i \left (d x +c \right )}-6300 \,{\mathrm e}^{8 i \left (d x +c \right )}-13482 \,{\mathrm e}^{7 i \left (d x +c \right )}-5292 \,{\mathrm e}^{6 i \left (d x +c \right )}+10566 \,{\mathrm e}^{5 i \left (d x +c \right )}+11736 \,{\mathrm e}^{4 i \left (d x +c \right )}+1289 \,{\mathrm e}^{3 i \left (d x +c \right )}-4866 \,{\mathrm e}^{2 i \left (d x +c \right )}-3063 \,{\mathrm e}^{i \left (d x +c \right )}-668\right )}{315 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{9} \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )^{3}}\) \(165\)

Input:

int(cot(d*x+c)^4/(a+a*sec(d*x+c))^3,x,method=_RETURNVERBOSE)
 

Output:

1/64/d/a^3*(-1/9*tan(1/2*d*x+1/2*c)^9+8/7*tan(1/2*d*x+1/2*c)^7-29/5*tan(1/ 
2*d*x+1/2*c)^5+64/3*tan(1/2*d*x+1/2*c)^3-99*tan(1/2*d*x+1/2*c)+128*arctan( 
tan(1/2*d*x+1/2*c))-1/3/tan(1/2*d*x+1/2*c)^3+8/tan(1/2*d*x+1/2*c))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 216, normalized size of antiderivative = 1.22 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {668 \, \cos \left (d x + c\right )^{6} + 1059 \, \cos \left (d x + c\right )^{5} - 573 \, \cos \left (d x + c\right )^{4} - 1813 \, \cos \left (d x + c\right )^{3} - 393 \, \cos \left (d x + c\right )^{2} + 315 \, {\left (d x \cos \left (d x + c\right )^{5} + 3 \, d x \cos \left (d x + c\right )^{4} + 2 \, d x \cos \left (d x + c\right )^{3} - 2 \, d x \cos \left (d x + c\right )^{2} - 3 \, d x \cos \left (d x + c\right ) - d x\right )} \sin \left (d x + c\right ) + 789 \, \cos \left (d x + c\right ) + 368}{315 \, {\left (a^{3} d \cos \left (d x + c\right )^{5} + 3 \, a^{3} d \cos \left (d x + c\right )^{4} + 2 \, a^{3} d \cos \left (d x + c\right )^{3} - 2 \, a^{3} d \cos \left (d x + c\right )^{2} - 3 \, a^{3} d \cos \left (d x + c\right ) - a^{3} d\right )} \sin \left (d x + c\right )} \] Input:

integrate(cot(d*x+c)^4/(a+a*sec(d*x+c))^3,x, algorithm="fricas")
 

Output:

1/315*(668*cos(d*x + c)^6 + 1059*cos(d*x + c)^5 - 573*cos(d*x + c)^4 - 181 
3*cos(d*x + c)^3 - 393*cos(d*x + c)^2 + 315*(d*x*cos(d*x + c)^5 + 3*d*x*co 
s(d*x + c)^4 + 2*d*x*cos(d*x + c)^3 - 2*d*x*cos(d*x + c)^2 - 3*d*x*cos(d*x 
 + c) - d*x)*sin(d*x + c) + 789*cos(d*x + c) + 368)/((a^3*d*cos(d*x + c)^5 
 + 3*a^3*d*cos(d*x + c)^4 + 2*a^3*d*cos(d*x + c)^3 - 2*a^3*d*cos(d*x + c)^ 
2 - 3*a^3*d*cos(d*x + c) - a^3*d)*sin(d*x + c))
                                                                                    
                                                                                    
 

Sympy [F]

\[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {\int \frac {\cot ^{4}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \] Input:

integrate(cot(d*x+c)**4/(a+a*sec(d*x+c))**3,x)
 

Output:

Integral(cot(c + d*x)**4/(sec(c + d*x)**3 + 3*sec(c + d*x)**2 + 3*sec(c + 
d*x) + 1), x)/a**3
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.00 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=-\frac {\frac {\frac {31185 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6720 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {1827 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {360 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {35 \, \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}}}{a^{3}} - \frac {40320 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}} - \frac {105 \, {\left (\frac {24 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a^{3} \sin \left (d x + c\right )^{3}}}{20160 \, d} \] Input:

integrate(cot(d*x+c)^4/(a+a*sec(d*x+c))^3,x, algorithm="maxima")
 

Output:

-1/20160*((31185*sin(d*x + c)/(cos(d*x + c) + 1) - 6720*sin(d*x + c)^3/(co 
s(d*x + c) + 1)^3 + 1827*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - 360*sin(d*x 
 + c)^7/(cos(d*x + c) + 1)^7 + 35*sin(d*x + c)^9/(cos(d*x + c) + 1)^9)/a^3 
 - 40320*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^3 - 105*(24*sin(d*x + c 
)^2/(cos(d*x + c) + 1)^2 - 1)*(cos(d*x + c) + 1)^3/(a^3*sin(d*x + c)^3))/d
 

Giac [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.74 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {\frac {20160 \, {\left (d x + c\right )}}{a^{3}} + \frac {105 \, {\left (24 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}}{a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} - \frac {35 \, a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 360 \, a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 1827 \, a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6720 \, a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 31185 \, a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{27}}}{20160 \, d} \] Input:

integrate(cot(d*x+c)^4/(a+a*sec(d*x+c))^3,x, algorithm="giac")
 

Output:

1/20160*(20160*(d*x + c)/a^3 + 105*(24*tan(1/2*d*x + 1/2*c)^2 - 1)/(a^3*ta 
n(1/2*d*x + 1/2*c)^3) - (35*a^24*tan(1/2*d*x + 1/2*c)^9 - 360*a^24*tan(1/2 
*d*x + 1/2*c)^7 + 1827*a^24*tan(1/2*d*x + 1/2*c)^5 - 6720*a^24*tan(1/2*d*x 
 + 1/2*c)^3 + 31185*a^24*tan(1/2*d*x + 1/2*c))/a^27)/d
 

Mupad [B] (verification not implemented)

Time = 12.82 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.16 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (c+d\,x\right )-{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (c+d\,x\right )}{a^3\,d\,\left ({\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\right )}-\frac {\frac {668\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{315}-\frac {983\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{210}+\frac {346\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{105}-\frac {2291\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{2520}+\frac {173\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{840}-\frac {19\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{672}+\frac {1}{576}}{a^3\,d\,\left ({\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \] Input:

int(cot(c + d*x)^4/(a + a/cos(c + d*x))^3,x)
 

Output:

(cos(c/2 + (d*x)/2)^9*(c + d*x) - cos(c/2 + (d*x)/2)^11*(c + d*x))/(a^3*d* 
(cos(c/2 + (d*x)/2)^9 - cos(c/2 + (d*x)/2)^11)) - ((173*cos(c/2 + (d*x)/2) 
^4)/840 - (19*cos(c/2 + (d*x)/2)^2)/672 - (2291*cos(c/2 + (d*x)/2)^6)/2520 
 + (346*cos(c/2 + (d*x)/2)^8)/105 - (983*cos(c/2 + (d*x)/2)^10)/210 + (668 
*cos(c/2 + (d*x)/2)^12)/315 + 1/576)/(a^3*d*(cos(c/2 + (d*x)/2)^9*sin(c/2 
+ (d*x)/2) - cos(c/2 + (d*x)/2)^11*sin(c/2 + (d*x)/2)))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.64 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {-35 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+360 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}-1827 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+6720 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-31185 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+20160 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} d x +2520 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-105}{20160 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a^{3} d} \] Input:

int(cot(d*x+c)^4/(a+a*sec(d*x+c))^3,x)
 

Output:

( - 35*tan((c + d*x)/2)**12 + 360*tan((c + d*x)/2)**10 - 1827*tan((c + d*x 
)/2)**8 + 6720*tan((c + d*x)/2)**6 - 31185*tan((c + d*x)/2)**4 + 20160*tan 
((c + d*x)/2)**3*d*x + 2520*tan((c + d*x)/2)**2 - 105)/(20160*tan((c + d*x 
)/2)**3*a**3*d)