\(\int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx\) [700]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F(-2)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 26, antiderivative size = 86 \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=-\frac {i 2^{-1-\frac {m}{2}} (e \cos (c+d x))^m \operatorname {Hypergeometric2F1}\left (-\frac {m}{2},\frac {4+m}{2},1-\frac {m}{2},\frac {1}{2} (1-i \tan (c+d x))\right ) (1+i \tan (c+d x))^{m/2}}{a d m} \] Output:

-I*2^(-1-1/2*m)*(e*cos(d*x+c))^m*hypergeom([-1/2*m, 2+1/2*m],[1-1/2*m],1/2 
-1/2*I*tan(d*x+c))*(1+I*tan(d*x+c))^(1/2*m)/a/d/m
 

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(433\) vs. \(2(86)=172\).

Time = 4.82 (sec) , antiderivative size = 433, normalized size of antiderivative = 5.03 \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=-\frac {2^{-m/2} \cos (c+d x) (e \cos (c+d x))^m \left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} \left (2^{m/2} (2+m) \operatorname {Hypergeometric2F1}\left (1+m,\frac {2+m}{2},2+m,2 \cos (c+d x) (\cos (c+d x)-i \sin (c+d x))\right ) ((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}-2 (1+m) \operatorname {Hypergeometric2F1}\left (-1-\frac {m}{2},\frac {m}{2},-\frac {m}{2},\frac {1}{2} (1+i \tan (c+d x))\right ) ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2} (1-i \tan (c+d x))^{m/2}\right )}{a d (1+m) (2+m) \left (-i \sin (c+d x) \left (\left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2}-((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}\right )+\cos (c+d x) \left (\left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2}+((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}\right )\right ) (-i+\tan (c+d x))} \] Input:

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

Output:

-((Cos[c + d*x]*(e*Cos[c + d*x])^m*(1 - 2*Cos[c + d*x]^2 + I*Sin[2*(c + d* 
x)])^(m/2)*(2^(m/2)*(2 + m)*Hypergeometric2F1[1 + m, (2 + m)/2, 2 + m, 2*C 
os[c + d*x]*(Cos[c + d*x] - I*Sin[c + d*x])]*((Cos[c] - I*Sin[c])*Sin[c]*( 
I + Tan[d*x]))^(m/2) - 2*(1 + m)*Hypergeometric2F1[-1 - m/2, m/2, -1/2*m, 
(1 + I*Tan[c + d*x])/2]*((Cos[c] + I*Sin[c])*Sin[c]*(-I + Tan[d*x]))^(m/2) 
*(1 - I*Tan[c + d*x])^(m/2)))/(2^(m/2)*a*d*(1 + m)*(2 + m)*((-I)*Sin[c + d 
*x]*((1 - 2*Cos[c + d*x]^2 + I*Sin[2*(c + d*x)])^(m/2)*((Cos[c] + I*Sin[c] 
)*Sin[c]*(-I + Tan[d*x]))^(m/2) - ((Cos[c] - I*Sin[c])*Sin[c]*(I + Tan[d*x 
]))^(m/2)) + Cos[c + d*x]*((1 - 2*Cos[c + d*x]^2 + I*Sin[2*(c + d*x)])^(m/ 
2)*((Cos[c] + I*Sin[c])*Sin[c]*(-I + Tan[d*x]))^(m/2) + ((Cos[c] - I*Sin[c 
])*Sin[c]*(I + Tan[d*x]))^(m/2)))*(-I + Tan[c + d*x])))
 

Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3042, 3998, 3042, 3986, 3042, 4006, 80, 79}

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 {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)}dx\)

\(\Big \downarrow \) 3998

\(\displaystyle (e \cos (c+d x))^m (e \sec (c+d x))^m \int \frac {(e \sec (c+d x))^{-m}}{i \tan (c+d x) a+a}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (e \cos (c+d x))^m (e \sec (c+d x))^m \int \frac {(e \sec (c+d x))^{-m}}{i \tan (c+d x) a+a}dx\)

\(\Big \downarrow \) 3986

\(\displaystyle (a-i a \tan (c+d x))^{m/2} (a+i a \tan (c+d x))^{m/2} (e \cos (c+d x))^m \int (a-i a \tan (c+d x))^{-m/2} (i \tan (c+d x) a+a)^{-\frac {m}{2}-1}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (a-i a \tan (c+d x))^{m/2} (a+i a \tan (c+d x))^{m/2} (e \cos (c+d x))^m \int (a-i a \tan (c+d x))^{-m/2} (i \tan (c+d x) a+a)^{-\frac {m}{2}-1}dx\)

\(\Big \downarrow \) 4006

\(\displaystyle \frac {a^2 (a-i a \tan (c+d x))^{m/2} (a+i a \tan (c+d x))^{m/2} (e \cos (c+d x))^m \int (a-i a \tan (c+d x))^{-\frac {m}{2}-1} (i \tan (c+d x) a+a)^{-\frac {m}{2}-2}d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 80

\(\displaystyle \frac {2^{-\frac {m}{2}-2} (1+i \tan (c+d x))^{m/2} (a-i a \tan (c+d x))^{m/2} (e \cos (c+d x))^m \int \left (\frac {1}{2} i \tan (c+d x)+\frac {1}{2}\right )^{-\frac {m}{2}-2} (a-i a \tan (c+d x))^{-\frac {m}{2}-1}d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 79

\(\displaystyle -\frac {i 2^{-\frac {m}{2}-1} (1+i \tan (c+d x))^{m/2} (e \cos (c+d x))^m \operatorname {Hypergeometric2F1}\left (-\frac {m}{2},\frac {m+4}{2},1-\frac {m}{2},\frac {1}{2} (1-i \tan (c+d x))\right )}{a d m}\)

Input:

Int[(e*Cos[c + d*x])^m/(a + I*a*Tan[c + d*x]),x]
 

Output:

((-I)*2^(-1 - m/2)*(e*Cos[c + d*x])^m*Hypergeometric2F1[-1/2*m, (4 + m)/2, 
 1 - m/2, (1 - I*Tan[c + d*x])/2]*(1 + I*Tan[c + d*x])^(m/2))/(a*d*m)
 

Defintions of rubi rules used

rule 79
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(( 
a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c - a*d))^n))*Hypergeometric2F1[-n, m + 1 
, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}, x] 
&&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] 
 ||  !(RationalQ[n] && GtQ[-d/(b*c - a*d), 0]))
 

rule 80
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(c 
 + d*x)^FracPart[n]/((b/(b*c - a*d))^IntPart[n]*(b*((c + d*x)/(b*c - a*d))) 
^FracPart[n])   Int[(a + b*x)^m*Simp[b*(c/(b*c - a*d)) + b*d*(x/(b*c - a*d) 
), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] &&  !IntegerQ[m] &&  !Integ 
erQ[n] && (RationalQ[m] ||  !SimplerQ[n + 1, m + 1])
 

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

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

rule 3998
Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x 
_)])^(n_.), x_Symbol] :> Simp[(d*Cos[e + f*x])^m*(d*Sec[e + f*x])^m   Int[( 
a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m 
, n}, x] &&  !IntegerQ[m]
 

rule 4006
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + ( 
f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(c/f)   Subst[Int[(a + b*x)^(m - 1)*( 
c + d*x)^(n - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n 
}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
 
Maple [F]

\[\int \frac {\left (e \cos \left (d x +c \right )\right )^{m}}{a +i a \tan \left (d x +c \right )}d x\]

Input:

int((e*cos(d*x+c))^m/(a+I*a*tan(d*x+c)),x)
 

Output:

int((e*cos(d*x+c))^m/(a+I*a*tan(d*x+c)),x)
 

Fricas [F]

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

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

Output:

integral(1/2*(1/2*(e*e^(2*I*d*x + 2*I*c) + e)*e^(-I*d*x - I*c))^m*(e^(2*I* 
d*x + 2*I*c) + 1)*e^(-2*I*d*x - 2*I*c)/a, x)
 

Sympy [F]

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

integrate((e*cos(d*x+c))**m/(a+I*a*tan(d*x+c)),x)
 

Output:

-I*Integral((e*cos(c + d*x))**m/(tan(c + d*x) - I), x)/a
 

Maxima [F(-2)]

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

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

Output:

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is un 
defined.
 

Giac [F]

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

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

Output:

integrate((e*cos(d*x + c))^m/(I*a*tan(d*x + c) + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=\int \frac {{\left (e\,\cos \left (c+d\,x\right )\right )}^m}{a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \] Input:

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

Output:

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

Reduce [F]

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

int((e*cos(d*x+c))^m/(a+I*a*tan(d*x+c)),x)
                                                                                    
                                                                                    
 

Output:

(e**m*int(cos(c + d*x)**m/(tan(c + d*x)*i + 1),x))/a