3.1.41 \(\int \log (\sin (x)) \sqrt {1+\sin (x)} \, dx\) [41]

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

[Out]

-4*arctanh(cos(x)/(1+sin(x))^(1/2))+4*cos(x)/(1+sin(x))^(1/2)-2*cos(x)*ln(sin(x))/(1+sin(x))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 7, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {2725, 2634, 12, 2953, 3060, 2852, 212} \begin {gather*} \frac {4 \cos (x)}{\sqrt {\sin (x)+1}}-\frac {2 \cos (x) \log (\sin (x))}{\sqrt {\sin (x)+1}}-4 \tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {\sin (x)+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Log[Sin[x]]*Sqrt[1 + Sin[x]],x]

[Out]

-4*ArcTanh[Cos[x]/Sqrt[1 + Sin[x]]] + (4*Cos[x])/Sqrt[1 + Sin[x]] - (2*Cos[x]*Log[Sin[x]])/Sqrt[1 + Sin[x]]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 212

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] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 2725

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2*b*(Cos[c + d*x]/(d*Sqrt[a + b*Sin[c + d*x
]])), x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2852

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-2*(
b/f), Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 2953

Int[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)
, x_Symbol] :> Dist[1/b^2, Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^(m + 1)*(a - b*Sin[e + f*x]), x], x] /;
 FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] && (ILtQ[m, 0] ||  !IGtQ[n, 0])

Rule 3060

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[-2*b*B*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(2*n + 3)*Sqrt
[a + b*Sin[e + f*x]])), x] + Dist[(A*b*d*(2*n + 3) - B*(b*c - 2*a*d*(n + 1)))/(b*d*(2*n + 3)), Int[Sqrt[a + b*
Sin[e + f*x]]*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] &&
EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &&  !LtQ[n, -1]

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(87\) vs. \(2(42)=84\).
time = 0.06, size = 87, normalized size = 2.07 \begin {gather*} \frac {2 \left (-\log \left (1+\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\log \left (1-\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )-\cos \left (\frac {x}{2}\right ) (-2+\log (\sin (x)))+(-2+\log (\sin (x))) \sin \left (\frac {x}{2}\right )\right ) \sqrt {1+\sin (x)}}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Log[Sin[x]]*Sqrt[1 + Sin[x]],x]

[Out]

(2*(-Log[1 + Cos[x/2] - Sin[x/2]] + Log[1 - Cos[x/2] + Sin[x/2]] - Cos[x/2]*(-2 + Log[Sin[x]]) + (-2 + Log[Sin
[x]])*Sin[x/2])*Sqrt[1 + Sin[x]])/(Cos[x/2] + Sin[x/2])

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Log[Sin[x]]*Sqrt[1 + Sin[x]],x]')

[Out]

cought exception: maximum recursion depth exceeded while calling a Python object

________________________________________________________________________________________

Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int \ln \left (\sin \left (x \right )\right ) \sqrt {\sin \left (x \right )+1}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(sqrt(sin(x) + 1)*log(sin(x)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 146 vs. \(2 (36) = 72\).
time = 0.35, size = 146, normalized size = 3.48 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (\frac {\cos \left (x\right )^{2} - {\left (\cos \left (x\right ) - 1\right )} \sin \left (x\right ) + 2 \, {\left (\cos \left (x\right ) - \sin \left (x\right ) + 1\right )} \sqrt {\sin \left (x\right ) + 1} + 2 \, \cos \left (x\right ) + 1}{2 \, {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )}}\right ) - {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (\frac {\cos \left (x\right )^{2} - {\left (\cos \left (x\right ) - 1\right )} \sin \left (x\right ) - 2 \, {\left (\cos \left (x\right ) - \sin \left (x\right ) + 1\right )} \sqrt {\sin \left (x\right ) + 1} + 2 \, \cos \left (x\right ) + 1}{2 \, {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )}}\right ) + 2 \, {\left ({\left (\cos \left (x\right ) - \sin \left (x\right ) + 1\right )} \log \left (\sin \left (x\right )\right ) - 2 \, \cos \left (x\right ) + 2 \, \sin \left (x\right ) - 2\right )} \sqrt {\sin \left (x\right ) + 1}}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(sqrt(sin(x) + 1)*log(sin(x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (36) = 72\).
time = 0.02, size = 132, normalized size = 3.14 \begin {gather*} \sqrt {2} \left (8 \left (\frac {-4294967296 \tan \left (\frac {x}{4}\right )+4294967296}{4294967296 \left (\sqrt {2} \left (\tan ^{2}\left (\frac {x}{4}\right )+1\right )\right )}+\frac {\ln \left |\tan \left (\frac {x}{4}\right )+1\right |}{4 \sqrt {2}}-\frac {\ln \left |\tan \left (\frac {x}{4}\right )-1\right |}{4 \sqrt {2}}+\frac {\ln \left |\tan \left (\frac {x}{4}\right )\right |}{4 \sqrt {2}}\right ) \mathrm {sign}\left (\cos \left (-\frac {\pi }{4}+\frac {x}{2}\right )\right )+2 \mathrm {sign}\left (\cos \left (-\frac {\pi }{4}+\frac {x}{2}\right )\right ) \sin \left (-\frac {\pi }{4}+\frac {x}{2}\right ) \ln \left (\sin x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*(2*log(sin(x))*sgn(cos(-1/4*pi + 1/2*x))*sin(-1/4*pi + 1/2*x) + (sqrt(2)*log(abs(tan(1/4*x) + 1)) - sq
rt(2)*log(abs(tan(1/4*x) - 1)) + sqrt(2)*log(abs(tan(1/4*x))) - 4*sqrt(2)*(tan(1/4*x) - 1)/(tan(1/4*x)^2 + 1))
*sgn(cos(-1/4*pi + 1/2*x)))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \ln \left (\sin \left (x\right )\right )\,\sqrt {\sin \left (x\right )+1} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________