\(\int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx\) [790]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 24, antiderivative size = 37 \[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=-\frac {i a (d \cot (e+f x))^n \operatorname {Hypergeometric2F1}(1,n,1+n,-i \cot (e+f x))}{f n} \] Output:

-I*a*(d*cot(f*x+e))^n*hypergeom([1, n],[1+n],-I*cot(f*x+e))/f/n
 

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.00 \[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=-\frac {i a (d \cot (e+f x))^n \operatorname {Hypergeometric2F1}(1,n,1+n,-i \cot (e+f x))}{f n} \] Input:

Integrate[(d*Cot[e + f*x])^n*(a + I*a*Tan[e + f*x]),x]
 

Output:

((-I)*a*(d*Cot[e + f*x])^n*Hypergeometric2F1[1, n, 1 + n, (-I)*Cot[e + f*x 
]])/(f*n)
 

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 4156, 3042, 4020, 27, 74}

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 (a+i a \tan (e+f x)) (d \cot (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+i a \tan (e+f x)) (d \cot (e+f x))^ndx\)

\(\Big \downarrow \) 4156

\(\displaystyle d \int (d \cot (e+f x))^{n-1} (\cot (e+f x) a+i a)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle d \int \left (-d \tan \left (e+f x+\frac {\pi }{2}\right )\right )^{n-1} \left (i a-a \tan \left (e+f x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4020

\(\displaystyle -\frac {i a^2 d \int \frac {(d \cot (e+f x))^{n-1}}{a (i \cot (e+f x) a+a)}d(a \cot (e+f x))}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {i a d \int \frac {(d \cot (e+f x))^{n-1}}{i \cot (e+f x) a+a}d(a \cot (e+f x))}{f}\)

\(\Big \downarrow \) 74

\(\displaystyle -\frac {i a (d \cot (e+f x))^n \operatorname {Hypergeometric2F1}(1,n,n+1,-i \cot (e+f x))}{f n}\)

Input:

Int[(d*Cot[e + f*x])^n*(a + I*a*Tan[e + f*x]),x]
 

Output:

((-I)*a*(d*Cot[e + f*x])^n*Hypergeometric2F1[1, n, 1 + n, (-I)*Cot[e + f*x 
]])/(f*n)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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

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

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

rule 4156
Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x 
_)]^(n_.))^(p_.), x_Symbol] :> Simp[d^(n*p)   Int[(d*Cot[e + f*x])^(m - n*p 
)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x] && 
  !IntegerQ[m] && IntegersQ[n, p]
 
Maple [F]

\[\int \left (d \cot \left (f x +e \right )\right )^{n} \left (a +i a \tan \left (f x +e \right )\right )d x\]

Input:

int((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x)
 

Output:

int((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x)
 

Fricas [F]

\[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n} \,d x } \] Input:

integrate((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x, algorithm="fricas")
 

Output:

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

Sympy [F]

\[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=i a \left (\int \left (- i \left (d \cot {\left (e + f x \right )}\right )^{n}\right )\, dx + \int \left (d \cot {\left (e + f x \right )}\right )^{n} \tan {\left (e + f x \right )}\, dx\right ) \] Input:

integrate((d*cot(f*x+e))**n*(a+I*a*tan(f*x+e)),x)
 

Output:

I*a*(Integral(-I*(d*cot(e + f*x))**n, x) + Integral((d*cot(e + f*x))**n*ta 
n(e + f*x), x))
 

Maxima [F]

\[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n} \,d x } \] Input:

integrate((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x, algorithm="maxima")
 

Output:

integrate((I*a*tan(f*x + e) + a)*(d*cot(f*x + e))^n, x)
 

Giac [F]

\[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )} \left (d \cot \left (f x + e\right )\right )^{n} \,d x } \] Input:

integrate((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x, algorithm="giac")
 

Output:

integrate((I*a*tan(f*x + e) + a)*(d*cot(f*x + e))^n, x)
 

Mupad [F(-1)]

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

int((d*cot(e + f*x))^n*(a + a*tan(e + f*x)*1i),x)
 

Output:

int((d*cot(e + f*x))^n*(a + a*tan(e + f*x)*1i), x)
 

Reduce [F]

\[ \int (d \cot (e+f x))^n (a+i a \tan (e+f x)) \, dx=d^{n} a \left (\int \cot \left (f x +e \right )^{n}d x +\left (\int \cot \left (f x +e \right )^{n} \tan \left (f x +e \right )d x \right ) i \right ) \] Input:

int((d*cot(f*x+e))^n*(a+I*a*tan(f*x+e)),x)
 

Output:

d**n*a*(int(cot(e + f*x)**n,x) + int(cot(e + f*x)**n*tan(e + f*x),x)*i)