\(\int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx\) [668]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 7 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\arcsin \left (\frac {\sin (x)}{2}\right ) \]

[Out]

arcsin(1/2*sin(x))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3269, 222} \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\arcsin \left (\frac {\sin (x)}{2}\right ) \]

[In]

Int[Cos[x]/Sqrt[4 - Sin[x]^2],x]

[Out]

ArcSin[Sin[x]/2]

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{\sqrt {4-x^2}} \, dx,x,\sin (x)\right ) \\ & = \arcsin \left (\frac {\sin (x)}{2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\arcsin \left (\frac {\sin (x)}{2}\right ) \]

[In]

Integrate[Cos[x]/Sqrt[4 - Sin[x]^2],x]

[Out]

ArcSin[Sin[x]/2]

Maple [A] (verified)

Time = 0.58 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.86

method result size
derivativedivides \(\arcsin \left (\frac {\sin \left (x \right )}{2}\right )\) \(6\)
default \(\arcsin \left (\frac {\sin \left (x \right )}{2}\right )\) \(6\)

[In]

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

[Out]

arcsin(1/2*sin(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (5) = 10\).

Time = 0.25 (sec) , antiderivative size = 53, normalized size of antiderivative = 7.57 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\frac {1}{2} \, \arctan \left (\frac {\sqrt {\cos \left (x\right )^{2} + 3} {\left (\cos \left (x\right )^{2} + 1\right )} \sin \left (x\right ) - 4 \, \cos \left (x\right ) \sin \left (x\right )}{\cos \left (x\right )^{4} + 6 \, \cos \left (x\right )^{2} - 3}\right ) + \frac {1}{2} \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right ) \]

[In]

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

[Out]

1/2*arctan((sqrt(cos(x)^2 + 3)*(cos(x)^2 + 1)*sin(x) - 4*cos(x)*sin(x))/(cos(x)^4 + 6*cos(x)^2 - 3)) + 1/2*arc
tan(sin(x)/cos(x))

Sympy [F]

\[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\int \frac {\cos {\left (x \right )}}{\sqrt {- \left (\sin {\left (x \right )} - 2\right ) \left (\sin {\left (x \right )} + 2\right )}}\, dx \]

[In]

integrate(cos(x)/(4-sin(x)**2)**(1/2),x)

[Out]

Integral(cos(x)/sqrt(-(sin(x) - 2)*(sin(x) + 2)), x)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\arcsin \left (\frac {1}{2} \, \sin \left (x\right )\right ) \]

[In]

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

[Out]

arcsin(1/2*sin(x))

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\arcsin \left (\frac {1}{2} \, \sin \left (x\right )\right ) \]

[In]

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

[Out]

arcsin(1/2*sin(x))

Mupad [B] (verification not implemented)

Time = 26.85 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int \frac {\cos (x)}{\sqrt {4-\sin ^2(x)}} \, dx=\mathrm {asin}\left (\frac {\sin \left (x\right )}{2}\right ) \]

[In]

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

[Out]

asin(sin(x)/2)