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)/(2*sin(x)+sin(x)^2)^(1/2))

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 19, normalized size of antiderivative = 1.00, 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 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])

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 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]

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.02, 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])]

________________________________________________________________________________________

fricas [B]  time = 2.96, size = 35, normalized size = 1.84 \[ \frac {1}{2} \, \log \left (-2 \, \cos \relax (x)^{2} + 2 \, \sqrt {-\cos \relax (x)^{2} + 2 \, \sin \relax (x) + 1} {\left (\sin \relax (x) + 1\right )} + 4 \, \sin \relax (x) + 3\right ) \]

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)

________________________________________________________________________________________

giac [A]  time = 0.16, size = 20, normalized size = 1.05 \[ -\log \left (-\sqrt {\sin \relax (x)^{2} + 2 \, \sin \relax (x)} + \sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

maple [A]  time = 0.10, size = 17, normalized size = 0.89 \[ \ln \left (\sin \relax (x )+1+\sqrt {2 \sin \relax (x )+\sin ^{2}\relax (x )}\right ) \]

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(sin(x)+1+(2*sin(x)+sin(x)^2)^(1/2))

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 20, normalized size = 1.05 \[ \log \left (2 \, \sqrt {\sin \relax (x)^{2} + 2 \, \sin \relax (x)} + 2 \, \sin \relax (x) + 2\right ) \]

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)

________________________________________________________________________________________

mupad [B]  time = 3.17, size = 14, normalized size = 0.74 \[ \ln \left (\sin \relax (x)+\sqrt {\sin \relax (x)\,\left (\sin \relax (x)+2\right )}+1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos {\relax (x )}}{\sqrt {\left (\sin {\relax (x )} + 2\right ) \sin {\relax (x )}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________