\(\int \csc ^2(x) \log (\sin (x)) \, dx\) [194]

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

Optimal result

Integrand size = 8, antiderivative size = 15 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-x-\cot (x)-\cot (x) \log (\sin (x)) \]

[Out]

-x-cot(x)-cot(x)*ln(sin(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3852, 8, 2634, 3554} \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-x-\cot (x)-\cot (x) \log (\sin (x)) \]

[In]

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

[Out]

-x - Cot[x] - Cot[x]*Log[Sin[x]]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, 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 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-x-\cot (x)-\cot (x) \log (\sin (x)) \]

[In]

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

[Out]

-x - Cot[x] - Cot[x]*Log[Sin[x]]

Maple [A] (verified)

Time = 1.42 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07

method result size
parallelrisch \(-x -\cot \left (x \right )-\cot \left (x \right ) \ln \left (\sin \left (x \right )\right )\) \(16\)
norman \(\frac {-\frac {1}{2}+\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-x \tan \left (\frac {x}{2}\right )+\frac {\ln \left (\frac {2 \tan \left (\frac {x}{2}\right )}{1+\tan ^{2}\left (\frac {x}{2}\right )}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-\frac {\ln \left (\frac {2 \tan \left (\frac {x}{2}\right )}{1+\tan ^{2}\left (\frac {x}{2}\right )}\right )}{2}}{\tan \left (\frac {x}{2}\right )}\) \(69\)
default \(4 i \left (\frac {-\frac {\ln \left (i \left (1-{\mathrm e}^{2 i x}\right ) {\mathrm e}^{-i x}\right ) {\mathrm e}^{2 i x}}{2}-\frac {1}{2}}{{\mathrm e}^{2 i x}-1}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{4}+\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{4}+\frac {\ln \left (2\right )}{2 \,{\mathrm e}^{2 i x}-2}\right )\) \(81\)
risch \(\frac {2 i \ln \left ({\mathrm e}^{i x}\right )}{{\mathrm e}^{2 i x}-1}-\frac {i \ln \left ({\mathrm e}^{2 i x}-1\right ) {\mathrm e}^{2 i x}-\pi \,\operatorname {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \operatorname {csgn}\left (\sin \left (x \right )\right )-\pi \,\operatorname {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \operatorname {csgn}\left (\sin \left (x \right )\right )^{2}-\operatorname {csgn}\left (\sin \left (x \right )\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right ) \pi -\operatorname {csgn}\left (\sin \left (x \right )\right )^{3} \pi +\operatorname {csgn}\left (i \sin \left (x \right )\right )^{2} \operatorname {csgn}\left (\sin \left (x \right )\right ) \pi -\pi \,\operatorname {csgn}\left (\sin \left (x \right )\right ) \operatorname {csgn}\left (i \sin \left (x \right )\right )+\operatorname {csgn}\left (i \sin \left (x \right )\right )^{3} \pi -\operatorname {csgn}\left (i \sin \left (x \right )\right )^{2} \pi +2 x \,{\mathrm e}^{2 i x}-2 i \ln \left (2\right )+i \ln \left ({\mathrm e}^{2 i x}-1\right )+2 i+\pi -2 x}{{\mathrm e}^{2 i x}-1}\) \(194\)

[In]

int(csc(x)^2*ln(sin(x)),x,method=_RETURNVERBOSE)

[Out]

-x-cot(x)-cot(x)*ln(sin(x))

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.27 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-\frac {\cos \left (x\right ) \log \left (\sin \left (x\right )\right ) + x \sin \left (x\right ) + \cos \left (x\right )}{\sin \left (x\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 11.14 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=- x - \log {\left (\sin {\left (x \right )} \right )} \cot {\left (x \right )} - \frac {\cos {\left (x \right )}}{\sin {\left (x \right )}} \]

[In]

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

[Out]

-x - log(sin(x))*cot(x) - cos(x)/sin(x)

Maxima [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 81, normalized size of antiderivative = 5.40 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-\frac {1}{2} \, {\left (\frac {\cos \left (x\right ) + 1}{\sin \left (x\right )} - \frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )} \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 {\cos \left (x\right ) + 1}{2 \, \sin \left (x\right )} + \frac {\sin \left (x\right )}{2 \, {\left (\cos \left (x\right ) + 1\right )}} - 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.27 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-x - \frac {\log \left (\sin \left (x\right )\right )}{\tan \left (x\right )} - \frac {1}{\tan \left (x\right )} \]

[In]

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

[Out]

-x - log(sin(x))/tan(x) - 1/tan(x)

Mupad [B] (verification not implemented)

Time = 1.71 (sec) , antiderivative size = 57, normalized size of antiderivative = 3.80 \[ \int \csc ^2(x) \log (\sin (x)) \, dx=-2\,x-\ln \left ({\mathrm {e}}^{x\,2{}\mathrm {i}}-1\right )\,1{}\mathrm {i}-\frac {\ln \left (\frac {{\mathrm {e}}^{-x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )\,2{}\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}-1}-\frac {2{}\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}-1} \]

[In]

int(log(sin(x))/sin(x)^2,x)

[Out]

- 2*x - log(exp(x*2i) - 1)*1i - (log((exp(-x*1i)*1i)/2 - (exp(x*1i)*1i)/2)*2i)/(exp(x*2i) - 1) - 2i/(exp(x*2i)
 - 1)