\(\int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx\) [27]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (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 = 179 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {15 a^2 x}{64}-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}-\frac {5 i a^9}{32 d \left (a^7-i a^7 \tan (c+d x)\right )}+\frac {5 i a^9}{64 d \left (a^7+i a^7 \tan (c+d x)\right )} \] Output:

15/64*a^2*x-1/32*I*a^6/d/(a-I*a*tan(d*x+c))^4-1/16*I*a^5/d/(a-I*a*tan(d*x+ 
c))^3-3/32*I*a^4/d/(a-I*a*tan(d*x+c))^2+1/64*I*a^4/d/(a+I*a*tan(d*x+c))^2- 
5/32*I*a^9/d/(a^7-I*a^7*tan(d*x+c))+5/64*I*a^9/d/(a^7+I*a^7*tan(d*x+c))
 

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.79 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {a^2 \sec ^6(c+d x) (-80 i-65 i \cos (2 (c+d x))+16 i \cos (4 (c+d x))+i \cos (6 (c+d x))+120 \arctan (\tan (c+d x)) (\cos (2 (c+d x))-i \sin (2 (c+d x)))-5 \sin (2 (c+d x))+32 \sin (4 (c+d x))+3 \sin (6 (c+d x)))}{512 d (-i+\tan (c+d x))^2 (i+\tan (c+d x))^4} \] Input:

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

Output:

-1/512*(a^2*Sec[c + d*x]^6*(-80*I - (65*I)*Cos[2*(c + d*x)] + (16*I)*Cos[4 
*(c + d*x)] + I*Cos[6*(c + d*x)] + 120*ArcTan[Tan[c + d*x]]*(Cos[2*(c + d* 
x)] - I*Sin[2*(c + d*x)]) - 5*Sin[2*(c + d*x)] + 32*Sin[4*(c + d*x)] + 3*S 
in[6*(c + d*x)]))/(d*(-I + Tan[c + d*x])^2*(I + Tan[c + d*x])^4)
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.89, 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 ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3968

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

\(\Big \downarrow \) 54

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

((-I)*a^9*((((15*I)/64)*ArcTan[Tan[c + d*x]])/a^7 + 1/(32*a^3*(a - I*a*Tan 
[c + d*x])^4) + 1/(16*a^4*(a - I*a*Tan[c + d*x])^3) + 3/(32*a^5*(a - I*a*T 
an[c + d*x])^2) + 5/(32*a^6*(a - I*a*Tan[c + d*x])) - 1/(64*a^5*(a + I*a*T 
an[c + d*x])^2) - 5/(64*a^6*(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 [A] (verified)

Time = 75.84 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.64

method result size
risch \(\frac {15 a^{2} x}{64}-\frac {i a^{2} {\mathrm e}^{8 i \left (d x +c \right )}}{512 d}-\frac {i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{64 d}-\frac {7 i a^{2} \cos \left (4 d x +4 c \right )}{128 d}+\frac {a^{2} \sin \left (4 d x +4 c \right )}{16 d}-\frac {7 i a^{2} \cos \left (2 d x +2 c \right )}{64 d}+\frac {13 a^{2} \sin \left (2 d x +2 c \right )}{64 d}\) \(114\)
derivativedivides \(\frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{7}}{8}+\frac {\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{48}+\frac {5 d x}{128}+\frac {5 c}{128}\right )-\frac {i a^{2} \cos \left (d x +c \right )^{8}}{4}+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{7}+\frac {7 \cos \left (d x +c \right )^{5}}{6}+\frac {35 \cos \left (d x +c \right )^{3}}{24}+\frac {35 \cos \left (d x +c \right )}{16}\right ) \sin \left (d x +c \right )}{8}+\frac {35 d x}{128}+\frac {35 c}{128}\right )}{d}\) \(141\)
default \(\frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{7}}{8}+\frac {\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{48}+\frac {5 d x}{128}+\frac {5 c}{128}\right )-\frac {i a^{2} \cos \left (d x +c \right )^{8}}{4}+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{7}+\frac {7 \cos \left (d x +c \right )^{5}}{6}+\frac {35 \cos \left (d x +c \right )^{3}}{24}+\frac {35 \cos \left (d x +c \right )}{16}\right ) \sin \left (d x +c \right )}{8}+\frac {35 d x}{128}+\frac {35 c}{128}\right )}{d}\) \(141\)

Input:

int(cos(d*x+c)^8*(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

15/64*a^2*x-1/512*I/d*a^2*exp(8*I*(d*x+c))-1/64*I/d*a^2*exp(6*I*(d*x+c))-7 
/128*I/d*a^2*cos(4*d*x+4*c)+1/16/d*a^2*sin(4*d*x+4*c)-7/64*I/d*a^2*cos(2*d 
*x+2*c)+13/64/d*a^2*sin(2*d*x+2*c)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.59 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {{\left (120 \, a^{2} d x e^{\left (4 i \, d x + 4 i \, c\right )} - i \, a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} - 8 i \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} - 80 i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 24 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i \, a^{2}\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{512 \, d} \] Input:

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

Output:

1/512*(120*a^2*d*x*e^(4*I*d*x + 4*I*c) - I*a^2*e^(12*I*d*x + 12*I*c) - 8*I 
*a^2*e^(10*I*d*x + 10*I*c) - 30*I*a^2*e^(8*I*d*x + 8*I*c) - 80*I*a^2*e^(6* 
I*d*x + 6*I*c) + 24*I*a^2*e^(2*I*d*x + 2*I*c) + 2*I*a^2)*e^(-4*I*d*x - 4*I 
*c)/d
 

Sympy [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 270, normalized size of antiderivative = 1.51 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {15 a^{2} x}{64} + \begin {cases} \frac {\left (- 8589934592 i a^{2} d^{5} e^{14 i c} e^{8 i d x} - 68719476736 i a^{2} d^{5} e^{12 i c} e^{6 i d x} - 257698037760 i a^{2} d^{5} e^{10 i c} e^{4 i d x} - 687194767360 i a^{2} d^{5} e^{8 i c} e^{2 i d x} + 206158430208 i a^{2} d^{5} e^{4 i c} e^{- 2 i d x} + 17179869184 i a^{2} d^{5} e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{4398046511104 d^{6}} & \text {for}\: d^{6} e^{6 i c} \neq 0 \\x \left (- \frac {15 a^{2}}{64} + \frac {\left (a^{2} e^{12 i c} + 6 a^{2} e^{10 i c} + 15 a^{2} e^{8 i c} + 20 a^{2} e^{6 i c} + 15 a^{2} e^{4 i c} + 6 a^{2} e^{2 i c} + a^{2}\right ) e^{- 4 i c}}{64}\right ) & \text {otherwise} \end {cases} \] Input:

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

Output:

15*a**2*x/64 + Piecewise(((-8589934592*I*a**2*d**5*exp(14*I*c)*exp(8*I*d*x 
) - 68719476736*I*a**2*d**5*exp(12*I*c)*exp(6*I*d*x) - 257698037760*I*a**2 
*d**5*exp(10*I*c)*exp(4*I*d*x) - 687194767360*I*a**2*d**5*exp(8*I*c)*exp(2 
*I*d*x) + 206158430208*I*a**2*d**5*exp(4*I*c)*exp(-2*I*d*x) + 17179869184* 
I*a**2*d**5*exp(2*I*c)*exp(-4*I*d*x))*exp(-6*I*c)/(4398046511104*d**6), Ne 
(d**6*exp(6*I*c), 0)), (x*(-15*a**2/64 + (a**2*exp(12*I*c) + 6*a**2*exp(10 
*I*c) + 15*a**2*exp(8*I*c) + 20*a**2*exp(6*I*c) + 15*a**2*exp(4*I*c) + 6*a 
**2*exp(2*I*c) + a**2)*exp(-4*I*c)/64), True))
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.64 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {15 \, {\left (d x + c\right )} a^{2} + \frac {15 \, a^{2} \tan \left (d x + c\right )^{7} + 55 \, a^{2} \tan \left (d x + c\right )^{5} + 73 \, a^{2} \tan \left (d x + c\right )^{3} + 49 \, a^{2} \tan \left (d x + c\right ) - 16 i \, a^{2}}{\tan \left (d x + c\right )^{8} + 4 \, \tan \left (d x + c\right )^{6} + 6 \, \tan \left (d x + c\right )^{4} + 4 \, \tan \left (d x + c\right )^{2} + 1}}{64 \, d} \] Input:

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

Output:

1/64*(15*(d*x + c)*a^2 + (15*a^2*tan(d*x + c)^7 + 55*a^2*tan(d*x + c)^5 + 
73*a^2*tan(d*x + c)^3 + 49*a^2*tan(d*x + c) - 16*I*a^2)/(tan(d*x + c)^8 + 
4*tan(d*x + c)^6 + 6*tan(d*x + c)^4 + 4*tan(d*x + c)^2 + 1))/d
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.61 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {1}{128} \, a^{2} {\left (\frac {15 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{d} - \frac {15 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{d} + \frac {2 \, {\left (15 \, \tan \left (d x + c\right )^{5} + 30 i \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{3} + 50 i \, \tan \left (d x + c\right )^{2} - 17 \, \tan \left (d x + c\right ) + 16 i\right )}}{d {\left (\tan \left (d x + c\right ) + i\right )}^{4} {\left (\tan \left (d x + c\right ) - i\right )}^{2}}\right )} \] Input:

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

Output:

1/128*a^2*(15*I*log(tan(d*x + c) + I)/d - 15*I*log(tan(d*x + c) - I)/d + 2 
*(15*tan(d*x + c)^5 + 30*I*tan(d*x + c)^4 + 10*tan(d*x + c)^3 + 50*I*tan(d 
*x + c)^2 - 17*tan(d*x + c) + 16*I)/(d*(tan(d*x + c) + I)^4*(tan(d*x + c) 
- I)^2))
 

Mupad [B] (verification not implemented)

Time = 1.19 (sec) , antiderivative size = 144, normalized size of antiderivative = 0.80 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {15\,a^2\,x}{64}+\frac {\frac {15\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{64}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^4\,15{}\mathrm {i}}{32}+\frac {5\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{32}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{32}-\frac {17\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{64}+\frac {a^2\,1{}\mathrm {i}}{4}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6+{\mathrm {tan}\left (c+d\,x\right )}^5\,2{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}-{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}-1\right )} \] Input:

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

Output:

(15*a^2*x)/64 + ((a^2*1i)/4 - (17*a^2*tan(c + d*x))/64 + (a^2*tan(c + d*x) 
^2*25i)/32 + (5*a^2*tan(c + d*x)^3)/32 + (a^2*tan(c + d*x)^4*15i)/32 + (15 
*a^2*tan(c + d*x)^5)/64)/(d*(tan(c + d*x)*2i - tan(c + d*x)^2 + tan(c + d* 
x)^3*4i + tan(c + d*x)^4 + tan(c + d*x)^5*2i + tan(c + d*x)^6 - 1))
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.66 \[ \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^{2} \left (-16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{7}+56 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5}-74 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+49 \cos \left (d x +c \right ) \sin \left (d x +c \right )-16 \sin \left (d x +c \right )^{8} i +64 \sin \left (d x +c \right )^{6} i -96 \sin \left (d x +c \right )^{4} i +64 \sin \left (d x +c \right )^{2} i +15 d x \right )}{64 d} \] Input:

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

Output:

(a**2*( - 16*cos(c + d*x)*sin(c + d*x)**7 + 56*cos(c + d*x)*sin(c + d*x)** 
5 - 74*cos(c + d*x)*sin(c + d*x)**3 + 49*cos(c + d*x)*sin(c + d*x) - 16*si 
n(c + d*x)**8*i + 64*sin(c + d*x)**6*i - 96*sin(c + d*x)**4*i + 64*sin(c + 
 d*x)**2*i + 15*d*x))/(64*d)