\(\int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx\) [331]

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 = 116 \[ \int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx=-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}+\frac {i \operatorname {Hypergeometric2F1}\left (1,m,1+m,\frac {1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^m}{2 d m}-\frac {i \operatorname {Hypergeometric2F1}(1,m,1+m,1+i \tan (c+d x)) (a+i a \tan (c+d x))^m}{d} \] Output:

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

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.71 \[ \int \cot ^2(c+d x) (a+i a \tan (c+d x))^m \, dx=\frac {i \left (2 i m \cot (c+d x)+\operatorname {Hypergeometric2F1}\left (1,m,1+m,\frac {1}{2} (1+i \tan (c+d x))\right )-2 m \operatorname {Hypergeometric2F1}(1,m,1+m,1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^m}{2 d m} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.68 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.09, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3042, 4044, 3042, 4083, 3042, 3962, 78, 4082, 75}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4044

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4083

\(\displaystyle \frac {i m \int \cot (c+d x) (a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^mdx-a \int (i \tan (c+d x) a+a)^mdx}{a}-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {i m \int \frac {(a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^m}{\tan (c+d x)}dx-a \int (i \tan (c+d x) a+a)^mdx}{a}-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}\)

\(\Big \downarrow \) 3962

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

\(\Big \downarrow \) 78

\(\displaystyle \frac {i m \int \frac {(a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^m}{\tan (c+d x)}dx+\frac {i a (a+i a \tan (c+d x))^m \operatorname {Hypergeometric2F1}\left (1,m,m+1,\frac {i \tan (c+d x) a+a}{2 a}\right )}{2 d m}}{a}-\frac {\cot (c+d x) (a+i a \tan (c+d x))^m}{d}\)

\(\Big \downarrow \) 4082

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

\(\Big \downarrow \) 75

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

Input:

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

Output:

-((Cot[c + d*x]*(a + I*a*Tan[c + d*x])^m)/d) + (((-I)*a*Hypergeometric2F1[ 
1, m, 1 + m, 1 + I*Tan[c + d*x]]*(a + I*a*Tan[c + d*x])^m)/d + ((I/2)*a*Hy 
pergeometric2F1[1, m, 1 + m, (a + I*a*Tan[c + d*x])/(2*a)]*(a + I*a*Tan[c 
+ d*x])^m)/(d*m))/a
 

Defintions of rubi rules used

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

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

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

rule 3962
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[-b/d   S 
ubst[Int[(a + x)^(n - 1)/(a - x), x], x, b*Tan[c + d*x]], x] /; FreeQ[{a, b 
, c, d, n}, x] && EqQ[a^2 + b^2, 0]
 

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

rule 4082
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
(f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim 
p[b*(B/f)   Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x]], 
x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[ 
a^2 + b^2, 0] && EqQ[A*b + a*B, 0]
 

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

\[\int \cot \left (d x +c \right )^{2} \left (a +i a \tan \left (d x +c \right )\right )^{m}d x\]

Input:

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x)
 

Output:

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x)
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**m,x)
 

Output:

Integral((I*a*(tan(c + d*x) - I))**m*cot(c + d*x)**2, x)
 

Maxima [F]

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

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

Output:

integrate((I*a*tan(d*x + c) + a)^m*cot(d*x + c)^2, x)
 

Giac [F]

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

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

Output:

integrate((I*a*tan(d*x + c) + a)^m*cot(d*x + c)^2, x)
 

Mupad [F(-1)]

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

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^m,x)
 

Output:

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^m, x)
 

Reduce [F]

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

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^m,x)
 

Output:

int((tan(c + d*x)*a*i + a)**m*cot(c + d*x)**2,x)