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

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 = 111 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \] Output:

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

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {-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 )-\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.75 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.05, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3042, 4044, 27, 2011, 3042, 4037, 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 \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4044

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4037

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3961

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

\(\Big \downarrow \) 219

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

\(\Big \downarrow \) 4082

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

((I/2)*((-2*a^(3/2)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/Sqrt[a]])/d + (2*Sq 
rt[2]*a^(3/2)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d))/a 
 - (Cot[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]])/d
 

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 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 2011
Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> 
 Simp[(b/d)^m   Int[u*(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, n}, x 
] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c + d*x 
, a + b*x])
 

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 4037
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(3/2)/((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[2*(a^2/(a*c - b*d))   Int[Sqrt[a + b*Tan[e 
 + f*x]], x], x] - Simp[(2*b*c*d + a*(c^2 - d^2))/(a*(c^2 + d^2))   Int[(a 
- b*Tan[e + f*x])*(Sqrt[a + b*Tan[e + f*x]]/(c + d*Tan[e + f*x])), x], x] / 
; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && 
 NeQ[c^2 + d^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]
 
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. 527 vs. \(2 (89 ) = 178\).

Time = 10.01 (sec) , antiderivative size = 528, normalized size of antiderivative = 4.76

method result size
default \(\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \left (\frac {2 \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \left (\cos \left (d x +c \right )-\cos \left (d x +c \right )^{2}\right )}{\cos \left (d x +c \right )+1}+\csc \left (d x +c \right )^{2} \sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \left (1-\cos \left (d x +c \right )\right )^{3}-4 \left (1-\cos \left (d x +c \right )\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}+i \left (\frac {12 \sin \left (d x +c \right ) \sqrt {2}\, \cos \left (d x +c \right )^{2} \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}{\left (\cos \left (d x +c \right )+1\right )^{2}}+\frac {6 \cot \left (d x +c \right ) \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \left (1-\cos \left (d x +c \right )\right )^{2}}{\cos \left (d x +c \right )+1}+3 \csc \left (d x +c \right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \left (1-\cos \left (d x +c \right )\right )^{2}\right )-6 \left (-1+\cos \left (d x +c \right )\right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {2}}{2}\right )+\left (3-3 \cos \left (d x +c \right )\right ) \arctan \left (\frac {\sqrt {2}}{2 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+6 i \left (-1+\cos \left (d x +c \right )\right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right ) \sqrt {2}}{\sqrt {\csc \left (d x +c \right )^{2} \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\right )+i \left (3-3 \cos \left (d x +c \right )\right ) \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 )\right )}{6 d \left (1-\cos \left (d x +c \right )\right ) \left (\cot \left (d x +c \right )-\csc \left (d x +c \right )+i\right )}\) \(528\)

Input:

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

Output:

1/6/d*(a*(1+I*tan(d*x+c)))^(1/2)*(-2*cos(d*x+c)/(cos(d*x+c)+1))^(1/2)/(1-c 
os(d*x+c))/(cot(d*x+c)-csc(d*x+c)+I)*(2*2^(1/2)/(cos(d*x+c)+1)*(-cos(d*x+c 
)/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)-cos(d*x+c)^2)+csc(d*x+c)^2*(-2*cos(d*x 
+c)/(cos(d*x+c)+1))^(1/2)*(1-cos(d*x+c))^3-4*(1-cos(d*x+c))*(-2*cos(d*x+c) 
/(cos(d*x+c)+1))^(1/2)+I*(12*sin(d*x+c)*2^(1/2)*cos(d*x+c)^2/(cos(d*x+c)+1 
)^2*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)+6*cot(d*x+c)*2^(1/2)/(cos(d*x+c)+1) 
*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1-cos(d*x+c))^2+3*csc(d*x+c)*(-2*cos( 
d*x+c)/(cos(d*x+c)+1))^(1/2)*(1-cos(d*x+c))^2)-6*(-1+cos(d*x+c))*2^(1/2)*a 
rctan(1/2*(-2*cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*2^(1/2))+(3-3*cos(d*x+c))*a 
rctan(1/2*2^(1/2)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))+6*I*(-1+cos(d*x+c))* 
2^(1/2)*arctanh(1/(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)*(csc(d*x+c)-cot( 
d*x+c))*2^(1/2))+I*(3-3*cos(d*x+c))*ln((-2*cos(d*x+c)/(cos(d*x+c)+1))^(1/2 
)-cot(d*x+c)+csc(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. 476 vs. \(2 (84) = 168\).

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.21 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \, a {\left (\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 )}{\sqrt {a}} - \frac {\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 )}{\sqrt {a}} - \frac {2 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a}}{a \tan \left (d x + c\right )}\right )}}{2 \, d} \] Input:

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

Output:

-1/2*I*a*(sqrt(2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqr 
t(2)*sqrt(a) + sqrt(I*a*tan(d*x + c) + a)))/sqrt(a) - log((sqrt(I*a*tan(d* 
x + c) + a) - sqrt(a))/(sqrt(I*a*tan(d*x + c) + a) + sqrt(a)))/sqrt(a) - 2 
*I*sqrt(I*a*tan(d*x + c) + a)/(a*tan(d*x + c)))/d
 

Giac [F(-2)]

Exception generated. \[ \int \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.07 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.87 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\mathrm {cot}\left (c+d\,x\right )\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}+\frac {\sqrt {2}\,\sqrt {-a}\,\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}}{d} \] Input:

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

Output:

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

Reduce [F]

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