\(\int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx\) [91]

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

Optimal result

Integrand size = 27, antiderivative size = 45 \[ \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx=-\frac {2 i \text {arctanh}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d} \] Output:

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

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00 \[ \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx=-\frac {2 i \text {arctanh}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d} \] Input:

Integrate[(1 - I*Cot[c + d*x])/Sqrt[a + b*Cot[c + d*x]],x]
 

Output:

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

Rubi [A] (warning: unable to verify)

Time = 0.26 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.78, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3042, 4020, 25, 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 {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4020

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

\(\displaystyle -\frac {2 \arctan \left (\frac {\cot (c+d x)}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}\)

Input:

Int[(1 - I*Cot[c + d*x])/Sqrt[a + b*Cot[c + d*x]],x]
 

Output:

(-2*ArcTan[Cot[c + d*x]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], 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 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 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]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 738 vs. \(2 (36 ) = 72\).

Time = 0.47 (sec) , antiderivative size = 739, normalized size of antiderivative = 16.42

method result size
derivativedivides \(\frac {\frac {\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a -\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b -\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}+\frac {-\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (i \sqrt {a^{2}+b^{2}}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}+\sqrt {a^{2}+b^{2}}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2} b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{3}+\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, \left (\sqrt {a^{2}+b^{2}}\, a +a^{2}+b^{2}\right )}}{d}\) \(739\)
default \(\frac {\frac {\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a -\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b -\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}+\frac {-\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (i \sqrt {a^{2}+b^{2}}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}+\sqrt {a^{2}+b^{2}}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2} b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{3}+\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqr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+b^2)^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b+(2*(a^2+b^2 
)^(1/2)+2*a)^(1/2)*a^2*b+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*b^3+1/2*(-2*I*(a^2+ 
b^2)^(1/2)*a^2-I*(a^2+b^2)^(1/2)*b^2-2*I*a^3-2*I*a*b^2-(a^2+b^2)^(1/2)*a*b 
-a^2*b-b^3)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*a 
rctan(((2*(a^2+b^2)^(1/2)+2*a)^(1/2)-2*(a+b*cot(d*x+c))^(1/2))/(2*(a^2+b^2 
)^(1/2)-2*a)^(1/2))))
 

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. 159 vs. \(2 (33) = 66\).

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

integrate((-I*cot(d*x + c) + 1)/sqrt(b*cot(d*x + c) + a), x)
                                                                                    
                                                                                    
 

Giac [F]

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

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

Output:

integrate((-I*cot(d*x + c) + 1)/sqrt(b*cot(d*x + c) + a), x)
 

Mupad [B] (verification not implemented)

Time = 10.41 (sec) , antiderivative size = 1410, normalized size of antiderivative = 31.33 \[ \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx=\text {Too large to display} \] Input:

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

Output:

(log(d*(-1/(d^2*(a - b*1i)))^(1/2)*(a + b*cot(c + d*x))^(1/2)*1i + 1)*(-1/ 
(a*d^2 - b*d^2*1i))^(1/2))/2 - log(d*(-1/(d^2*(a - b*1i)))^(1/2)*(a + b*co 
t(c + d*x))^(1/2) + 1i)*(-1/(4*(a*d^2 - b*d^2*1i)))^(1/2) + (log(16*b^3*d* 
(-1/(d^2*(a - b*1i)))^(1/2) - 16*b^2*(a + b*cot(c + d*x))^(1/2) + (16*a*b^ 
2*(a + b*cot(c + d*x))^(1/2))/(a - b*1i))*(-1/(a*d^2 - b*d^2*1i))^(1/2))/2 
 - log(16*b^2*(a + b*cot(c + d*x))^(1/2) + 16*b^3*d*(-1/(d^2*(a - b*1i)))^ 
(1/2) - (16*a*b^2*(a + b*cot(c + d*x))^(1/2))/(a - b*1i))*(-1/(4*(a*d^2 - 
b*d^2*1i)))^(1/2) - 2*atanh((32*b^2*(a + b*cot(c + d*x))^(1/2)*((b*1i)/(4* 
a^2*d^2 + 4*b^2*d^2) - a/(4*a^2*d^2 + 4*b^2*d^2))^(1/2))/((b^4*d^2*64i)/(4 
*a^2*d^3 + 4*b^2*d^3) - (64*a*b^3*d^2)/(4*a^2*d^3 + 4*b^2*d^3)) + (a*b^3*( 
a + b*cot(c + d*x))^(1/2)*((b*1i)/(4*a^2*d^2 + 4*b^2*d^2) - a/(4*a^2*d^2 + 
 4*b^2*d^2))^(1/2)*128i)/((b^6*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) + (a^2*b^ 
4*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) - (256*a^3*b^3*d^2)/(4*a^2*d^3 + 4*b^2 
*d^3) - (256*a*b^5*d^2)/(4*a^2*d^3 + 4*b^2*d^3)) - (128*a^2*b^2*(a + b*cot 
(c + d*x))^(1/2)*((b*1i)/(4*a^2*d^2 + 4*b^2*d^2) - a/(4*a^2*d^2 + 4*b^2*d^ 
2))^(1/2))/((b^6*d^2*256i)/(4*a^2*d^3 + 4*b^2*d^3) + (a^2*b^4*d^2*256i)/(4 
*a^2*d^3 + 4*b^2*d^3) - (256*a^3*b^3*d^2)/(4*a^2*d^3 + 4*b^2*d^3) - (256*a 
*b^5*d^2)/(4*a^2*d^3 + 4*b^2*d^3)))*(-(a - b*1i)/(4*a^2*d^2 + 4*b^2*d^2))^ 
(1/2) + 2*atanh((32*b^2*(a + b*cot(c + d*x))^(1/2)*((b*1i)/(4*a^2*d^2 + 4* 
b^2*d^2) - a/(4*a^2*d^2 + 4*b^2*d^2))^(1/2))/((a^2*b^2*d^2*64i)/(4*a^2*...
 

Reduce [F]

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

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

Output:

int(sqrt(cot(c + d*x)*b + a)/(cot(c + d*x)*b + a),x) - int((sqrt(cot(c + d 
*x)*b + a)*cot(c + d*x))/(cot(c + d*x)*b + a),x)*i