\(\int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\) [115]

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

Optimal result

Integrand size = 26, antiderivative size = 141 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {i \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d}+\frac {i \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{a d} \] Output:

I*arctanh((a+I*a*tan(d*x+c))^(1/2)/a^(1/2))/a^(1/2)/d+1/2*I*arctanh(1/2*(a 
+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))*2^(1/2)/a^(1/2)/d+cot(d*x+c)/d/(a+ 
I*a*tan(d*x+c))^(1/2)-2*cot(d*x+c)*(a+I*a*tan(d*x+c))^(1/2)/a/d
 

Mathematica [A] (verified)

Time = 1.49 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.95 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {2 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )+i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )-\frac {2 \cot (c+d x) (2 i+\cot (c+d x)) \sqrt {a+i a \tan (c+d x)}}{i+\cot (c+d x)}}{2 a d} \] Input:

Integrate[Cot[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]
 

Output:

((2*I)*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/Sqrt[a]] + I*Sqrt[2]*Sqr 
t[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])] - (2*Cot[c + d* 
x]*(2*I + Cot[c + d*x])*Sqrt[a + I*a*Tan[c + d*x]])/(I + Cot[c + d*x]))/(2 
*a*d)
 

Rubi [A] (verified)

Time = 0.96 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.09, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3042, 4042, 27, 3042, 4081, 25, 3042, 4083, 3042, 3961, 219, 4082, 73, 221}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4042

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4081

\(\displaystyle \frac {\frac {\int -\cot (c+d x) \sqrt {i \tan (c+d x) a+a} \left (2 \tan (c+d x) a^2+i a^2\right )dx}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {-\frac {\int \cot (c+d x) \sqrt {i \tan (c+d x) a+a} \left (2 \tan (c+d x) a^2+i a^2\right )dx}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {\int \frac {\sqrt {i \tan (c+d x) a+a} \left (2 \tan (c+d x) a^2+i a^2\right )}{\tan (c+d x)}dx}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 4083

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3961

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

\(\Big \downarrow \) 219

\(\displaystyle \frac {-\frac {i a \int \frac {(a-i a \tan (c+d x)) \sqrt {i \tan (c+d x) a+a}}{\tan (c+d x)}dx-\frac {i \sqrt {2} a^{5/2} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 4082

\(\displaystyle \frac {-\frac {\frac {i a^3 \int \frac {\cot (c+d x)}{\sqrt {i \tan (c+d x) a+a}}d\tan (c+d x)}{d}-\frac {i \sqrt {2} a^{5/2} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {-\frac {\frac {2 a^2 \int \frac {1}{i-\frac {i (i \tan (c+d x) a+a)}{a}}d\sqrt {i \tan (c+d x) a+a}}{d}-\frac {i \sqrt {2} a^{5/2} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {-\frac {-\frac {2 i a^{5/2} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}-\frac {i \sqrt {2} a^{5/2} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}}{a}-\frac {4 a \cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}+\frac {\cot (c+d x)}{d \sqrt {a+i a \tan (c+d x)}}\)

Input:

Int[Cot[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]
 

Output:

Cot[c + d*x]/(d*Sqrt[a + I*a*Tan[c + d*x]]) + (-((((-2*I)*a^(5/2)*ArcTanh[ 
Sqrt[a + I*a*Tan[c + d*x]]/Sqrt[a]])/d - (I*Sqrt[2]*a^(5/2)*ArcTanh[Sqrt[a 
 + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d)/a) - (4*a*Cot[c + d*x]*Sqrt[a 
+ I*a*Tan[c + d*x]])/d)/(2*a^2)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

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

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

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

rule 4081
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[(A*d - B*c)*(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*(n + 1)*(c^2 + d^2))   Int[(a + b*Tan[e + 
f*x])^m*(c + d*Tan[e + f*x])^(n + 1)*Simp[A*(b*d*m - a*c*(n + 1)) - B*(b*c* 
m + a*d*(n + 1)) - a*(B*c - A*d)*(m + n + 1)*Tan[e + f*x], x], x], x] /; Fr 
eeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 
0] && LtQ[n, -1]
 

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 [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 450 vs. \(2 (116 ) = 232\).

Time = 15.48 (sec) , antiderivative size = 451, normalized size of antiderivative = 3.20

method result size
default \(\frac {\left (-2 \cos \left (d x +c \right )-2\right ) \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\cot \left (d x +c \right )-\csc \left (d x +c \right )+i\right )}{2 \sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}}\right )-2 i \sin \left (d x +c \right ) \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\cot \left (d x +c \right )-\csc \left (d x +c \right )+i\right )}{2 \sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}}\right )+\left (\cos \left (d x +c \right )+1\right ) \sqrt {2}\, \ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )+i \ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ) \sin \left (d x +c \right ) \sqrt {2}+i \left (-\cos \left (d x +c \right )-1\right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {2}}{2 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+\arctan \left (\frac {\sqrt {2}}{2 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \sqrt {2}\, \sin \left (d x +c \right )-4 i \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-8 i \cos \left (d x +c \right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-4 \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cot \left (d x +c \right )}{4 d \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {a \left (1+i \tan \left (d x +c \right )\right )}}\) \(451\)

Input:

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

Output:

1/4/d/(cos(d*x+c)+1)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)/(a*(1+I*tan(d*x+c) 
))^(1/2)*((-2*cos(d*x+c)-2)*arctanh(1/2*2^(1/2)*(cot(d*x+c)-csc(d*x+c)+I)/ 
(cot(d*x+c)^2-2*cot(d*x+c)*csc(d*x+c)+csc(d*x+c)^2-1)^(1/2))-2*I*sin(d*x+c 
)*arctanh(1/2*2^(1/2)*(cot(d*x+c)-csc(d*x+c)+I)/(cot(d*x+c)^2-2*cot(d*x+c) 
*csc(d*x+c)+csc(d*x+c)^2-1)^(1/2))+(cos(d*x+c)+1)*2^(1/2)*ln((-2*cos(d*x+c 
)/(cos(d*x+c)+1))^(1/2)-cot(d*x+c)+csc(d*x+c))+I*ln((-2*cos(d*x+c)/(cos(d* 
x+c)+1))^(1/2)-cot(d*x+c)+csc(d*x+c))*sin(d*x+c)*2^(1/2)+I*(-cos(d*x+c)-1) 
*2^(1/2)*arctan(1/2*2^(1/2)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))+arctan(1/2 
*2^(1/2)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))*2^(1/2)*sin(d*x+c)-4*I*(-2*co 
s(d*x+c)/(cos(d*x+c)+1))^(1/2)*2^(1/2)-8*I*cos(d*x+c)*(-cos(d*x+c)/(cos(d* 
x+c)+1))^(1/2)-4*(cos(d*x+c)+1)*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*cot(d*x 
+c))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 546 vs. \(2 (110) = 220\).

Time = 0.09 (sec) , antiderivative size = 546, normalized size of antiderivative = 3.87 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx =\text {Too large to display} \] Input:

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

Output:

1/4*(sqrt(2)*(I*a*d*e^(3*I*d*x + 3*I*c) - I*a*d*e^(I*d*x + I*c))*sqrt(1/(a 
*d^2))*log(4*((a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) 
+ 1))*sqrt(1/(a*d^2)) + a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) + sqrt(2)*(-I 
*a*d*e^(3*I*d*x + 3*I*c) + I*a*d*e^(I*d*x + I*c))*sqrt(1/(a*d^2))*log(-4*( 
(a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/( 
a*d^2)) - a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) + (I*a*d*e^(3*I*d*x + 3*I*c 
) - I*a*d*e^(I*d*x + I*c))*sqrt(1/(a*d^2))*log(16*(3*a^2*e^(2*I*d*x + 2*I* 
c) + 2*sqrt(2)*(a^2*d*e^(3*I*d*x + 3*I*c) + a^2*d*e^(I*d*x + I*c))*sqrt(a/ 
(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/(a*d^2)) + a^2)*e^(-2*I*d*x - 2*I*c)) + 
(-I*a*d*e^(3*I*d*x + 3*I*c) + I*a*d*e^(I*d*x + I*c))*sqrt(1/(a*d^2))*log(1 
6*(3*a^2*e^(2*I*d*x + 2*I*c) - 2*sqrt(2)*(a^2*d*e^(3*I*d*x + 3*I*c) + a^2* 
d*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/(a*d^2)) + a^2 
)*e^(-2*I*d*x - 2*I*c)) - 2*sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*(3*I 
*e^(4*I*d*x + 4*I*c) + 2*I*e^(2*I*d*x + 2*I*c) - I))/(a*d*e^(3*I*d*x + 3*I 
*c) - a*d*e^(I*d*x + I*c))
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.13 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {i \, a {\left (\frac {4 \, {\left (-2 i \, a \tan \left (d x + c\right ) - a\right )}}{{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} a - \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{2}} - \frac {\sqrt {2} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}{a^{\frac {3}{2}}} - \frac {2 \, \log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right )}{a^{\frac {3}{2}}}\right )}}{4 \, d} \] Input:

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

Output:

1/4*I*a*(4*(-2*I*a*tan(d*x + c) - a)/((I*a*tan(d*x + c) + a)^(3/2)*a - sqr 
t(I*a*tan(d*x + c) + a)*a^2) - sqrt(2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*ta 
n(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*x + c) + a)))/a^(3/2) - 
 2*log((sqrt(I*a*tan(d*x + c) + a) - sqrt(a))/(sqrt(I*a*tan(d*x + c) + a) 
+ sqrt(a)))/a^(3/2))/d
 

Giac [F(-2)]

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

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument TypeError: Bad 
Argument TypeDone
 

Mupad [B] (verification not implemented)

Time = 1.09 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.95 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {\frac {\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d}-\frac {a\,1{}\mathrm {i}}{d}}{a\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}-\frac {\mathrm {atan}\left (\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{\sqrt {-a}}\right )\,1{}\mathrm {i}}{\sqrt {-a}\,d}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d} \] Input:

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

Output:

(((a + a*tan(c + d*x)*1i)*2i)/d - (a*1i)/d)/(a*(a + a*tan(c + d*x)*1i)^(1/ 
2) - (a + a*tan(c + d*x)*1i)^(3/2)) - (atan((a + a*tan(c + d*x)*1i)^(1/2)/ 
(-a)^(1/2))*1i)/((-a)^(1/2)*d) - (2^(1/2)*atan((2^(1/2)*(a + a*tan(c + d*x 
)*1i)^(1/2))/(2*(-a)^(1/2)))*1i)/(2*(-a)^(1/2)*d)
 

Reduce [F]

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

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

Output:

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