3.1.74 \(\int \sqrt {\csc (x)-\sin (x)} \, dx\) [74]

Optimal. Leaf size=13 \[ 2 \sqrt {\cos (x) \cot (x)} \tan (x) \]

[Out]

2*(cos(x)*cot(x))^(1/2)*tan(x)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4482, 4485, 2669} \begin {gather*} 2 \tan (x) \sqrt {\cos (x) \cot (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[Csc[x] - Sin[x]],x]

[Out]

2*Sqrt[Cos[x]*Cot[x]]*Tan[x]

Rule 2669

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*(a*Sin[e
 + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*m)), x] /; FreeQ[{a, b, e, f, m, n}, x] && EqQ[m + n - 1, 0]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 4485

Int[(u_.)*((v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> With[{uu = ActivateTrig[u], vv = ActivateTrig[v], ww = Ac
tivateTrig[w]}, Dist[(vv^m*ww^n)^FracPart[p]/(vv^(m*FracPart[p])*ww^(n*FracPart[p])), Int[uu*vv^(m*p)*ww^(n*p)
, x], x]] /; FreeQ[{m, n, p}, x] &&  !IntegerQ[p] && ( !InertTrigFreeQ[v] ||  !InertTrigFreeQ[w])

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=\int \sqrt {\cos (x) \cot (x)} \, dx\\ &=\frac {\sqrt {\cos (x) \cot (x)} \int \sqrt {\cos (x)} \sqrt {\cot (x)} \, dx}{\sqrt {\cos (x)} \sqrt {\cot (x)}}\\ &=2 \sqrt {\cos (x) \cot (x)} \tan (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 13, normalized size = 1.00 \begin {gather*} 2 \sqrt {\cos (x) \cot (x)} \tan (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[Csc[x] - Sin[x]],x]

[Out]

2*Sqrt[Cos[x]*Cot[x]]*Tan[x]

________________________________________________________________________________________

Maple [A]
time = 0.36, size = 12, normalized size = 0.92

method result size
default \(2 \sqrt {\cos \left (x \right ) \cot \left (x \right )}\, \tan \left (x \right )\) \(12\)
risch \(-\frac {i \sqrt {2}\, \sqrt {\frac {i \left ({\mathrm e}^{2 i x}+1\right )^{2} {\mathrm e}^{-i x}}{{\mathrm e}^{2 i x}-1}}\, \left ({\mathrm e}^{2 i x}-1\right )}{{\mathrm e}^{2 i x}+1}\) \(51\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((csc(x)-sin(x))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*(cos(x)*cot(x))^(1/2)*tan(x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 188 vs. \(2 (11) = 22\).
time = 0.49, size = 188, normalized size = 14.46 \begin {gather*} \frac {{\left ({\left (\cos \left (\frac {3}{2} \, x\right ) - \cos \left (\frac {1}{2} \, x\right ) + \sin \left (\frac {3}{2} \, x\right ) + \sin \left (\frac {1}{2} \, x\right )\right )} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right ) - {\left (\cos \left (\frac {3}{2} \, x\right ) - \cos \left (\frac {1}{2} \, x\right ) - \sin \left (\frac {3}{2} \, x\right ) - \sin \left (\frac {1}{2} \, x\right )\right )} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right )\right )} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right )\right ) - {\left ({\left (\cos \left (\frac {3}{2} \, x\right ) - \cos \left (\frac {1}{2} \, x\right ) - \sin \left (\frac {3}{2} \, x\right ) - \sin \left (\frac {1}{2} \, x\right )\right )} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right ) + {\left (\cos \left (\frac {3}{2} \, x\right ) - \cos \left (\frac {1}{2} \, x\right ) + \sin \left (\frac {3}{2} \, x\right ) + \sin \left (\frac {1}{2} \, x\right )\right )} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right )\right )} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right )\right )}{{\left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right )}^{\frac {1}{4}} {\left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right )}^{\frac {1}{4}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^(1/2),x, algorithm="maxima")

[Out]

(((cos(3/2*x) - cos(1/2*x) + sin(3/2*x) + sin(1/2*x))*cos(1/2*arctan2(sin(x), cos(x) - 1)) - (cos(3/2*x) - cos
(1/2*x) - sin(3/2*x) - sin(1/2*x))*sin(1/2*arctan2(sin(x), cos(x) - 1)))*cos(1/2*arctan2(sin(x), cos(x) + 1))
- ((cos(3/2*x) - cos(1/2*x) - sin(3/2*x) - sin(1/2*x))*cos(1/2*arctan2(sin(x), cos(x) - 1)) + (cos(3/2*x) - co
s(1/2*x) + sin(3/2*x) + sin(1/2*x))*sin(1/2*arctan2(sin(x), cos(x) - 1)))*sin(1/2*arctan2(sin(x), cos(x) + 1))
)/((cos(x)^2 + sin(x)^2 + 2*cos(x) + 1)^(1/4)*(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1)^(1/4))

________________________________________________________________________________________

Fricas [A]
time = 0.59, size = 19, normalized size = 1.46 \begin {gather*} \frac {2 \, \sqrt {\frac {\cos \left (x\right )^{2}}{\sin \left (x\right )}} \sin \left (x\right )}{\cos \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^(1/2),x, algorithm="fricas")

[Out]

2*sqrt(cos(x)^2/sin(x))*sin(x)/cos(x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- \sin {\left (x \right )} + \csc {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))**(1/2),x)

[Out]

Integral(sqrt(-sin(x) + csc(x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(csc(x) - sin(x)), x)

________________________________________________________________________________________

Mupad [B]
time = 0.00, size = 15, normalized size = 1.15 \begin {gather*} \frac {2\,\left |\cos \left (x\right )\right |}{\cos \left (x\right )\,\sqrt {\frac {1}{\sin \left (x\right )}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/sin(x) - sin(x))^(1/2),x)

[Out]

(2*abs(cos(x)))/(cos(x)*(1/sin(x))^(1/2))

________________________________________________________________________________________

Chatgpt [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {not solved} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int((csc(x)-sin(x))^(1/2),x)

[Out]

not solved

________________________________________________________________________________________