### 3.191 $$\int \log (\sin (x)) \sin ^2(x) \, dx$$

Optimal. Leaf size=74 $\frac{1}{4} i \text{PolyLog}\left (2,e^{2 i x}\right )+\frac{i x^2}{4}+\frac{x}{4}-\frac{1}{2} x \log \left (1-e^{2 i x}\right )+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} \sin (x) \cos (x)-\frac{1}{2} \sin (x) \cos (x) \log (\sin (x))$

[Out]

x/4 + (I/4)*x^2 - (x*Log[1 - E^((2*I)*x)])/2 + (x*Log[Sin[x]])/2 + (I/4)*PolyLog[2, E^((2*I)*x)] + (Cos[x]*Sin
[x])/4 - (Cos[x]*Log[Sin[x]]*Sin[x])/2

________________________________________________________________________________________

Rubi [A]  time = 0.109389, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 9, integrand size = 8, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 1.125, Rules used = {2635, 8, 2554, 12, 6742, 3717, 2190, 2279, 2391} $\frac{1}{4} i \text{PolyLog}\left (2,e^{2 i x}\right )+\frac{i x^2}{4}+\frac{x}{4}-\frac{1}{2} x \log \left (1-e^{2 i x}\right )+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} \sin (x) \cos (x)-\frac{1}{2} \sin (x) \cos (x) \log (\sin (x))$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x/4 + (I/4)*x^2 - (x*Log[1 - E^((2*I)*x)])/2 + (x*Log[Sin[x]])/2 + (I/4)*PolyLog[2, E^((2*I)*x)] + (Cos[x]*Sin
[x])/4 - (Cos[x]*Log[Sin[x]]*Sin[x])/2

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2554

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 12

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

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 3717

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol] :> Simp[(I*(c + d*x)^(m + 1))/(d*
(m + 1)), x] - Dist[2*I, Int[((c + d*x)^m*E^(2*I*k*Pi)*E^(2*I*(e + f*x)))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x)))
, x], x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
(f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
- Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin{align*} \int \log (\sin (x)) \sin ^2(x) \, dx &=\frac{1}{2} x \log (\sin (x))-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)-\int \frac{1}{2} \cot (x) (x-\cos (x) \sin (x)) \, dx\\ &=\frac{1}{2} x \log (\sin (x))-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)-\frac{1}{2} \int \cot (x) (x-\cos (x) \sin (x)) \, dx\\ &=\frac{1}{2} x \log (\sin (x))-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)-\frac{1}{2} \int \left (-\cos ^2(x)+x \cot (x)\right ) \, dx\\ &=\frac{1}{2} x \log (\sin (x))-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)+\frac{1}{2} \int \cos ^2(x) \, dx-\frac{1}{2} \int x \cot (x) \, dx\\ &=\frac{i x^2}{4}+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} \cos (x) \sin (x)-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)+i \int \frac{e^{2 i x} x}{1-e^{2 i x}} \, dx+\frac{\int 1 \, dx}{4}\\ &=\frac{x}{4}+\frac{i x^2}{4}-\frac{1}{2} x \log \left (1-e^{2 i x}\right )+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} \cos (x) \sin (x)-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)+\frac{1}{2} \int \log \left (1-e^{2 i x}\right ) \, dx\\ &=\frac{x}{4}+\frac{i x^2}{4}-\frac{1}{2} x \log \left (1-e^{2 i x}\right )+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} \cos (x) \sin (x)-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)-\frac{1}{4} i \operatorname{Subst}\left (\int \frac{\log (1-x)}{x} \, dx,x,e^{2 i x}\right )\\ &=\frac{x}{4}+\frac{i x^2}{4}-\frac{1}{2} x \log \left (1-e^{2 i x}\right )+\frac{1}{2} x \log (\sin (x))+\frac{1}{4} i \text{Li}_2\left (e^{2 i x}\right )+\frac{1}{4} \cos (x) \sin (x)-\frac{1}{2} \cos (x) \log (\sin (x)) \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0555071, size = 59, normalized size = 0.8 $\frac{1}{8} \left (2 i \text{PolyLog}\left (2,e^{2 i x}\right )+2 x \left (i x-2 \log \left (1-e^{2 i x}\right )+2 \log (\sin (x))+1\right )+\sin (2 x) (1-2 \log (\sin (x)))\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*x*(1 + I*x - 2*Log[1 - E^((2*I)*x)] + 2*Log[Sin[x]]) + (2*I)*PolyLog[2, E^((2*I)*x)] + (1 - 2*Log[Sin[x]])*
Sin[2*x])/8

________________________________________________________________________________________

Maple [B]  time = 0.033, size = 146, normalized size = 2. \begin{align*}{\frac{i}{8}}\ln \left ( 2\,\sin \left ( x \right ) \right ){{\rm e}^{2\,ix}}-{\frac{i}{16}}{{\rm e}^{2\,ix}}-{\frac{i}{2}}\ln \left ({{\rm e}^{ix}} \right ) \ln \left ( 2\,\sin \left ( x \right ) \right ) -{\frac{i}{4}} \left ( \ln \left ({{\rm e}^{ix}} \right ) \right ) ^{2}+{\frac{i}{2}}\ln \left ({{\rm e}^{ix}} \right ) \ln \left ({{\rm e}^{ix}}+1 \right ) +{\frac{i}{2}}{\it dilog} \left ({{\rm e}^{ix}}+1 \right ) -{\frac{i}{2}}{\it dilog} \left ({{\rm e}^{ix}} \right ) -{\frac{i}{8}}{{\rm e}^{-2\,ix}}\ln \left ( 2\,\sin \left ( x \right ) \right ) +{\frac{i}{16}}{{\rm e}^{-2\,ix}}-{\frac{i}{4}}\ln \left ({{\rm e}^{ix}} \right ) -{\frac{i}{8}}\ln \left ( 2 \right ){{\rm e}^{2\,ix}}+{\frac{i}{8}}\ln \left ( 2 \right ){{\rm e}^{-2\,ix}}+{\frac{i}{2}}\ln \left ( 2 \right ) \ln \left ({{\rm e}^{ix}} \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(ln(sin(x))*sin(x)^2,x)

[Out]

1/8*I*ln(2*sin(x))*exp(2*I*x)-1/16*I*exp(2*I*x)-1/2*I*ln(exp(I*x))*ln(2*sin(x))-1/4*I*ln(exp(I*x))^2+1/2*I*ln(
exp(I*x))*ln(exp(I*x)+1)+1/2*I*dilog(exp(I*x)+1)-1/2*I*dilog(exp(I*x))-1/8*I*exp(-2*I*x)*ln(2*sin(x))+1/16*I*e
xp(-2*I*x)-1/4*I*ln(exp(I*x))-1/8*I*ln(2)*exp(2*I*x)+1/8*I*ln(2)*exp(-2*I*x)+1/2*I*ln(2)*ln(exp(I*x))

________________________________________________________________________________________

Maxima [B]  time = 2.38052, size = 140, normalized size = 1.89 \begin{align*} \frac{1}{4} i \, x^{2} - \frac{1}{2} i \, x \arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right ) + \frac{1}{2} i \, x \arctan \left (\sin \left (x\right ), -\cos \left (x\right ) + 1\right ) - \frac{1}{4} \, x \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - \frac{1}{4} \, x \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) + \frac{1}{4} \,{\left (2 \, x - \sin \left (2 \, x\right )\right )} \log \left (\sin \left (x\right )\right ) + \frac{1}{4} \, x + \frac{1}{2} i \,{\rm Li}_2\left (-e^{\left (i \, x\right )}\right ) + \frac{1}{2} i \,{\rm Li}_2\left (e^{\left (i \, x\right )}\right ) + \frac{1}{8} \, \sin \left (2 \, x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*I*x^2 - 1/2*I*x*arctan2(sin(x), cos(x) + 1) + 1/2*I*x*arctan2(sin(x), -cos(x) + 1) - 1/4*x*log(cos(x)^2 +
sin(x)^2 + 2*cos(x) + 1) - 1/4*x*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) + 1/4*(2*x - sin(2*x))*log(sin(x)) +
1/4*x + 1/2*I*dilog(-e^(I*x)) + 1/2*I*dilog(e^(I*x)) + 1/8*sin(2*x)

________________________________________________________________________________________

Fricas [B]  time = 2.62214, size = 462, normalized size = 6.24 \begin{align*} -\frac{1}{4} \, x \log \left (\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) - \frac{1}{4} \, x \log \left (\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) - \frac{1}{4} \, x \log \left (-\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) - \frac{1}{4} \, x \log \left (-\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) - \frac{1}{2} \,{\left (\cos \left (x\right ) \sin \left (x\right ) - x\right )} \log \left (\sin \left (x\right )\right ) + \frac{1}{4} \, \cos \left (x\right ) \sin \left (x\right ) + \frac{1}{4} \, x + \frac{1}{4} i \,{\rm Li}_2\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right ) - \frac{1}{4} i \,{\rm Li}_2\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right ) - \frac{1}{4} i \,{\rm Li}_2\left (-\cos \left (x\right ) + i \, \sin \left (x\right )\right ) + \frac{1}{4} i \,{\rm Li}_2\left (-\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log{\left (\sin{\left (x \right )} \right )} \sin ^{2}{\left (x \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(log(sin(x))*sin(x)**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log \left (\sin \left (x\right )\right ) \sin \left (x\right )^{2}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(log(sin(x))*sin(x)^2, x)