\(\int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx\) [89]

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

Optimal result

Integrand size = 24, antiderivative size = 233 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {a^8 x}{256}-\frac {i a^{16}}{16 d (a-i a \tan (c+d x))^8}-\frac {i a^{15}}{28 d (a-i a \tan (c+d x))^7}-\frac {i a^{14}}{48 d (a-i a \tan (c+d x))^6}-\frac {i a^{13}}{80 d (a-i a \tan (c+d x))^5}-\frac {i a^{12}}{128 d (a-i a \tan (c+d x))^4}-\frac {i a^{10}}{256 d (a-i a \tan (c+d x))^2}-\frac {i a^{17}}{192 d \left (a^3-i a^3 \tan (c+d x)\right )^3}-\frac {i a^{17}}{256 d \left (a^9-i a^9 \tan (c+d x)\right )} \] Output:

1/256*a^8*x-1/16*I*a^16/d/(a-I*a*tan(d*x+c))^8-1/28*I*a^15/d/(a-I*a*tan(d* 
x+c))^7-1/48*I*a^14/d/(a-I*a*tan(d*x+c))^6-1/80*I*a^13/d/(a-I*a*tan(d*x+c) 
)^5-1/128*I*a^12/d/(a-I*a*tan(d*x+c))^4-1/256*I*a^10/d/(a-I*a*tan(d*x+c))^ 
2-1/192*I*a^17/d/(a^3-I*a^3*tan(d*x+c))^3-1/256*I*a^17/d/(a^9-I*a^9*tan(d* 
x+c))
 

Mathematica [A] (verified)

Time = 0.90 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.65 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=-\frac {i a^8 \sec ^8(c+d x) (7350+12544 \cos (2 (c+d x))+7840 \cos (4 (c+d x))+3840 \cos (6 (c+d x))+1194 \cos (8 (c+d x))-3136 i \sin (2 (c+d x))-3920 i \sin (4 (c+d x))-2880 i \sin (6 (c+d x))-1089 i \sin (8 (c+d x))+840 \arctan (\tan (c+d x)) (i \cos (8 (c+d x))+\sin (8 (c+d x))))}{215040 d (i+\tan (c+d x))^8} \] Input:

Integrate[Cos[c + d*x]^16*(a + I*a*Tan[c + d*x])^8,x]
 

Output:

((-1/215040*I)*a^8*Sec[c + d*x]^8*(7350 + 12544*Cos[2*(c + d*x)] + 7840*Co 
s[4*(c + d*x)] + 3840*Cos[6*(c + d*x)] + 1194*Cos[8*(c + d*x)] - (3136*I)* 
Sin[2*(c + d*x)] - (3920*I)*Sin[4*(c + d*x)] - (2880*I)*Sin[6*(c + d*x)] - 
 (1089*I)*Sin[8*(c + d*x)] + 840*ArcTan[Tan[c + d*x]]*(I*Cos[8*(c + d*x)] 
+ Sin[8*(c + d*x)])))/(d*(I + Tan[c + d*x])^8)
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 203, normalized size of antiderivative = 0.87, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 3968, 54, 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 \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+i a \tan (c+d x))^8}{\sec (c+d x)^{16}}dx\)

\(\Big \downarrow \) 3968

\(\displaystyle -\frac {i a^{17} \int \frac {1}{(a-i a \tan (c+d x))^9 (i \tan (c+d x) a+a)}d(i a \tan (c+d x))}{d}\)

\(\Big \downarrow \) 54

\(\displaystyle -\frac {i a^{17} \int \left (\frac {1}{2 (a-i a \tan (c+d x))^9 a}+\frac {1}{4 (a-i a \tan (c+d x))^8 a^2}+\frac {1}{8 (a-i a \tan (c+d x))^7 a^3}+\frac {1}{16 (a-i a \tan (c+d x))^6 a^4}+\frac {1}{32 (a-i a \tan (c+d x))^5 a^5}+\frac {1}{64 (a-i a \tan (c+d x))^4 a^6}+\frac {1}{128 (a-i a \tan (c+d x))^3 a^7}+\frac {1}{256 \left (\tan ^2(c+d x) a^2+a^2\right ) a^8}+\frac {1}{256 (a-i a \tan (c+d x))^2 a^8}\right )d(i a \tan (c+d x))}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {i a^{17} \left (\frac {i \arctan (\tan (c+d x))}{256 a^9}+\frac {1}{256 a^8 (a-i a \tan (c+d x))}+\frac {1}{256 a^7 (a-i a \tan (c+d x))^2}+\frac {1}{192 a^6 (a-i a \tan (c+d x))^3}+\frac {1}{128 a^5 (a-i a \tan (c+d x))^4}+\frac {1}{80 a^4 (a-i a \tan (c+d x))^5}+\frac {1}{48 a^3 (a-i a \tan (c+d x))^6}+\frac {1}{28 a^2 (a-i a \tan (c+d x))^7}+\frac {1}{16 a (a-i a \tan (c+d x))^8}\right )}{d}\)

Input:

Int[Cos[c + d*x]^16*(a + I*a*Tan[c + d*x])^8,x]
 

Output:

((-I)*a^17*(((I/256)*ArcTan[Tan[c + d*x]])/a^9 + 1/(16*a*(a - I*a*Tan[c + 
d*x])^8) + 1/(28*a^2*(a - I*a*Tan[c + d*x])^7) + 1/(48*a^3*(a - I*a*Tan[c 
+ d*x])^6) + 1/(80*a^4*(a - I*a*Tan[c + d*x])^5) + 1/(128*a^5*(a - I*a*Tan 
[c + d*x])^4) + 1/(192*a^6*(a - I*a*Tan[c + d*x])^3) + 1/(256*a^7*(a - I*a 
*Tan[c + d*x])^2) + 1/(256*a^8*(a - I*a*Tan[c + d*x]))))/d
 

Defintions of rubi rules used

rule 54
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[E 
xpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && 
 ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && LtQ[m + n + 2, 0])
 

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 3968
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[1/(a^(m - 2)*b*f)   Subst[Int[(a - x)^(m/2 - 1)*(a + x 
)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && 
 EqQ[a^2 + b^2, 0] && IntegerQ[m/2]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 738 vs. \(2 (199 ) = 398\).

Time = 0.84 (sec) , antiderivative size = 739, normalized size of antiderivative = 3.17

\[\text {Expression too large to display}\]

Input:

int(cos(d*x+c)^16*(a+I*a*tan(d*x+c))^8,x)
 

Output:

1/d*(a^8*(-1/16*sin(d*x+c)^7*cos(d*x+c)^9-1/32*sin(d*x+c)^5*cos(d*x+c)^9-5 
/384*sin(d*x+c)^3*cos(d*x+c)^9-1/256*sin(d*x+c)*cos(d*x+c)^9+1/2048*(cos(d 
*x+c)^7+7/6*cos(d*x+c)^5+35/24*cos(d*x+c)^3+35/16*cos(d*x+c))*sin(d*x+c)+3 
5/32768*d*x+35/32768*c)-8*I*a^8*(-1/16*cos(d*x+c)^10*sin(d*x+c)^6-3/112*co 
s(d*x+c)^10*sin(d*x+c)^4-1/112*cos(d*x+c)^10*sin(d*x+c)^2-1/560*cos(d*x+c) 
^10)-28*a^8*(-1/16*sin(d*x+c)^5*cos(d*x+c)^11-5/224*sin(d*x+c)^3*cos(d*x+c 
)^11-5/896*sin(d*x+c)*cos(d*x+c)^11+1/1792*(cos(d*x+c)^9+9/8*cos(d*x+c)^7+ 
21/16*cos(d*x+c)^5+105/64*cos(d*x+c)^3+315/128*cos(d*x+c))*sin(d*x+c)+45/3 
2768*d*x+45/32768*c)-1/2*I*a^8*cos(d*x+c)^16+70*a^8*(-1/16*sin(d*x+c)^3*co 
s(d*x+c)^13-3/224*sin(d*x+c)*cos(d*x+c)^13+1/896*(cos(d*x+c)^11+11/10*cos( 
d*x+c)^9+99/80*cos(d*x+c)^7+231/160*cos(d*x+c)^5+231/128*cos(d*x+c)^3+693/ 
256*cos(d*x+c))*sin(d*x+c)+99/32768*d*x+99/32768*c)-56*I*a^8*(-1/16*cos(d* 
x+c)^14*sin(d*x+c)^2-1/112*cos(d*x+c)^14)-28*a^8*(-1/16*sin(d*x+c)*cos(d*x 
+c)^15+1/224*(cos(d*x+c)^13+13/12*cos(d*x+c)^11+143/120*cos(d*x+c)^9+429/3 
20*cos(d*x+c)^7+1001/640*cos(d*x+c)^5+1001/512*cos(d*x+c)^3+3003/1024*cos( 
d*x+c))*sin(d*x+c)+429/32768*d*x+429/32768*c)+56*I*a^8*(-1/16*cos(d*x+c)^1 
2*sin(d*x+c)^4-1/56*cos(d*x+c)^12*sin(d*x+c)^2-1/336*cos(d*x+c)^12)+a^8*(1 
/16*(cos(d*x+c)^15+15/14*cos(d*x+c)^13+65/56*cos(d*x+c)^11+143/112*cos(d*x 
+c)^9+1287/896*cos(d*x+c)^7+429/256*cos(d*x+c)^5+2145/1024*cos(d*x+c)^3+64 
35/2048*cos(d*x+c))*sin(d*x+c)+6435/32768*d*x+6435/32768*c))
 

Fricas [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 125, normalized size of antiderivative = 0.54 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {1680 \, a^{8} d x - 105 i \, a^{8} e^{\left (16 i \, d x + 16 i \, c\right )} - 960 i \, a^{8} e^{\left (14 i \, d x + 14 i \, c\right )} - 3920 i \, a^{8} e^{\left (12 i \, d x + 12 i \, c\right )} - 9408 i \, a^{8} e^{\left (10 i \, d x + 10 i \, c\right )} - 14700 i \, a^{8} e^{\left (8 i \, d x + 8 i \, c\right )} - 15680 i \, a^{8} e^{\left (6 i \, d x + 6 i \, c\right )} - 11760 i \, a^{8} e^{\left (4 i \, d x + 4 i \, c\right )} - 6720 i \, a^{8} e^{\left (2 i \, d x + 2 i \, c\right )}}{430080 \, d} \] Input:

integrate(cos(d*x+c)^16*(a+I*a*tan(d*x+c))^8,x, algorithm="fricas")
 

Output:

1/430080*(1680*a^8*d*x - 105*I*a^8*e^(16*I*d*x + 16*I*c) - 960*I*a^8*e^(14 
*I*d*x + 14*I*c) - 3920*I*a^8*e^(12*I*d*x + 12*I*c) - 9408*I*a^8*e^(10*I*d 
*x + 10*I*c) - 14700*I*a^8*e^(8*I*d*x + 8*I*c) - 15680*I*a^8*e^(6*I*d*x + 
6*I*c) - 11760*I*a^8*e^(4*I*d*x + 4*I*c) - 6720*I*a^8*e^(2*I*d*x + 2*I*c)) 
/d
 

Sympy [A] (verification not implemented)

Time = 0.70 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.39 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {a^{8} x}{256} + \begin {cases} \frac {- 354658470655426560 i a^{8} d^{7} e^{16 i c} e^{16 i d x} - 3242591731706757120 i a^{8} d^{7} e^{14 i c} e^{14 i d x} - 13240582904469258240 i a^{8} d^{7} e^{12 i c} e^{12 i d x} - 31777398970726219776 i a^{8} d^{7} e^{10 i c} e^{10 i d x} - 49652185891759718400 i a^{8} d^{7} e^{8 i c} e^{8 i d x} - 52962331617877032960 i a^{8} d^{7} e^{6 i c} e^{6 i d x} - 39721748713407774720 i a^{8} d^{7} e^{4 i c} e^{4 i d x} - 22698142121947299840 i a^{8} d^{7} e^{2 i c} e^{2 i d x}}{1452681095804627189760 d^{8}} & \text {for}\: d^{8} \neq 0 \\x \left (\frac {a^{8} e^{16 i c}}{256} + \frac {a^{8} e^{14 i c}}{32} + \frac {7 a^{8} e^{12 i c}}{64} + \frac {7 a^{8} e^{10 i c}}{32} + \frac {35 a^{8} e^{8 i c}}{128} + \frac {7 a^{8} e^{6 i c}}{32} + \frac {7 a^{8} e^{4 i c}}{64} + \frac {a^{8} e^{2 i c}}{32}\right ) & \text {otherwise} \end {cases} \] Input:

integrate(cos(d*x+c)**16*(a+I*a*tan(d*x+c))**8,x)
 

Output:

a**8*x/256 + Piecewise(((-354658470655426560*I*a**8*d**7*exp(16*I*c)*exp(1 
6*I*d*x) - 3242591731706757120*I*a**8*d**7*exp(14*I*c)*exp(14*I*d*x) - 132 
40582904469258240*I*a**8*d**7*exp(12*I*c)*exp(12*I*d*x) - 3177739897072621 
9776*I*a**8*d**7*exp(10*I*c)*exp(10*I*d*x) - 49652185891759718400*I*a**8*d 
**7*exp(8*I*c)*exp(8*I*d*x) - 52962331617877032960*I*a**8*d**7*exp(6*I*c)* 
exp(6*I*d*x) - 39721748713407774720*I*a**8*d**7*exp(4*I*c)*exp(4*I*d*x) - 
22698142121947299840*I*a**8*d**7*exp(2*I*c)*exp(2*I*d*x))/(145268109580462 
7189760*d**8), Ne(d**8, 0)), (x*(a**8*exp(16*I*c)/256 + a**8*exp(14*I*c)/3 
2 + 7*a**8*exp(12*I*c)/64 + 7*a**8*exp(10*I*c)/32 + 35*a**8*exp(8*I*c)/128 
 + 7*a**8*exp(6*I*c)/32 + 7*a**8*exp(4*I*c)/64 + a**8*exp(2*I*c)/32), True 
))
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.06 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {105 \, {\left (d x + c\right )} a^{8} + \frac {105 \, a^{8} \tan \left (d x + c\right )^{15} + 805 \, a^{8} \tan \left (d x + c\right )^{13} + 2681 \, a^{8} \tan \left (d x + c\right )^{11} + 5053 \, a^{8} \tan \left (d x + c\right )^{9} + 2883 \, a^{8} \tan \left (d x + c\right )^{7} + 21504 i \, a^{8} \tan \left (d x + c\right )^{6} + 70791 \, a^{8} \tan \left (d x + c\right )^{5} - 114688 i \, a^{8} \tan \left (d x + c\right )^{4} - 117285 \, a^{8} \tan \left (d x + c\right )^{3} + 74752 i \, a^{8} \tan \left (d x + c\right )^{2} + 26775 \, a^{8} \tan \left (d x + c\right ) - 4096 i \, a^{8}}{\tan \left (d x + c\right )^{16} + 8 \, \tan \left (d x + c\right )^{14} + 28 \, \tan \left (d x + c\right )^{12} + 56 \, \tan \left (d x + c\right )^{10} + 70 \, \tan \left (d x + c\right )^{8} + 56 \, \tan \left (d x + c\right )^{6} + 28 \, \tan \left (d x + c\right )^{4} + 8 \, \tan \left (d x + c\right )^{2} + 1}}{26880 \, d} \] Input:

integrate(cos(d*x+c)^16*(a+I*a*tan(d*x+c))^8,x, algorithm="maxima")
 

Output:

1/26880*(105*(d*x + c)*a^8 + (105*a^8*tan(d*x + c)^15 + 805*a^8*tan(d*x + 
c)^13 + 2681*a^8*tan(d*x + c)^11 + 5053*a^8*tan(d*x + c)^9 + 2883*a^8*tan( 
d*x + c)^7 + 21504*I*a^8*tan(d*x + c)^6 + 70791*a^8*tan(d*x + c)^5 - 11468 
8*I*a^8*tan(d*x + c)^4 - 117285*a^8*tan(d*x + c)^3 + 74752*I*a^8*tan(d*x + 
 c)^2 + 26775*a^8*tan(d*x + c) - 4096*I*a^8)/(tan(d*x + c)^16 + 8*tan(d*x 
+ c)^14 + 28*tan(d*x + c)^12 + 56*tan(d*x + c)^10 + 70*tan(d*x + c)^8 + 56 
*tan(d*x + c)^6 + 28*tan(d*x + c)^4 + 8*tan(d*x + c)^2 + 1))/d
 

Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.51 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=-\frac {1}{53760} \, a^{8} {\left (-\frac {105 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{d} + \frac {105 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{d} - \frac {2 \, {\left (105 \, \tan \left (d x + c\right )^{7} + 840 i \, \tan \left (d x + c\right )^{6} - 2975 \, \tan \left (d x + c\right )^{5} - 6160 i \, \tan \left (d x + c\right )^{4} + 8351 \, \tan \left (d x + c\right )^{3} + 8008 i \, \tan \left (d x + c\right )^{2} - 5993 \, \tan \left (d x + c\right ) - 4096 i\right )}}{d {\left (\tan \left (d x + c\right ) + i\right )}^{8}}\right )} \] Input:

integrate(cos(d*x+c)^16*(a+I*a*tan(d*x+c))^8,x, algorithm="giac")
 

Output:

-1/53760*a^8*(-105*I*log(tan(d*x + c) + I)/d + 105*I*log(tan(d*x + c) - I) 
/d - 2*(105*tan(d*x + c)^7 + 840*I*tan(d*x + c)^6 - 2975*tan(d*x + c)^5 - 
6160*I*tan(d*x + c)^4 + 8351*tan(d*x + c)^3 + 8008*I*tan(d*x + c)^2 - 5993 
*tan(d*x + c) - 4096*I)/(d*(tan(d*x + c) + I)^8))
 

Mupad [B] (verification not implemented)

Time = 2.05 (sec) , antiderivative size = 195, normalized size of antiderivative = 0.84 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {a^8\,x}{256}-\frac {-\frac {a^8\,{\mathrm {tan}\left (c+d\,x\right )}^7}{256}-\frac {a^8\,{\mathrm {tan}\left (c+d\,x\right )}^6\,1{}\mathrm {i}}{32}+\frac {85\,a^8\,{\mathrm {tan}\left (c+d\,x\right )}^5}{768}+\frac {a^8\,{\mathrm {tan}\left (c+d\,x\right )}^4\,11{}\mathrm {i}}{48}-\frac {1193\,a^8\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3840}-\frac {a^8\,{\mathrm {tan}\left (c+d\,x\right )}^2\,143{}\mathrm {i}}{480}+\frac {5993\,a^8\,\mathrm {tan}\left (c+d\,x\right )}{26880}+\frac {a^8\,16{}\mathrm {i}}{105}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^8+{\mathrm {tan}\left (c+d\,x\right )}^7\,8{}\mathrm {i}-28\,{\mathrm {tan}\left (c+d\,x\right )}^6-{\mathrm {tan}\left (c+d\,x\right )}^5\,56{}\mathrm {i}+70\,{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,56{}\mathrm {i}-28\,{\mathrm {tan}\left (c+d\,x\right )}^2-\mathrm {tan}\left (c+d\,x\right )\,8{}\mathrm {i}+1\right )} \] Input:

int(cos(c + d*x)^16*(a + a*tan(c + d*x)*1i)^8,x)
 

Output:

(a^8*x)/256 - ((5993*a^8*tan(c + d*x))/26880 + (a^8*16i)/105 - (a^8*tan(c 
+ d*x)^2*143i)/480 - (1193*a^8*tan(c + d*x)^3)/3840 + (a^8*tan(c + d*x)^4* 
11i)/48 + (85*a^8*tan(c + d*x)^5)/768 - (a^8*tan(c + d*x)^6*1i)/32 - (a^8* 
tan(c + d*x)^7)/256)/(d*(tan(c + d*x)^3*56i - 28*tan(c + d*x)^2 - tan(c + 
d*x)*8i + 70*tan(c + d*x)^4 - tan(c + d*x)^5*56i - 28*tan(c + d*x)^6 + tan 
(c + d*x)^7*8i + tan(c + d*x)^8 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 227, normalized size of antiderivative = 0.97 \[ \int \cos ^{16}(c+d x) (a+i a \tan (c+d x))^8 \, dx=\frac {a^{8} \left (-215040 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{15}+1244160 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{13}-3024640 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{11}+3984256 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{9}-3047472 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{7}+1336776 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5}-304710 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+26775 \cos \left (d x +c \right ) \sin \left (d x +c \right )-215040 \sin \left (d x +c \right )^{16} i +1351680 \sin \left (d x +c \right )^{14} i -3619840 \sin \left (d x +c \right )^{12} i +5354496 \sin \left (d x +c \right )^{10} i -4730880 \sin \left (d x +c \right )^{8} i +2508800 \sin \left (d x +c \right )^{6} i -752640 \sin \left (d x +c \right )^{4} i +107520 \sin \left (d x +c \right )^{2} i +105 d x \right )}{26880 d} \] Input:

int(cos(d*x+c)^16*(a+I*a*tan(d*x+c))^8,x)
                                                                                    
                                                                                    
 

Output:

(a**8*( - 215040*cos(c + d*x)*sin(c + d*x)**15 + 1244160*cos(c + d*x)*sin( 
c + d*x)**13 - 3024640*cos(c + d*x)*sin(c + d*x)**11 + 3984256*cos(c + d*x 
)*sin(c + d*x)**9 - 3047472*cos(c + d*x)*sin(c + d*x)**7 + 1336776*cos(c + 
 d*x)*sin(c + d*x)**5 - 304710*cos(c + d*x)*sin(c + d*x)**3 + 26775*cos(c 
+ d*x)*sin(c + d*x) - 215040*sin(c + d*x)**16*i + 1351680*sin(c + d*x)**14 
*i - 3619840*sin(c + d*x)**12*i + 5354496*sin(c + d*x)**10*i - 4730880*sin 
(c + d*x)**8*i + 2508800*sin(c + d*x)**6*i - 752640*sin(c + d*x)**4*i + 10 
7520*sin(c + d*x)**2*i + 105*d*x))/(26880*d)