Calculus – Computing Fourier Coefficients and Series for $\log(\sin(x))$

calculusfourier seriesintegrationreal-analysissequences-and-series

I posted a similar question with a bad response, so I am retrying with hopes of better knowledge. The fourier series is in the form:

$$f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos(nx) + \sum_{n=1}^{\infty} b_n\sin(nx)$$

Where:

$$a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\cos(nx) dx$$
$$b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\sin(nx) dx$$

The problem is computing the coefficients. The goal of trying to derive the series is to solve:

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

$\displaystyle a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} \log(\sin(x))\cos(nx) dx$

Which is very difficult to compute.

What can be done?

The series representation is:

$$\log(\sin(x)) = -\log(2) – \sum_{n=1}^{\infty} \frac{\cos(2kx)}{k}$$

Best Answer

Ok, here I am. The goal is to compute the Fourier series of $g(x)=\log\sin x$ over $[0,\pi]$, or the Fourier series of $h(x)=\log\sin\frac{x}{2}$ over $[0,2\pi]$, or the Fourier series of $f(x)=\log\cos\frac{x}{2}$ over $[-\pi,\pi]$. Since $f(x)$ is an even function, we have to compute: $$ a_n = \frac{1}{\pi}\int_{-\pi}^{+\pi}\cos(nx)\log\cos\frac{x}{2}\,dx = \frac{2}{\pi}\int_{0}^{\pi}\cos(nx)\log\cos\frac{x}{2}\,dx$$ for any $n\geq 1$ to be able to state: $$ f(x) = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\,dx + \sum_{n\geq 1}a_n\cos(nx)=\frac{a_0}{2}+\sum_{n\geq 1}a_n\cos(nx).$$ for any $x\in(-\pi,\pi)$. Integration by parts gives: $$ a_n = \frac{2}{\pi}\left(\frac{1}{n}\left.\sin(nx)\log\cos\frac{x}{2}\right|_{0}^{\pi}+\frac{1}{2n}\int_{0}^{\pi}\sin(nx)\tan\frac{x}{2}\,dx\right)$$ or just: $$ a_n = \frac{1}{\pi n}\int_{0}^{\pi}\frac{\sin(nx)\sin(x/2)}{\cos(x/2)}\,dx = \frac{2}{\pi n}\int_{0}^{\pi/2}\frac{\sin(2nx)\sin x}{\cos x}\,dx.$$ Since $\cos((2n+1)x)=2\cos x\cos(2nx)-\cos((2n-1)x)$, we have: $$ a_n = \frac{1}{\pi n}\int_{0}^{\pi/2}\sum_{k=1}^{n}\cos((2k-1)x)\,dx =\frac{(-1)^{n+1}}{n}.$$ This gives: $$\log\cos\frac{x}{2}=\frac{a_0}{2}+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)$$ for any $x\in(-\pi,\pi)$. In order to find $a_0$, we can simply match $f(0)=0$ with the series on the right hand side. Since: $$\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}=\int_{0}^{1}\frac{dx}{1+x}=\log 2,$$ we have: $$\log\cos\frac{x}{2}=-\log 2+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)\qquad\forall x\in(-\pi,\pi),\tag{1}$$ and by translating the variable: $$\log\sin\frac{x}{2}=-\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(nx)\qquad\forall x\in(0,2\pi),\tag{2}$$ $$\log\sin x = -\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(2nx)\qquad\forall x\in(0,\pi),\tag{3}$$ as wanted.


A little addendum, since I think it is worth mentioning the following technique. Starting with a celebrated identity: $$\prod_{k=1}^{n-1}\sin\frac{\pi k}{n}=\frac{2n}{2^n}$$ and noticing that $\log\sin x$ is a Riemann integrable function over $(0,\pi)$, we have: $$\int_{0}^{\pi}\log\sin x\,dx = \lim_{n\to +\infty}\frac{\pi}{n}\sum_{k=1}^{n-1}\log\sin\frac{\pi k}{n}=\lim_{n\to +\infty}\frac{\pi}{n}\log\frac{2n}{2^n}=\color{red}{-\pi\log 2}.$$