Calculus Question: $\int_0^{\frac{\pi}{2}}\tan (x)\log(\sin x)dx$

Can anyone help me to find $\int_0^{\frac{\pi}{2}}\tan (x)\log(\sin x)dx$? Any help would be appreciated. Thanks in advance.

• Finally I am able using Tex – Venus May 13 '14 at 9:58
• I just did it with mathematica and it returns $-\pi^2/24$. Wolfram agrees. – Gennaro Marco Devincenzis May 13 '14 at 10:17
• https://www.wolframalpha.com/input/?i=Integral&a=*C.Integral-_*Calculator.dflt-&f2=tan%28x%29log%28sinx%29&f=Integral.integrand\u005ftan%28x%29log%28sinx%29&f3=0&f=Integral.rangestart_0&f4=pi%2F2&f=Integral.rangeend_pi%2F2&a=*FVarOpt.1-_**-.***Integral.variable---.**Integral.rangestart-.*Integral.rangeend--- apparently this integral is diverging – user2485710 May 13 '14 at 10:51
• @user2485710 As far as I can see, Wolfram agrees with Gennaro. Which means my answer is likely wrong. – Mike May 13 '14 at 10:57
• @Mike the numerical result from Wolfram also matches that, $-\pi^{2}/24 = -0.411233516712057$ – user2485710 May 13 '14 at 10:59

Rewrite \begin{align} \int_0^{\Large\frac{\pi}{2}}\tan x\ln(\sin x)\,dx=\int_0^{\Large\frac{\pi}{2}}\frac{\sin x}{\cos x}\ln(\sin x)\ dx. \end{align} Let $\,u=\cos x$, then $\,du=-\sin x\,dx$. For $\,0 < x < \frac{\pi}{2}$, we have $\,0 < u < 1$. Now, the integral turns out to be \begin{align} \int_0^{\Large\frac{\pi}{2}}\frac{\sin x}{\cos x}\ln(\sin x)\,dx&=\int_0^{\Large\frac{\pi}{2}}\frac{\sin x}{\cos x}\ln(\sqrt{1-\cos^2 x})\,dx\\ &=-\frac{1}{2}\int_0^1\frac{\ln(1-u^2)}{u}\,du.\tag1\\ \end{align} Next, use Maclaurin series for natural logarithm: $$\ln(1-u^2)=-\sum_{n=1}^\infty \frac{u^{2n}}{n}.\tag2\\$$ Substitute $\,(2)$ to $\,(1)$, yield \begin{align} \frac{1}{2}\int_0^1\frac{\ln(1-u^2)}{u}\,du&=-\frac{1}{2}\int_0^1\sum_{n=1}^\infty \frac{u^{2n}}{un}\,du\\ &=-\frac{1}{2}\sum_{n=1}^\infty\int_0^1 \frac{u^{2n-1}}{n}\,du\\ &=-\frac{1}{4}\sum_{n=1}^\infty \left.\frac{u^{2n}}{n^2}\right|_{u=0}^1\\ &=-\frac{1}{4}\sum_{n=1}^\infty \frac{1}{n^2}.\tag3 \end{align} The infinite series in $(3)$ is defined as Riemann zeta function $\,\zeta (2)=\dfrac{\pi^2}{6}$. Thus, \begin{align} \int_0^{\Large\frac{\pi}{2}}\tan x\ln(\sin x)\,dx&=-\frac{1}{4}\sum_{n=1}^\infty \frac{1}{n^2}\\ &=-\frac{1}{4}\cdot \frac{\pi^2}{6}\\ &=\large\color{blue}{-\frac{\pi^2}{24}}.\\ \end{align}

• FYI, I've just seen that my answer and Cody are similar but I didn't copy his answer. I should have posted the answer 3 hours ago but my internet connection suddenly got offline. I also want to ask the OP where did he/she get this question since it's exactly the same with this post. – Tunk-Fey May 13 '14 at 13:45
• I know how that internet connection things is. I accidentally cut mine the other day while trimming :) – Cody May 13 '14 at 14:14
• @Cody Yeah, that was really annoying me. It happens to all of us. :D – Tunk-Fey May 14 '14 at 4:00
• @Integrals Thanks Jeff. Your recent answers are also nice. – Tunk-Fey May 15 '14 at 0:34
• @Integrals All of integral questions are also nice. I really enjoy it. :) – Tunk-Fey May 16 '14 at 5:22

Here is one line proof using beta function

$$\int_0^{\frac{\pi}{2}}\tan (x)\log(\sin x)dx=\lim_{a\rightarrow 1,b\rightarrow 1^+}\frac{1}{2}\frac{\partial B}{\partial a}\left(\frac{1}{2}(a+1),\frac{1}{2}(b+1)\right)=-\frac{\pi^2}{24}$$

Q.E.D.

• Thanks. I've just realized this method from your post: math.stackexchange.com/q/1021647/146687 and apparently someone is using Tunk-Fey's method to evaluate your integral & I like that answer. – Venus Nov 26 '14 at 19:07
• Anyway, at that time, I didn't know beta function – Venus Nov 26 '14 at 19:07
• @Venus Welcome :-). See $(14)$ here mathworld.wolfram.com/BetaFunction.html – user 1357113 Nov 26 '14 at 19:08

$$\int_{0}^{\frac{\pi}{2}}\frac{\sin(x)log(\sin(x))}{\cos(x)}dx$$

Let $t=\cos(x), \;\ \sin(x)=\sqrt{1-t^{2}}, \;\ dx=\frac{-1}{\sqrt{1-t^{2}}}dt$

$$1/2\int_{0}^{1}\frac{log(1-t^{2})}{t}dt$$

This integral can be done using the series for $$log(1-t^{2})=-\sum_{k=1}^{\infty}\frac{t^{2k}}{k}$$, and is rather famous.

But, it evaluates to $$\frac{-\pi^{2}}{24}$$

• Shouldn't that be $\frac{\log t}t$? – Mike May 13 '14 at 10:43
• @Mike It's correct. There is just a typo on the first line. It should be $\log (\sin x)$, not $\log (\cos x)$. – Random Variable May 13 '14 at 11:24

Subst. $t=\sin{x}$, then the given integral becomes \begin{align*} \int_0^1 \, \frac{t\, \log{t}}{1-t^2} dt &= \int_{0}^{1} \, \log{t} \, \sum_{k\ge 0} t^{2k+1} \, dt\\ &= \sum_{k\ge 0} \int_{0}^{1} \, \left(\log{t}\right)\, t^{2k+1}\, dt\\ &= \sum_{k\ge 0} -\frac{1}{4 \, {\left(k^{2} + 2 \, k + 1\right)}}\\ &= -\frac{1}{4} \zeta{(2)}\\ &= -\frac{\pi^2}{24} \end{align*}

In general, we can have \begin{align*} \int_{0}^{\pi/2} \, \left(\log{\sin{x}}\right)^n\, \tan{x}\, dx = (-1)^n\, \frac{ n!\, \zeta(n + 1)}{2^{n + 1}} \end{align*}


I just finished this answer and noticed that equation $(6)$ there answers this question. I did a small amount of customization for this question.

Let $t=\sin(x)$ and $e^{-u/2}=t$ \begin{align} \int_0^{\pi/2}\tan(x)\log(\sin(x))\,\mathrm{d}x &=\int_0^1\frac{t}{1-t^2}\log(t)\,\mathrm{d}t\\ &=-\frac14\int_0^\infty\frac{e^{-u}}{1-e^{-u}}u\,\mathrm{d}u\\ &=-\frac14\int_0^\infty\sum_{k=1}^\infty ue^{-ku}\,\mathrm{d}u\\ &=-\frac14\sum_{k=1}^\infty\frac1{k^2}\\ &=-\frac{\pi^2}{24} \end{align} This is only slightly different from Felix Marin's answer, using the series for $\dfrac{x}{1-x}$ instead of $\log(1-x)$.

• Thanks for giving this answer. +1 :-) – Venus Nov 28 '14 at 3:00

Let $$I(a,b)=\int_0^{\pi/2}(\sin x)^{1-a}(\cos x)^{1-b}dx.$$ Then $$I(a,b)=\frac{\Gamma \left(1-\frac{a}{2}\right) \Gamma \left(1-\frac{b}{2}\right)}{2 \Gamma \left(-\frac{a}{2}-\frac{b}{2}+2\right)}$$ and hece \begin{eqnarray} \frac{\partial I(a,b)}{\partial a}&=&\frac{\Gamma \left(1-\frac{a}{2}\right) \Gamma \left(1-\frac{b}{2}\right) \left(\psi ^{(0)}\left(-\frac{a}{2}-\frac{b}{2}+2\right)-\psi ^{(0)}\left(1-\frac{a}{2}\right)\right)}{4 \Gamma \left(-\frac{a}{2}-\frac{b}{2}+2\right)}. \end{eqnarray} Thus \begin{eqnarray} \frac{\partial I(0,b)}{\partial a}&=&\frac{\Gamma \left(1-\frac{b}{2}\right) \left(\psi ^{(0)}\left(2-\frac{b}{2}\right)+\gamma \right)}{4 \Gamma \left(2-\frac{b}{2}\right)}. \end{eqnarray} Noting $$\Gamma(x)\approx\frac{1}{x} \text{ near }x=0$$ we have \begin{eqnarray} \lim_{b\to2}\frac{\partial I(0,b)}{\partial a}&=&\lim_{b\to2}\frac{\Gamma \left(1-\frac{b}{2}\right) \left(\psi ^{(0)}\left(2-\frac{b}{2}\right)+\gamma \right)}{4 \Gamma \left(2-\frac{b}{2}\right)}\\ &=&\lim_{b\to2}\frac14 \frac{\psi^{(0)}(2-\frac{b}{2})+\gamma}{1-\frac{b}{2}}\\ &=&\lim_{b\to2}\frac14 \psi^{(1)}(2-\frac{b}{2})\\ &=&\frac{\pi^2}{24}. \end{eqnarray} So $$\int_0^{\pi/2}\tan x\ln(\sin x)dx=-\frac{\pi^2}{24}.$$