\(\int \cot (c+d x) \sqrt {a+b \tan (c+d x)} \, dx\) [508]

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

Optimal result

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

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

Mathematica [A] (verified)

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

Integrate[Cot[c + d*x]*Sqrt[a + b*Tan[c + d*x]],x]
 

Output:

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

Rubi [A] (warning: unable to verify)

Time = 0.95 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.01, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {3042, 4055, 3042, 4022, 3042, 4020, 25, 73, 221, 4117, 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 (c+d x) \sqrt {a+b \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4055

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4022

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4020

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

\(\Big \downarrow \) 4117

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

Int[Cot[c + d*x]*Sqrt[a + b*Tan[c + d*x]],x]
 

Output:

((I*a + b)*ArcTan[Tan[c + d*x]/Sqrt[a - I*b]])/(Sqrt[a - I*b]*d) - ((I*a - 
 b)*ArcTan[Tan[c + d*x]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d) - (2*Sqrt[a]*Arc 
Tanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/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]
 

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

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

rule 4117
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) 
+ (f_.)*(x_)])^(n_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> 
 Simp[A/f   Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x] /; 
FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]
 
Maple [B] (warning: unable to verify)

result has leaf size over 500,000. Avoiding possible recursion issues.

Time = 34.92 (sec) , antiderivative size = 1275221, normalized size of antiderivative = 10993.28

\[\text {output too large to display}\]

Input:

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

Output:

result too large to display
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 296 vs. \(2 (90) = 180\).

Time = 0.10 (sec) , antiderivative size = 611, normalized size of antiderivative = 5.27 \[ \int \cot (c+d x) \sqrt {a+b \tan (c+d x)} \, dx=\left [\frac {d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} \log \left (d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) - d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} \log \left (-d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) + d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} \log \left (d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) - d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} \log \left (-d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) + 2 \, \sqrt {a} \log \left (\frac {b \tan \left (d x + c\right ) - 2 \, \sqrt {b \tan \left (d x + c\right ) + a} \sqrt {a} + 2 \, a}{\tan \left (d x + c\right )}\right )}{2 \, d}, \frac {d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} \log \left (d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) - d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} \log \left (-d \sqrt {\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} + a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) + d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} \log \left (d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) - d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} \log \left (-d \sqrt {-\frac {d^{2} \sqrt {-\frac {b^{2}}{d^{4}}} - a}{d^{2}}} + \sqrt {b \tan \left (d x + c\right ) + a}\right ) + 4 \, \sqrt {-a} \arctan \left (\frac {\sqrt {-a}}{\sqrt {b \tan \left (d x + c\right ) + a}}\right )}{2 \, d}\right ] \] Input:

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

Output:

[1/2*(d*sqrt((d^2*sqrt(-b^2/d^4) + a)/d^2)*log(d*sqrt((d^2*sqrt(-b^2/d^4) 
+ a)/d^2) + sqrt(b*tan(d*x + c) + a)) - d*sqrt((d^2*sqrt(-b^2/d^4) + a)/d^ 
2)*log(-d*sqrt((d^2*sqrt(-b^2/d^4) + a)/d^2) + sqrt(b*tan(d*x + c) + a)) + 
 d*sqrt(-(d^2*sqrt(-b^2/d^4) - a)/d^2)*log(d*sqrt(-(d^2*sqrt(-b^2/d^4) - a 
)/d^2) + sqrt(b*tan(d*x + c) + a)) - d*sqrt(-(d^2*sqrt(-b^2/d^4) - a)/d^2) 
*log(-d*sqrt(-(d^2*sqrt(-b^2/d^4) - a)/d^2) + sqrt(b*tan(d*x + c) + a)) + 
2*sqrt(a)*log((b*tan(d*x + c) - 2*sqrt(b*tan(d*x + c) + a)*sqrt(a) + 2*a)/ 
tan(d*x + c)))/d, 1/2*(d*sqrt((d^2*sqrt(-b^2/d^4) + a)/d^2)*log(d*sqrt((d^ 
2*sqrt(-b^2/d^4) + a)/d^2) + sqrt(b*tan(d*x + c) + a)) - d*sqrt((d^2*sqrt( 
-b^2/d^4) + a)/d^2)*log(-d*sqrt((d^2*sqrt(-b^2/d^4) + a)/d^2) + sqrt(b*tan 
(d*x + c) + a)) + d*sqrt(-(d^2*sqrt(-b^2/d^4) - a)/d^2)*log(d*sqrt(-(d^2*s 
qrt(-b^2/d^4) - a)/d^2) + sqrt(b*tan(d*x + c) + a)) - d*sqrt(-(d^2*sqrt(-b 
^2/d^4) - a)/d^2)*log(-d*sqrt(-(d^2*sqrt(-b^2/d^4) - a)/d^2) + sqrt(b*tan( 
d*x + c) + a)) + 4*sqrt(-a)*arctan(sqrt(-a)/sqrt(b*tan(d*x + c) + a)))/d]
 

Sympy [F]

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

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

Output:

Integral(sqrt(a + b*tan(c + d*x))*cot(c + d*x), x)
 

Maxima [F]

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

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

Output:

integrate(sqrt(b*tan(d*x + c) + a)*cot(d*x + c), x)
 

Giac [F(-1)]

Timed out. \[ \int \cot (c+d x) \sqrt {a+b \tan (c+d x)} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Mupad [B] (verification not implemented)

Time = 1.30 (sec) , antiderivative size = 682, normalized size of antiderivative = 5.88 \[ \int \cot (c+d x) \sqrt {a+b \tan (c+d x)} \, dx =\text {Too large to display} \] Input:

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

Output:

- atan((a^2*b^10*(a/(4*d^2) - (b*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x))^( 
1/2)*128i)/((16*a*b^12)/d - (a^2*b^11*48i)/d + (16*a^3*b^10)/d - (a^4*b^9* 
48i)/d) - (32*a*b^11*(a/(4*d^2) - (b*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x 
))^(1/2))/((16*a*b^12)/d - (a^2*b^11*48i)/d + (16*a^3*b^10)/d - (a^4*b^9*4 
8i)/d) + (96*a^3*b^9*(a/(4*d^2) - (b*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x 
))^(1/2))/((16*a*b^12)/d - (a^2*b^11*48i)/d + (16*a^3*b^10)/d - (a^4*b^9*4 
8i)/d))*((a - b*1i)/(4*d^2))^(1/2)*2i - atan((32*a*b^11*(a/(4*d^2) + (b*1i 
)/(4*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2))/((16*a*b^12)/d + (a^2*b^11*48 
i)/d + (16*a^3*b^10)/d + (a^4*b^9*48i)/d) + (a^2*b^10*(a/(4*d^2) + (b*1i)/ 
(4*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2)*128i)/((16*a*b^12)/d + (a^2*b^11 
*48i)/d + (16*a^3*b^10)/d + (a^4*b^9*48i)/d) - (96*a^3*b^9*(a/(4*d^2) + (b 
*1i)/(4*d^2))^(1/2)*(a + b*tan(c + d*x))^(1/2))/((16*a*b^12)/d + (a^2*b^11 
*48i)/d + (16*a^3*b^10)/d + (a^4*b^9*48i)/d))*((a + b*1i)/(4*d^2))^(1/2)*2 
i - (2*a^(1/2)*atanh((64*a^(1/2)*b^12*(a + b*tan(c + d*x))^(1/2))/(64*a*b^ 
12 + 640*a^3*b^10 + 576*a^5*b^8) + (640*a^(5/2)*b^10*(a + b*tan(c + d*x))^ 
(1/2))/(64*a*b^12 + 640*a^3*b^10 + 576*a^5*b^8) + (576*a^(9/2)*b^8*(a + b* 
tan(c + d*x))^(1/2))/(64*a*b^12 + 640*a^3*b^10 + 576*a^5*b^8)))/d
 

Reduce [F]

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

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

Output:

int(sqrt(tan(c + d*x)*b + a)*cot(c + d*x),x)