\(\int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx\) [45]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 24, antiderivative size = 127 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {7 a^3 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {7 i a^3 \sec ^3(c+d x)}{12 d}+\frac {7 a^3 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}+\frac {7 i \sec ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d} \] Output:

7/8*a^3*arctanh(sin(d*x+c))/d+7/12*I*a^3*sec(d*x+c)^3/d+7/8*a^3*sec(d*x+c) 
*tan(d*x+c)/d+1/5*I*a*sec(d*x+c)^3*(a+I*a*tan(d*x+c))^2/d+7/20*I*sec(d*x+c 
)^3*(a^3+I*a^3*tan(d*x+c))/d
 

Mathematica [A] (verified)

Time = 1.66 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.80 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {a^3 (\cos (3 d x)+i \sin (3 d x)) \left (1680 \text {arctanh}\left (\sin (c)+\cos (c) \tan \left (\frac {d x}{2}\right )\right )+\sec ^5(c+d x) (448 i+640 i \cos (2 (c+d x))-150 \sin (2 (c+d x))+105 \sin (4 (c+d x)))\right )}{960 d (\cos (d x)+i \sin (d x))^3} \] Input:

Integrate[Sec[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]
 

Output:

(a^3*(Cos[3*d*x] + I*Sin[3*d*x])*(1680*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2 
]] + Sec[c + d*x]^5*(448*I + (640*I)*Cos[2*(c + d*x)] - 150*Sin[2*(c + d*x 
)] + 105*Sin[4*(c + d*x)])))/(960*d*(Cos[d*x] + I*Sin[d*x])^3)
 

Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.06, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3042, 3979, 3042, 3979, 3042, 3967, 3042, 4255, 3042, 4257}

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 \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (c+d x)^3 (a+i a \tan (c+d x))^3dx\)

\(\Big \downarrow \) 3979

\(\displaystyle \frac {7}{5} a \int \sec ^3(c+d x) (i \tan (c+d x) a+a)^2dx+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{5} a \int \sec (c+d x)^3 (i \tan (c+d x) a+a)^2dx+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3979

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \int \sec ^3(c+d x) (i \tan (c+d x) a+a)dx+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \int \sec (c+d x)^3 (i \tan (c+d x) a+a)dx+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3967

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \left (a \int \sec ^3(c+d x)dx+\frac {i a \sec ^3(c+d x)}{3 d}\right )+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \left (a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx+\frac {i a \sec ^3(c+d x)}{3 d}\right )+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \left (a \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {i a \sec ^3(c+d x)}{3 d}\right )+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7}{5} a \left (\frac {5}{4} a \left (a \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {i a \sec ^3(c+d x)}{3 d}\right )+\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {7}{5} a \left (\frac {i \sec ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{4 d}+\frac {5}{4} a \left (a \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {i a \sec ^3(c+d x)}{3 d}\right )\right )+\frac {i a \sec ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}\)

Input:

Int[Sec[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]
 

Output:

((I/5)*a*Sec[c + d*x]^3*(a + I*a*Tan[c + d*x])^2)/d + (7*a*(((I/4)*Sec[c + 
 d*x]^3*(a^2 + I*a^2*Tan[c + d*x]))/d + (5*a*(((I/3)*a*Sec[c + d*x]^3)/d + 
 a*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*d))))/4)) 
/5
 

Defintions of rubi rules used

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

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 3979
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^(n_), x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^(n 
 - 1)/(f*(m + n - 1))), x] + Simp[a*((m + 2*n - 2)/(m + n - 1))   Int[(d*Se 
c[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f, 
 m}, x] && EqQ[a^2 + b^2, 0] && GtQ[n, 0] && NeQ[m + n - 1, 0] && IntegersQ 
[2*m, 2*n]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 7.76 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.96

method result size
risch \(-\frac {i a^{3} \left (105 \,{\mathrm e}^{9 i \left (d x +c \right )}-790 \,{\mathrm e}^{7 i \left (d x +c \right )}-896 \,{\mathrm e}^{5 i \left (d x +c \right )}-490 \,{\mathrm e}^{3 i \left (d x +c \right )}-105 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}\) \(122\)
derivativedivides \(\frac {-i a^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )-3 a^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {i a^{3}}{\cos \left (d x +c \right )^{3}}+a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(200\)
default \(\frac {-i a^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )-3 a^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {i a^{3}}{\cos \left (d x +c \right )^{3}}+a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(200\)

Input:

int(sec(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)
 

Output:

-1/60*I*a^3/d/(exp(2*I*(d*x+c))+1)^5*(105*exp(9*I*(d*x+c))-790*exp(7*I*(d* 
x+c))-896*exp(5*I*(d*x+c))-490*exp(3*I*(d*x+c))-105*exp(I*(d*x+c)))-7/8/d* 
a^3*ln(exp(I*(d*x+c))-I)+7/8/d*a^3*ln(exp(I*(d*x+c))+I)
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 310 vs. \(2 (107) = 214\).

Time = 0.09 (sec) , antiderivative size = 310, normalized size of antiderivative = 2.44 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {-210 i \, a^{3} e^{\left (9 i \, d x + 9 i \, c\right )} + 1580 i \, a^{3} e^{\left (7 i \, d x + 7 i \, c\right )} + 1792 i \, a^{3} e^{\left (5 i \, d x + 5 i \, c\right )} + 980 i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )} + 210 i \, a^{3} e^{\left (i \, d x + i \, c\right )} + 105 \, {\left (a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 105 \, {\left (a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{120 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \] Input:

integrate(sec(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")
 

Output:

1/120*(-210*I*a^3*e^(9*I*d*x + 9*I*c) + 1580*I*a^3*e^(7*I*d*x + 7*I*c) + 1 
792*I*a^3*e^(5*I*d*x + 5*I*c) + 980*I*a^3*e^(3*I*d*x + 3*I*c) + 210*I*a^3* 
e^(I*d*x + I*c) + 105*(a^3*e^(10*I*d*x + 10*I*c) + 5*a^3*e^(8*I*d*x + 8*I* 
c) + 10*a^3*e^(6*I*d*x + 6*I*c) + 10*a^3*e^(4*I*d*x + 4*I*c) + 5*a^3*e^(2* 
I*d*x + 2*I*c) + a^3)*log(e^(I*d*x + I*c) + I) - 105*(a^3*e^(10*I*d*x + 10 
*I*c) + 5*a^3*e^(8*I*d*x + 8*I*c) + 10*a^3*e^(6*I*d*x + 6*I*c) + 10*a^3*e^ 
(4*I*d*x + 4*I*c) + 5*a^3*e^(2*I*d*x + 2*I*c) + a^3)*log(e^(I*d*x + I*c) - 
 I))/(d*e^(10*I*d*x + 10*I*c) + 5*d*e^(8*I*d*x + 8*I*c) + 10*d*e^(6*I*d*x 
+ 6*I*c) + 10*d*e^(4*I*d*x + 4*I*c) + 5*d*e^(2*I*d*x + 2*I*c) + d)
 

Sympy [F]

\[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=- i a^{3} \left (\int i \sec ^{3}{\left (c + d x \right )}\, dx + \int \left (- 3 \tan {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\right )\, dx + \int \tan ^{3}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \left (- 3 i \tan ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\right )\, dx\right ) \] Input:

integrate(sec(d*x+c)**3*(a+I*a*tan(d*x+c))**3,x)
 

Output:

-I*a**3*(Integral(I*sec(c + d*x)**3, x) + Integral(-3*tan(c + d*x)*sec(c + 
 d*x)**3, x) + Integral(tan(c + d*x)**3*sec(c + d*x)**3, x) + Integral(-3* 
I*tan(c + d*x)**2*sec(c + d*x)**3, x))
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.22 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {45 \, a^{3} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 60 \, a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - \frac {240 i \, a^{3}}{\cos \left (d x + c\right )^{3}} - \frac {16 i \, {\left (5 \, \cos \left (d x + c\right )^{2} - 3\right )} a^{3}}{\cos \left (d x + c\right )^{5}}}{240 \, d} \] Input:

integrate(sec(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")
 

Output:

-1/240*(45*a^3*(2*(sin(d*x + c)^3 + sin(d*x + c))/(sin(d*x + c)^4 - 2*sin( 
d*x + c)^2 + 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 60*a^3* 
(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x 
 + c) - 1)) - 240*I*a^3/cos(d*x + c)^3 - 16*I*(5*cos(d*x + c)^2 - 3)*a^3/c 
os(d*x + c)^5)/d
 

Giac [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.49 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {105 \, a^{3} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 105 \, a^{3} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) + \frac {2 \, {\left (15 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 360 i \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 390 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 960 i \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 400 i \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 390 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 i \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 136 i \, a^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \] Input:

integrate(sec(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")
 

Output:

1/120*(105*a^3*log(tan(1/2*d*x + 1/2*c) + 1) - 105*a^3*log(tan(1/2*d*x + 1 
/2*c) - 1) + 2*(15*a^3*tan(1/2*d*x + 1/2*c)^9 - 360*I*a^3*tan(1/2*d*x + 1/ 
2*c)^8 - 390*a^3*tan(1/2*d*x + 1/2*c)^7 + 960*I*a^3*tan(1/2*d*x + 1/2*c)^6 
 - 400*I*a^3*tan(1/2*d*x + 1/2*c)^4 + 390*a^3*tan(1/2*d*x + 1/2*c)^3 + 320 
*I*a^3*tan(1/2*d*x + 1/2*c)^2 - 15*a^3*tan(1/2*d*x + 1/2*c) - 136*I*a^3)/( 
tan(1/2*d*x + 1/2*c)^2 - 1)^5)/d
 

Mupad [B] (verification not implemented)

Time = 4.12 (sec) , antiderivative size = 228, normalized size of antiderivative = 1.80 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {7\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d}-\frac {-\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{4}+a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,6{}\mathrm {i}+\frac {13\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{2}-a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,16{}\mathrm {i}+\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,20{}\mathrm {i}}{3}-\frac {13\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}-\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,16{}\mathrm {i}}{3}+\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}+\frac {a^3\,34{}\mathrm {i}}{15}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \] Input:

int((a + a*tan(c + d*x)*1i)^3/cos(c + d*x)^3,x)
 

Output:

(7*a^3*atanh(tan(c/2 + (d*x)/2)))/(4*d) - ((a^3*tan(c/2 + (d*x)/2)^4*20i)/ 
3 - (13*a^3*tan(c/2 + (d*x)/2)^3)/2 - (a^3*tan(c/2 + (d*x)/2)^2*16i)/3 - a 
^3*tan(c/2 + (d*x)/2)^6*16i + (13*a^3*tan(c/2 + (d*x)/2)^7)/2 + a^3*tan(c/ 
2 + (d*x)/2)^8*6i - (a^3*tan(c/2 + (d*x)/2)^9)/4 + (a^3*34i)/15 + (a^3*tan 
(c/2 + (d*x)/2))/4)/(d*(5*tan(c/2 + (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 
 10*tan(c/2 + (d*x)/2)^6 - 5*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 
- 1))
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 278, normalized size of antiderivative = 2.19 \[ \int \sec ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {a^{3} \left (-105 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4}+210 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2}-105 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+105 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4}-210 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2}+105 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-136 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} i -105 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+272 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} i +15 \cos \left (d x +c \right ) \sin \left (d x +c \right )-136 \cos \left (d x +c \right ) i -160 \sin \left (d x +c \right )^{2} i +136 i \right )}{120 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{2}+1\right )} \] Input:

int(sec(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x)
 

Output:

(a**3*( - 105*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4 + 210 
*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2 - 105*cos(c + d*x) 
*log(tan((c + d*x)/2) - 1) + 105*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*si 
n(c + d*x)**4 - 210*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2 
 + 105*cos(c + d*x)*log(tan((c + d*x)/2) + 1) - 136*cos(c + d*x)*sin(c + d 
*x)**4*i - 105*cos(c + d*x)*sin(c + d*x)**3 + 272*cos(c + d*x)*sin(c + d*x 
)**2*i + 15*cos(c + d*x)*sin(c + d*x) - 136*cos(c + d*x)*i - 160*sin(c + d 
*x)**2*i + 136*i))/(120*cos(c + d*x)*d*(sin(c + d*x)**4 - 2*sin(c + d*x)** 
2 + 1))