Integrand size = 17, antiderivative size = 64 \[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\frac {\arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {a-b}}-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {b}} \] Output:
arctan((a-b)^(1/2)*cot(x)/(a+b*cot(x)^2)^(1/2))/(a-b)^(1/2)-arctanh(b^(1/2 )*cot(x)/(a+b*cot(x)^2)^(1/2))/b^(1/2)
Leaf count is larger than twice the leaf count of optimal. \(158\) vs. \(2(64)=128\).
Time = 0.16 (sec) , antiderivative size = 158, normalized size of antiderivative = 2.47 \[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\frac {\left (-\sqrt {-b} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {a-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )+\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )\right ) \sqrt {(a+b+(-a+b) \cos (2 x)) \csc ^2(x)} \sin (x)}{\sqrt {a-b} \sqrt {-b} \sqrt {-a-b+(a-b) \cos (2 x)}} \] Input:
Integrate[Cot[x]^2/Sqrt[a + b*Cot[x]^2],x]
Output:
((-(Sqrt[-b]*ArcTanh[(Sqrt[2]*Sqrt[a - b]*Cos[x])/Sqrt[-a - b + (a - b)*Co s[2*x]]]) + Sqrt[a - b]*ArcTanh[(Sqrt[2]*Sqrt[-b]*Cos[x])/Sqrt[-a - b + (a - b)*Cos[2*x]]])*Sqrt[(a + b + (-a + b)*Cos[2*x])*Csc[x]^2]*Sin[x])/(Sqrt [a - b]*Sqrt[-b]*Sqrt[-a - b + (a - b)*Cos[2*x]])
Time = 0.29 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {3042, 4153, 385, 224, 219, 291, 216}
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(x)}{\sqrt {a+b \cot ^2(x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan \left (x+\frac {\pi }{2}\right )^2}{\sqrt {a+b \tan \left (x+\frac {\pi }{2}\right )^2}}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle -\int \frac {\cot ^2(x)}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)\) |
\(\Big \downarrow \) 385 |
\(\displaystyle \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)-\int \frac {1}{\sqrt {b \cot ^2(x)+a}}d\cot (x)\) |
\(\Big \downarrow \) 224 |
\(\displaystyle \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)-\int \frac {1}{1-\frac {b \cot ^2(x)}{b \cot ^2(x)+a}}d\frac {\cot (x)}{\sqrt {b \cot ^2(x)+a}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {b}}\) |
\(\Big \downarrow \) 291 |
\(\displaystyle \int \frac {1}{1-\frac {(b-a) \cot ^2(x)}{b \cot ^2(x)+a}}d\frac {\cot (x)}{\sqrt {b \cot ^2(x)+a}}-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {b}}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {a-b}}-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{\sqrt {b}}\) |
Input:
Int[Cot[x]^2/Sqrt[a + b*Cot[x]^2],x]
Output:
ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]/Sqrt[a - b] - ArcTanh[(S qrt[b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]/Sqrt[b]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
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])
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] && !GtQ[a, 0]
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst [Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[(((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_)^2)^(q_.))/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[e^2/b Int[(e*x)^(m - 2)*(c + d*x^2)^q, x], x] - Simp[a* (e^2/b) Int[(e*x)^(m - 2)*((c + d*x^2)^q/(a + b*x^2)), x], x] /; FreeQ[{a , b, c, d, e, m, q}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3] && IntBinomial Q[a, b, c, d, e, m, 2, -1, q, x]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.18 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.25
method | result | size |
derivativedivides | \(-\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \cot \left (x \right )^{2}}\right )}{\sqrt {b}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \cot \left (x \right )^{2}}}\right )}{b^{2} \left (a -b \right )}\) | \(80\) |
default | \(-\frac {\ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \cot \left (x \right )^{2}}\right )}{\sqrt {b}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \cot \left (x \right )^{2}}}\right )}{b^{2} \left (a -b \right )}\) | \(80\) |
Input:
int(cot(x)^2/(a+b*cot(x)^2)^(1/2),x,method=_RETURNVERBOSE)
Output:
-ln(b^(1/2)*cot(x)+(a+b*cot(x)^2)^(1/2))/b^(1/2)+(b^4*(a-b))^(1/2)/b^2/(a- b)*arctan(b^2*(a-b)/(b^4*(a-b))^(1/2)/(a+b*cot(x)^2)^(1/2)*cot(x))
Leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (52) = 104\).
Time = 0.10 (sec) , antiderivative size = 612, normalized size of antiderivative = 9.56 \[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx =\text {Too large to display} \] Input:
integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="fricas")
Output:
[-1/2*(sqrt(-a + b)*b*log(-(a - b)*cos(2*x) + sqrt(-a + b)*sqrt(((a - b)*c os(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) + b) - (a - b)*sqrt(b)*log(((a - 2*b)*cos(2*x) + 2*sqrt(b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1)) *sin(2*x) - a - 2*b)/(cos(2*x) - 1)))/(a*b - b^2), 1/2*(2*(a - b)*sqrt(-b) *arctan(-sqrt(-b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) /((a - b)*cos(2*x) - a - b)) - sqrt(-a + b)*b*log(-(a - b)*cos(2*x) + sqrt (-a + b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) + b))/(a *b - b^2), 1/2*(2*sqrt(a - b)*b*arctan(-sqrt(a - b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/((a - b)*cos(2*x) - a - b)) + (a - b)*s qrt(b)*log(((a - 2*b)*cos(2*x) + 2*sqrt(b)*sqrt(((a - b)*cos(2*x) - a - b) /(cos(2*x) - 1))*sin(2*x) - a - 2*b)/(cos(2*x) - 1)))/(a*b - b^2), (sqrt(a - b)*b*arctan(-sqrt(a - b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1) )*sin(2*x)/((a - b)*cos(2*x) - a - b)) + (a - b)*sqrt(-b)*arctan(-sqrt(-b) *sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/((a - b)*cos(2*x ) - a - b)))/(a*b - b^2)]
\[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\int \frac {\cot ^{2}{\left (x \right )}}{\sqrt {a + b \cot ^{2}{\left (x \right )}}}\, dx \] Input:
integrate(cot(x)**2/(a+b*cot(x)**2)**(1/2),x)
Output:
Integral(cot(x)**2/sqrt(a + b*cot(x)**2), x)
\[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\int { \frac {\cot \left (x\right )^{2}}{\sqrt {b \cot \left (x\right )^{2} + a}} \,d x } \] Input:
integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="maxima")
Output:
integrate(cot(x)^2/sqrt(b*cot(x)^2 + a), x)
Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (52) = 104\).
Time = 0.17 (sec) , antiderivative size = 229, normalized size of antiderivative = 3.58 \[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\frac {{\left (2 \, a \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) - 2 \, b \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) + \sqrt {a b - b^{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{2 \, \sqrt {a b - b^{2}} \sqrt {-a + b}} - \frac {\frac {2 \, \sqrt {-a + b} \arctan \left (\frac {{\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} + a - 2 \, b}{2 \, \sqrt {a b - b^{2}}}\right )}{\sqrt {a b - b^{2}}} + \frac {\log \left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a + b}}}{2 \, \mathrm {sgn}\left (\sin \left (x\right )\right )} \] Input:
integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="giac")
Output:
1/2*(2*a*arctan(sqrt(-a + b)*sqrt(b)/sqrt(a*b - b^2)) - 2*b*arctan(sqrt(-a + b)*sqrt(b)/sqrt(a*b - b^2)) + sqrt(a*b - b^2)*log(-a - 2*sqrt(-a + b)*s qrt(b) + 2*b))*sgn(sin(x))/(sqrt(a*b - b^2)*sqrt(-a + b)) - 1/2*(2*sqrt(-a + b)*arctan(1/2*((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a ))^2 + a - 2*b)/sqrt(a*b - b^2))/sqrt(a*b - b^2) + log((sqrt(-a + b)*cos(x ) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2)/sqrt(-a + b))/sgn(sin(x))
Timed out. \[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\int \frac {{\mathrm {cot}\left (x\right )}^2}{\sqrt {b\,{\mathrm {cot}\left (x\right )}^2+a}} \,d x \] Input:
int(cot(x)^2/(a + b*cot(x)^2)^(1/2),x)
Output:
int(cot(x)^2/(a + b*cot(x)^2)^(1/2), x)
\[ \int \frac {\cot ^2(x)}{\sqrt {a+b \cot ^2(x)}} \, dx=\int \frac {\sqrt {\cot \left (x \right )^{2} b +a}\, \cot \left (x \right )^{2}}{\cot \left (x \right )^{2} b +a}d x \] Input:
int(cot(x)^2/(a+b*cot(x)^2)^(1/2),x)
Output:
int((sqrt(cot(x)**2*b + a)*cot(x)**2)/(cot(x)**2*b + a),x)