Integrand size = 12, antiderivative size = 65 \[ \int \sqrt {a+b \cot ^2(x)} \, dx=-\sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right ) \] Output:
-(a-b)^(1/2)*arctan((a-b)^(1/2)*cot(x)/(a+b*cot(x)^2)^(1/2))-b^(1/2)*arcta nh(b^(1/2)*cot(x)/(a+b*cot(x)^2)^(1/2))
Time = 0.15 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.20 \[ \int \sqrt {a+b \cot ^2(x)} \, dx=\sqrt {a-b} \arctan \left (\frac {-\cot (x) \sqrt {a+b \cot ^2(x)}+\sqrt {b} \csc ^2(x)}{\sqrt {a-b}}\right )+\sqrt {b} \log \left (-\sqrt {b} \cot (x)+\sqrt {a+b \cot ^2(x)}\right ) \] Input:
Integrate[Sqrt[a + b*Cot[x]^2],x]
Output:
Sqrt[a - b]*ArcTan[(-(Cot[x]*Sqrt[a + b*Cot[x]^2]) + Sqrt[b]*Csc[x]^2)/Sqr t[a - b]] + Sqrt[b]*Log[-(Sqrt[b]*Cot[x]) + Sqrt[a + b*Cot[x]^2]]
Time = 0.25 (sec) , antiderivative size = 65, 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.583, Rules used = {3042, 4144, 301, 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 \sqrt {a+b \cot ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {a+b \tan \left (x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4144 |
\(\displaystyle -\int \frac {\sqrt {b \cot ^2(x)+a}}{\cot ^2(x)+1}d\cot (x)\) |
\(\Big \downarrow \) 301 |
\(\displaystyle -b \int \frac {1}{\sqrt {b \cot ^2(x)+a}}d\cot (x)-(a-b) \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)\) |
\(\Big \downarrow \) 224 |
\(\displaystyle -\left ((a-b) \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)\right )-b \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 -(a-b) \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\) |
\(\Big \downarrow \) 291 |
\(\displaystyle -(a-b) \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}}-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\) |
\(\Big \downarrow \) 216 |
\(\displaystyle -\sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\) |
Input:
Int[Sqrt[a + b*Cot[x]^2],x]
Output:
-(Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]) - Sqrt[b] *ArcTanh[(Sqrt[b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]
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[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[b/ d Int[(a + b*x^2)^(p - 1), x], x] - Simp[(b*c - a*d)/d Int[(a + b*x^2)^ (p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4] || (EqQ[p, 2/3] && E qQ[b*c + 3*a*d, 0]))
Int[((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[(a + b* (ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Leaf count of result is larger than twice the leaf count of optimal. \(136\) vs. \(2(53)=106\).
Time = 0.13 (sec) , antiderivative size = 137, normalized size of antiderivative = 2.11
method | result | size |
derivativedivides | \(-\sqrt {b}\, \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \cot \left (x \right )^{2}}\right )+\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 \left (a -b \right )}-\frac {a \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 )}\) | \(137\) |
default | \(-\sqrt {b}\, \ln \left (\sqrt {b}\, \cot \left (x \right )+\sqrt {a +b \cot \left (x \right )^{2}}\right )+\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 \left (a -b \right )}-\frac {a \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 )}\) | \(137\) |
Input:
int((a+b*cot(x)^2)^(1/2),x,method=_RETURNVERBOSE)
Output:
-b^(1/2)*ln(b^(1/2)*cot(x)+(a+b*cot(x)^2)^(1/2))+(b^4*(a-b))^(1/2)/b/(a-b) *arctan(b^2*(a-b)/(b^4*(a-b))^(1/2)/(a+b*cot(x)^2)^(1/2)*cot(x))-a*(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. 136 vs. \(2 (53) = 106\).
Time = 0.10 (sec) , antiderivative size = 539, normalized size of antiderivative = 8.29 \[ \int \sqrt {a+b \cot ^2(x)} \, dx=\left [\frac {1}{2} \, \sqrt {-a + b} \log \left (-{\left (a - b\right )} \cos \left (2 \, x\right ) + \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + b\right ) + \frac {1}{2} \, \sqrt {b} \log \left (\frac {{\left (a - 2 \, b\right )} \cos \left (2 \, x\right ) + 2 \, \sqrt {b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a - 2 \, b}{\cos \left (2 \, x\right ) - 1}\right ), -\sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}\right ) + \frac {1}{2} \, \sqrt {b} \log \left (\frac {{\left (a - 2 \, b\right )} \cos \left (2 \, x\right ) + 2 \, \sqrt {b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a - 2 \, b}{\cos \left (2 \, x\right ) - 1}\right ), \sqrt {-b} \arctan \left (-\frac {\sqrt {-b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}\right ) + \frac {1}{2} \, \sqrt {-a + b} \log \left (-{\left (a - b\right )} \cos \left (2 \, x\right ) + \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + b\right ), -\sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}\right ) + \sqrt {-b} \arctan \left (-\frac {\sqrt {-b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}\right )\right ] \] Input:
integrate((a+b*cot(x)^2)^(1/2),x, algorithm="fricas")
Output:
[1/2*sqrt(-a + 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) + 1/2*sqrt(b)*log(((a - 2*b)*co s(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)), -sqrt(a - 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)) + 1/2*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)), sqrt(-b)*arct an(-sqrt(-b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/((a - b)*cos(2*x) - a - b)) + 1/2*sqrt(-a + 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), -sqrt (a - 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)) + 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))]
\[ \int \sqrt {a+b \cot ^2(x)} \, dx=\int \sqrt {a + b \cot ^{2}{\left (x \right )}}\, dx \] Input:
integrate((a+b*cot(x)**2)**(1/2),x)
Output:
Integral(sqrt(a + b*cot(x)**2), x)
Exception generated. \[ \int \sqrt {a+b \cot ^2(x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((a+b*cot(x)^2)^(1/2),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more details)Is
Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (53) = 106\).
Time = 0.35 (sec) , antiderivative size = 210, normalized size of antiderivative = 3.23 \[ \int \sqrt {a+b \cot ^2(x)} \, dx=-\frac {1}{2} \, {\left (\frac {2 \, \sqrt {-a + b} 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}}} + \sqrt {-a + b} \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 )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) - \frac {{\left (2 \, \sqrt {-a + b} b \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) - \sqrt {a b - b^{2}} \sqrt {-a + b} \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}}} \] Input:
integrate((a+b*cot(x)^2)^(1/2),x, algorithm="giac")
Output:
-1/2*(2*sqrt(-a + b)*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) + sqrt(- a + b)*log((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2))* sgn(sin(x)) - 1/2*(2*sqrt(-a + b)*b*arctan(sqrt(-a + b)*sqrt(b)/sqrt(a*b - b^2)) - sqrt(a*b - b^2)*sqrt(-a + b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2* b))*sgn(sin(x))/sqrt(a*b - b^2)
Timed out. \[ \int \sqrt {a+b \cot ^2(x)} \, dx=\int \sqrt {b\,{\mathrm {cot}\left (x\right )}^2+a} \,d x \] Input:
int((a + b*cot(x)^2)^(1/2),x)
Output:
int((a + b*cot(x)^2)^(1/2), x)
\[ \int \sqrt {a+b \cot ^2(x)} \, dx=\int \sqrt {\cot \left (x \right )^{2} b +a}d x \] Input:
int((a+b*cot(x)^2)^(1/2),x)
Output:
int(sqrt(cot(x)**2*b + a),x)