\(\int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) [121]

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

Optimal result

Integrand size = 24, antiderivative size = 165 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {15 x}{64 a^2}-\frac {i}{64 d (a-i a \tan (c+d x))^2}+\frac {i a^2}{32 d (a+i a \tan (c+d x))^4}+\frac {i a}{16 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 d (a+i a \tan (c+d x))^2}-\frac {5 i}{64 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac {5 i}{32 d \left (a^2+i a^2 \tan (c+d x)\right )} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.96, 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 \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3968

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

\(\Big \downarrow \) 54

\(\displaystyle -\frac {i a^5 \int \left (\frac {5}{64 a^6 (a-i a \tan (c+d x))^2}+\frac {5}{32 a^6 (i \tan (c+d x) a+a)^2}+\frac {1}{32 a^5 (a-i a \tan (c+d x))^3}+\frac {3}{16 a^5 (i \tan (c+d x) a+a)^3}+\frac {3}{16 a^4 (i \tan (c+d x) a+a)^4}+\frac {1}{8 a^3 (i \tan (c+d x) a+a)^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^5 \left (\frac {15 i \arctan (\tan (c+d x))}{64 a^7}+\frac {5}{64 a^6 (a-i a \tan (c+d x))}-\frac {5}{32 a^6 (a+i a \tan (c+d x))}+\frac {1}{64 a^5 (a-i a \tan (c+d x))^2}-\frac {3}{32 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]^4/(a + I*a*Tan[c + d*x])^2,x]
 

Output:

((-I)*a^5*((((15*I)/64)*ArcTan[Tan[c + d*x]])/a^7 + 1/(64*a^5*(a - I*a*Tan 
[c + d*x])^2) + 5/(64*a^6*(a - I*a*Tan[c + d*x])) - 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]))))/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 = 1.07 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.69

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [A] (verification not implemented)

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

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

Output:

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

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:

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

Output:

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati 
ve exponent.
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.68 \[ \int \frac {\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {15 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{128 \, a^{2} d} - \frac {15 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{128 \, a^{2} d} + \frac {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}{64 \, a^{2} d {\left (\tan \left (d x + c\right ) + i\right )}^{2} {\left (\tan \left (d x + c\right ) - i\right )}^{4}} \] Input:

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

Output:

15/128*I*log(tan(d*x + c) + I)/(a^2*d) - 15/128*I*log(tan(d*x + c) - I)/(a 
^2*d) + 1/64*(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)/(a^2*d*(tan(d*x + c) + I)^ 
2*(tan(d*x + c) - I)^4)
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [F]

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

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

Output:

( - int(cos(c + d*x)**4/(tan(c + d*x)**2 - 2*tan(c + d*x)*i - 1),x))/a**2