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}.$$
$$\text{a}_{0}=\frac{1}{\pi}\int_{-\pi}^{\pi}(\sin(x)+\cos(2x))\space\text{d}x=$$
$$\frac{1}{\pi}\left[\int_{-\pi}^{\pi}\sin(x)\space\text{d}x+\int_{-\pi}^{\pi}\cos(2x)\space\text{d}x\right]=$$
Now, use: $\int\sin(x)\space\text{d}x=\text{C}-\cos(x)$
$$\frac{1}{\pi}\left[\left[-\cos(x)\right]_{-\pi}^{\pi}+\int_{-\pi}^{\pi}\cos(2x)\space\text{d}x\right]=$$
Substitute $u=2x$ and $\text{d}u=2\space\text{d}x$.
This gives a new lower bound $u=-2\pi$ and upper bound $u=2\pi$:
$$\frac{1}{\pi}\left[\left[-\cos(x)\right]_{-\pi}^{\pi}+\frac{1}{2}\int_{-2\pi}^{2\pi}\cos(u)\space\text{d}u\right]=$$
Now, use: $\int\cos(x)\space\text{d}x=\sin(x)+\text{C}$
$$\frac{1}{\pi}\left[\left[-\cos(x)\right]_{-\pi}^{\pi}+\frac{1}{2}\left[\sin(u)\right]_{-2\pi}^{2\pi}\right]=0$$
NEXT:
$$\text{a}_{n}=\frac{1}{\pi}\int_{-\pi}^{\pi}(\sin(x)+\cos(2x))\cos(nx)\space\text{d}x=$$
$$\frac{1}{\pi}\left[\int_{-\pi}^{\pi}\sin(x)\cos(nx)\space\text{d}x+\int_{-\pi}^{\pi}\cos(2x)\cos(nx)\space\text{d}x\right]=$$
Now, as you noticed already:
Since $\sin(x)\cos(nx)$ is an odd function and the interval $[\pi,\pi]$ is symmetric about $0$, so:
$$\int_{-\pi}^{\pi}\sin(x)\cos(nx)\space\text{d}x=0$$
$$\frac{1}{\pi}\int_{-\pi}^{\pi}\cos(2x)\cos(nx)\space\text{d}x=$$
Use the trigonometric identity $\cos(a)\cos(b)=\frac{\cos(a-b)+cos(a+b)}{2}$:
$$\frac{1}{2\pi}\int_{-\pi}^{\pi}(\cos(x(n-2))+\cos(x(n+2)))\space\text{d}x=$$
$$\frac{1}{2\pi}\left[\int_{-\pi}^{\pi}\cos(x(n+2))\space\text{d}x+\int_{-\pi}^{\pi}\cos(x(n-2))\space\text{d}x\right]=$$
For the left integral:
Substitute $u=x(n+2)$ and $\text{d}u=(n+2)\space\text{d}x$.
This gives a new lower bound $u=(-\pi)(n+2)=-\pi(n+2)$ and upper bound $u=\pi(n+2)$:
$$\frac{1}{2\pi}\left[\frac{1}{n+2}\int_{-\pi(n+2)}^{\pi(n+2)}\cos(u)\space\text{d}u+\int_{-\pi}^{\pi}\cos(x(n-2))\space\text{d}x\right]=$$
For the right integral:
Substitute $s=x(n-2)$ and $\text{d}s=(n-2)\space\text{d}x$.
This gives a new lower bound $s=(-\pi)(n-2)=-\pi(n-2)$ and upper bound $s=\pi(n-2)$:
$$\frac{1}{2\pi}\left[\frac{1}{n+2}\int_{-\pi(n+2)}^{\pi(n+2)}\cos(u)\space\text{d}u+\frac{1}{n-2}\int_{-\pi(n-2)}^{\pi(n-2)}\cos(s)\space\text{d}s\right]=$$
Now, use: $\int\cos(x)\space\text{d}x=\sin(x)+\text{C}$
$$\frac{1}{2\pi}\left[\frac{1}{n+2}\left[\sin(u)\right]_{-\pi(n+2)}^{\pi(n+2)}+\frac{1}{n-2}\left[\sin(s)\right]_{-\pi(n-2)}^{\pi(n-2)}\right]=$$
$$\frac{\sin(\pi n)}{\pi(n+2)}+\frac{\sin(\pi n)}{\pi(n-2)}=\frac{2n\sin(\pi n)}{\pi(n^2-4)}$$
NEXT:
$$\text{b}_{n}=\frac{1}{\pi}\int_{-\pi}^{\pi}(\sin(x)+\cos(2x))\sin(nx)\space\text{d}x=$$
$$\frac{1}{\pi}\left[\int_{-\pi}^{\pi}\sin(x)\sin(nx)\space\text{d}x+\int_{-\pi}^{\pi}\cos(2x)\sin(nx)\space\text{d}x\right]=$$
Now, as you noticed already:
Since $\cos(2x)\sin(nx)$ is an odd function and the interval $[\pi,\pi]$ is symmetric about $0$, so:
$$\int_{-\pi}^{\pi}\cos(2x)\sin(nx)\space\text{d}x=0$$
$$\frac{1}{\pi}\int_{-\pi}^{\pi}\sin(x)\sin(nx)\space\text{d}x=$$
Use the trigonometric identity $\sin(a)\sin(b)=\frac{\cos(a-b)-cos(a+b)}{2}$:
$$\frac{1}{2\pi}\int_{-\pi}^{\pi}(\cos(x(n-1))-\cos(x(n+1)))\space\text{d}x=$$
$$\frac{1}{2\pi}\left[\int_{-\pi}^{\pi}\cos(x(n-1))\space\text{d}x-\int_{-\pi}^{\pi}\cos(x(n+1))\space\text{d}x\right]=$$
For the right integral:
Substitute $u=x(n+1)$ and $\text{d}u=(n+1)\space\text{d}x$.
This gives a new lower bound $u=(-\pi)(n+1)=-\pi(n+1)$ and upper bound $u=\pi(n+1)$:
$$\frac{1}{2\pi}\left[\int_{-\pi}^{\pi}\cos(x(n-1))\space\text{d}x-\frac{1}{n+1}\int_{-\pi(n+1)}^{\pi(n+1)}\cos(u)\space\text{d}u\right]=$$
For the left integral:
Substitute $s=x(n-1)$ and $\text{d}s=(n-1)\space\text{d}x$.
This gives a new lower bound $s=(-\pi)(n-1)=-\pi(n-1)$ and upper bound $s=\pi(n-1)$:
$$\frac{1}{2\pi}\left[\frac{1}{n-1}\int_{-\pi(n-1)}^{\pi(n-1)}\cos(s)\space\text{d}s-\frac{1}{n+1}\int_{-\pi(n+1)}^{\pi(n+1)}\cos(u)\space\text{d}u\right]=$$
Now, use: $\int\cos(x)\space\text{d}x=\sin(x)+\text{C}$
$$\frac{1}{2\pi}\left[\frac{1}{n-1}\left[\sin(s)\right]_{-\pi(n-1)}^{\pi(n-1)}-\frac{1}{n+1}\left[\sin(u)\right]_{-\pi(n+1)}^{\pi(n+1)}\right]=$$
$$\frac{\sin(\pi n)}{\pi(1-n)}+\frac{\sin(\pi n)}{\pi(1+n)}=\frac{2\sin(\pi n)}{\pi(1-n^2)}$$
CONCLUSION:
- $$\text{a}_0=0$$
- $$\text{a}_n=\frac{2n\sin(\pi n)}{\pi(n^2-4)}$$
- $$\text{b}_n=\frac{2\sin(\pi n)}{\pi(1-n^2)}$$
Best Answer
Once you write $f$ as a finite sum $\sum e^{ijx} a_j$ there is nothing more to be done since this sum is the (complex form of) Fourier series. The coefficents $a_j$ are already there when you expand you powers $(e^{ix}+e^{-ix})^{8}$ and $(e^{ix}-e^{-ix})^{8}$. To get the real form of the Fourier series just write $e^{ijx} =\cos (jx)+i\sin (jx)$ and $e^{-ijx} =\cos (jx)-i\sin (jx)$. There is no need to evaluate any integrals.