3.7.73 \(\int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx\) [673]

3.7.73.1 Optimal result
3.7.73.2 Mathematica [B] (verified)
3.7.73.3 Rubi [A] (verified)
3.7.73.4 Maple [A] (verified)
3.7.73.5 Fricas [B] (verification not implemented)
3.7.73.6 Sympy [F]
3.7.73.7 Maxima [A] (verification not implemented)
3.7.73.8 Giac [A] (verification not implemented)
3.7.73.9 Mupad [B] (verification not implemented)

3.7.73.1 Optimal result

Integrand size = 16, antiderivative size = 19 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=2 \text {arctanh}\left (\frac {\sin (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}}\right ) \]

output
2*arctanh(sin(x)/(2*sin(x)+sin(x)^2)^(1/2))
 
3.7.73.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(40\) vs. \(2(19)=38\).

Time = 0.02 (sec) , antiderivative size = 40, normalized size of antiderivative = 2.11 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=\frac {2 \text {arcsinh}\left (\frac {\sqrt {\sin (x)}}{\sqrt {2}}\right ) \sqrt {\sin (x)} \sqrt {2+\sin (x)}}{\sqrt {\sin (x) (2+\sin (x))}} \]

input
Integrate[Cos[x]/Sqrt[2*Sin[x] + Sin[x]^2],x]
 
output
(2*ArcSinh[Sqrt[Sin[x]]/Sqrt[2]]*Sqrt[Sin[x]]*Sqrt[2 + Sin[x]])/Sqrt[Sin[x 
]*(2 + Sin[x])]
 
3.7.73.3 Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 3739, 1091, 219}

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 \frac {\cos (x)}{\sqrt {\sin ^2(x)+2 \sin (x)}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3739

\(\displaystyle \int \frac {1}{\sqrt {\sin ^2(x)+2 \sin (x)}}d\sin (x)\)

\(\Big \downarrow \) 1091

\(\displaystyle 2 \int \frac {1}{1-\frac {\sin ^2(x)}{\sin ^2(x)+2 \sin (x)}}d\frac {\sin (x)}{\sqrt {\sin ^2(x)+2 \sin (x)}}\)

\(\Big \downarrow \) 219

\(\displaystyle 2 \text {arctanh}\left (\frac {\sin (x)}{\sqrt {\sin ^2(x)+2 \sin (x)}}\right )\)

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

3.7.73.3.1 Defintions of rubi rules used

rule 219
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])
 

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3739
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]}, Simp[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] && Intege 
rQ[(m - 1)/2]
 
3.7.73.4 Maple [A] (verified)

Time = 1.22 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\ln \left (1+\sin \left (x \right )+\sqrt {2 \sin \left (x \right )+\sin \left (x \right )^{2}}\right )\) \(17\)
default \(\ln \left (1+\sin \left (x \right )+\sqrt {2 \sin \left (x \right )+\sin \left (x \right )^{2}}\right )\) \(17\)

input
int(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x,method=_RETURNVERBOSE)
 
output
ln(1+sin(x)+(2*sin(x)+sin(x)^2)^(1/2))
 
3.7.73.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 35 vs. \(2 (17) = 34\).

Time = 0.35 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.84 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=\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 ) \]

input
integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="fricas")
 
output
1/2*log(-2*cos(x)^2 + 2*sqrt(-cos(x)^2 + 2*sin(x) + 1)*(sin(x) + 1) + 4*si 
n(x) + 3)
 
3.7.73.6 Sympy [F]

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

input
integrate(cos(x)/(2*sin(x)+sin(x)**2)**(1/2),x)
 
output
Integral(cos(x)/sqrt((sin(x) + 2)*sin(x)), x)
 
3.7.73.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=\log \left (2 \, \sqrt {\sin \left (x\right )^{2} + 2 \, \sin \left (x\right )} + 2 \, \sin \left (x\right ) + 2\right ) \]

input
integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="maxima")
 
output
log(2*sqrt(sin(x)^2 + 2*sin(x)) + 2*sin(x) + 2)
 
3.7.73.8 Giac [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=-\log \left (-\sqrt {\sin \left (x\right )^{2} + 2 \, \sin \left (x\right )} + \sin \left (x\right ) + 1\right ) \]

input
integrate(cos(x)/(2*sin(x)+sin(x)^2)^(1/2),x, algorithm="giac")
 
output
-log(-sqrt(sin(x)^2 + 2*sin(x)) + sin(x) + 1)
 
3.7.73.9 Mupad [B] (verification not implemented)

Time = 26.44 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74 \[ \int \frac {\cos (x)}{\sqrt {2 \sin (x)+\sin ^2(x)}} \, dx=\ln \left (\sin \left (x\right )+\sqrt {\sin \left (x\right )\,\left (\sin \left (x\right )+2\right )}+1\right ) \]

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