3.673 \(\int \frac{\cos (x)}{\sqrt{2 \sin (x)+\sin ^2(x)}} \, dx\)

Optimal. Leaf size=19 \[ 2 \tanh ^{-1}\left (\frac{\sin (x)}{\sqrt{\sin ^2(x)+2 \sin (x)}}\right ) \]

[Out]

2*ArcTanh[Sin[x]/Sqrt[2*Sin[x] + Sin[x]^2]]

________________________________________________________________________________________

Rubi [A]  time = 0.0316316, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {3258, 620, 206} \[ 2 \tanh ^{-1}\left (\frac{\sin (x)}{\sqrt{\sin ^2(x)+2 \sin (x)}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]/Sqrt[2*Sin[x] + Sin[x]^2],x]

[Out]

2*ArcTanh[Sin[x]/Sqrt[2*Sin[x] + Sin[x]^2]]

Rule 3258

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*((f_.)*sin[(d_.) + (e_.)*(x_)])^(n_.) + (c_.)*((f_.)*sin[(d_.
) + (e_.)*(x_)])^(n2_.))^(p_.), x_Symbol] :> Module[{g = FreeFactors[Sin[d + e*x], x]}, Dist[g/e, Subst[Int[(1
 - g^2*x^2)^((m - 1)/2)*(a + b*(f*g*x)^n + c*(f*g*x)^(2*n))^p, x], x, Sin[d + e*x]/g], x]] /; FreeQ[{a, b, c,
d, e, f, n, p}, x] && EqQ[n2, 2*n] && IntegerQ[(m - 1)/2]

Rule 620

Int[1/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(1 - c*x^2), x], x, x/Sqrt[b*x + c*x^2
]], x] /; FreeQ[{b, c}, x]

Rule 206

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

Rubi steps

\begin{align*} \int \frac{\cos (x)}{\sqrt{2 \sin (x)+\sin ^2(x)}} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\sqrt{2 x+x^2}} \, dx,x,\sin (x)\right )\\ &=2 \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\frac{\sin (x)}{\sqrt{2 \sin (x)+\sin ^2(x)}}\right )\\ &=2 \tanh ^{-1}\left (\frac{\sin (x)}{\sqrt{2 \sin (x)+\sin ^2(x)}}\right )\\ \end{align*}

Mathematica [B]  time = 0.0181688, size = 40, normalized size = 2.11 \[ \frac{2 \sqrt{\sin (x)} \sqrt{\sin (x)+2} \sinh ^{-1}\left (\frac{\sqrt{\sin (x)}}{\sqrt{2}}\right )}{\sqrt{\sin (x) (\sin (x)+2)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/Sqrt[2*Sin[x] + Sin[x]^2],x]

[Out]

(2*ArcSinh[Sqrt[Sin[x]]/Sqrt[2]]*Sqrt[Sin[x]]*Sqrt[2 + Sin[x]])/Sqrt[Sin[x]*(2 + Sin[x])]

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 17, normalized size = 0.9 \begin{align*} \ln \left ( 1+\sin \left ( x \right ) +\sqrt{2\,\sin \left ( x \right ) + \left ( \sin \left ( x \right ) \right ) ^{2}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x)

[Out]

ln(1+sin(x)+(2*sin(x)+sin(x)^2)^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 0.952721, size = 27, normalized size = 1.42 \begin{align*} \log \left (2 \, \sqrt{\sin \left (x\right )^{2} + 2 \, \sin \left (x\right )} + 2 \, \sin \left (x\right ) + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="maxima")

[Out]

log(2*sqrt(sin(x)^2 + 2*sin(x)) + 2*sin(x) + 2)

________________________________________________________________________________________

Fricas [B]  time = 3.78977, size = 115, normalized size = 6.05 \begin{align*} \frac{1}{2} \, \log \left (-2 \, \cos \left (x\right )^{2} + 2 \, \sqrt{-\cos \left (x\right )^{2} + 2 \, \sin \left (x\right ) + 1}{\left (\sin \left (x\right ) + 1\right )} + 4 \, \sin \left (x\right ) + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*log(-2*cos(x)^2 + 2*sqrt(-cos(x)^2 + 2*sin(x) + 1)*(sin(x) + 1) + 4*sin(x) + 3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2*sin(x)+sin(x)**2)**(1/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.09747, size = 27, normalized size = 1.42 \begin{align*} -\log \left (-\sqrt{\sin \left (x\right )^{2} + 2 \, \sin \left (x\right )} + \sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="giac")

[Out]

-log(-sqrt(sin(x)^2 + 2*sin(x)) + sin(x) + 1)