\(\int \log (\sin (x)) \sin (x) \, dx\) [93]

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

Optimal result

Integrand size = 6, antiderivative size = 15 \[ \int \log (\sin (x)) \sin (x) \, dx=-\text {arctanh}(\cos (x))+\cos (x)-\cos (x) \log (\sin (x)) \]

[Out]

-arctanh(cos(x))+cos(x)-cos(x)*ln(sin(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {2718, 2634, 2672, 327, 212} \[ \int \log (\sin (x)) \sin (x) \, dx=-\text {arctanh}(\cos (x))+\cos (x)-\cos (x) \log (\sin (x)) \]

[In]

Int[Log[Sin[x]]*Sin[x],x]

[Out]

-ArcTanh[Cos[x]] + Cos[x] - Cos[x]*Log[Sin[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 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

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 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\cos (x) \log (\sin (x))+\int \cos (x) \cot (x) \, dx \\ & = -\cos (x) \log (\sin (x))-\text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (x)\right ) \\ & = \cos (x)-\cos (x) \log (\sin (x))-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right ) \\ & = -\text {arctanh}(\cos (x))+\cos (x)-\cos (x) \log (\sin (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.73 \[ \int \log (\sin (x)) \sin (x) \, dx=\cos (x)-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )-\cos (x) \log (\sin (x)) \]

[In]

Integrate[Log[Sin[x]]*Sin[x],x]

[Out]

Cos[x] - Log[Cos[x/2]] + Log[Sin[x/2]] - Cos[x]*Log[Sin[x]]

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33

method result size
parallelrisch \(-\cos \left (x \right ) \ln \left (\sin \left (x \right )\right )+\cos \left (x \right )+\ln \left (-\cot \left (x \right )+\csc \left (x \right )\right )+1\) \(20\)
norman \(\frac {2 \tan \left (\frac {x}{2}\right )^{2} \ln \left (\frac {2 \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )+2}{1+\tan \left (\frac {x}{2}\right )^{2}}+\ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )\) \(49\)
default \(-\frac {{\mathrm e}^{i x} \ln \left (i \left (1-{\mathrm e}^{2 i x}\right ) {\mathrm e}^{-i x}\right )}{2}+\frac {{\mathrm e}^{i x}}{2}+\ln \left (-1+{\mathrm e}^{i x}\right )-\ln \left ({\mathrm e}^{i x}+1\right )-\frac {{\mathrm e}^{-i x} \ln \left (i \left (1-{\mathrm e}^{2 i x}\right ) {\mathrm e}^{-i x}\right )}{2}+\frac {{\mathrm e}^{-i x}}{2}+\frac {\ln \left (2\right ) \left ({\mathrm e}^{i x}+{\mathrm e}^{-i x}\right )}{2}\) \(111\)
risch \(\ln \left ({\mathrm e}^{i x}\right ) \cos \left (x \right )+\frac {{\mathrm e}^{-i x} \ln \left (2\right )}{2}-\frac {{\mathrm e}^{-i x} \ln \left ({\mathrm e}^{2 i x}-1\right )}{2}-\frac {{\mathrm e}^{i x} \ln \left ({\mathrm e}^{2 i x}-1\right )}{2}+\frac {{\mathrm e}^{i x} \ln \left (2\right )}{2}+\frac {{\mathrm e}^{i x}}{2}-\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (\sin \left (x \right )\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \pi }{4}-\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (i \sin \left (x \right )\right ) \operatorname {csgn}\left (\sin \left (x \right )\right ) \pi }{4}+\frac {i {\mathrm e}^{i x} \pi \,\operatorname {csgn}\left (\sin \left (x \right )\right ) \operatorname {csgn}\left (i \sin \left (x \right )\right )^{2}}{4}+\frac {{\mathrm e}^{-i x}}{2}-\ln \left ({\mathrm e}^{i x}+1\right )+\ln \left (-1+{\mathrm e}^{i x}\right )+\frac {i {\mathrm e}^{i x} \pi }{4}+\frac {i {\mathrm e}^{-i x} \pi }{4}-\frac {i {\mathrm e}^{i x} \pi \operatorname {csgn}\left (\sin \left (x \right )\right )^{3}}{4}-\frac {i {\mathrm e}^{-i x} \pi \operatorname {csgn}\left (\sin \left (x \right )\right )^{3}}{4}+\frac {i {\mathrm e}^{-i x} \pi \operatorname {csgn}\left (i \sin \left (x \right )\right )^{3}}{4}+\frac {i {\mathrm e}^{i x} \pi \operatorname {csgn}\left (i \sin \left (x \right )\right )^{3}}{4}-\frac {i {\mathrm e}^{i x} \pi \operatorname {csgn}\left (i \sin \left (x \right )\right )^{2}}{4}-\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (i \sin \left (x \right )\right )^{2} \pi }{4}-\frac {i {\mathrm e}^{i x} \pi \,\operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \operatorname {csgn}\left (\sin \left (x \right )\right )^{2}}{4}-\frac {i {\mathrm e}^{i x} \pi \,\operatorname {csgn}\left (\sin \left (x \right )\right ) \operatorname {csgn}\left (i \sin \left (x \right )\right )}{4}+\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (i \sin \left (x \right )\right )^{2} \operatorname {csgn}\left (\sin \left (x \right )\right ) \pi }{4}-\frac {i {\mathrm e}^{i x} \pi \,\operatorname {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \operatorname {csgn}\left (\sin \left (x \right )\right )^{2}}{4}-\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (\sin \left (x \right )\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \pi }{4}-\frac {i {\mathrm e}^{-i x} \operatorname {csgn}\left (\sin \left (x \right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \pi }{4}-\frac {i {\mathrm e}^{i x} \pi \,\operatorname {csgn}\left (i {\mathrm e}^{2 i x}-i\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \operatorname {csgn}\left (\sin \left (x \right )\right )}{4}\) \(445\)

[In]

int(sin(x)*ln(sin(x)),x,method=_RETURNVERBOSE)

[Out]

-cos(x)*ln(sin(x))+cos(x)+ln(-cot(x)+csc(x))+1

Fricas [A] (verification not implemented)

none

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

[In]

integrate(sin(x)*log(sin(x)),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 105 vs. \(2 (15) = 30\).

Time = 0.57 (sec) , antiderivative size = 105, normalized size of antiderivative = 7.00 \[ \int \log (\sin (x)) \sin (x) \, dx=\frac {2 \log {\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {\log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {\log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {2 \log {\left (2 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {2}{\tan ^{2}{\left (\frac {x}{2} \right )} + 1} \]

[In]

integrate(sin(x)*ln(sin(x)),x)

[Out]

2*log(tan(x/2)/(tan(x/2)**2 + 1))*tan(x/2)**2/(tan(x/2)**2 + 1) + log(tan(x/2)**2 + 1)*tan(x/2)**2/(tan(x/2)**
2 + 1) + log(tan(x/2)**2 + 1)/(tan(x/2)**2 + 1) + 2*log(2)*tan(x/2)**2/(tan(x/2)**2 + 1) + 2/(tan(x/2)**2 + 1)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (15) = 30\).

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

[In]

integrate(sin(x)*log(sin(x)),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

integrate(sin(x)*log(sin(x)),x, algorithm="giac")

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \log (\sin (x)) \sin (x) \, dx=\int \ln \left (\sin \left (x\right )\right )\,\sin \left (x\right ) \,d x \]

[In]

int(log(sin(x))*sin(x),x)

[Out]

int(log(sin(x))*sin(x), x)