Fourier Series of $\cos(ax)$ I would like to ask some help on this problem..
01) Expand the following function in fourier series.
$f(x)=cosax,−π<x<π$ where '$a$' is not an integer. Hence, Show that
$\frac{1}{sint} = \frac{1}{t} + \sum_{n=0}^{\infty}(-1)^{n}\left \{ \frac{1}{t-n\pi} + \frac{1}{t+ n\pi}\right \}$
Where '$t$' is any number which is not an integer multiple of $\pi$
Someone please show me some work done and steps to solve it so that I can understand better. I'm a beginner in Fourier series part.

Write
$$f(x) = a_0 + 2 \sum_{k=1}^{\infty} a_k \cos{k x} $$
because $f$ is even.  Then
$$\begin{align}a_k &= \frac1{2 \pi} \int_{-\pi}^{\pi} dx \, \cos{a x} \, \cos{k x} = \frac1{4 \pi} \int_{-\pi}^{\pi} dx \, \left [\cos{(k-a)x} + \cos{(k+a) x}  \right ]\end{align}$$
or
$$\begin{align}a_k &= \frac1{2 \pi} \left [\frac{\sin{(k-a) \pi}}{k-a} + \frac{\sin{(k+a) \pi}}{k+a} \right ] \\ &= \frac{(-1)^{k+1}}{\pi}\frac{a \sin{\pi a}}{k^2-a^2}\end{align}$$
Thus,
$$\cos{a x} = \frac{\sin{\pi a}}{\pi a} \left [1+2 a^2 \sum_{k=1}^{\infty} \frac{(-1)^{k+1} \cos{k x}}{k^2-a^2} \right ]$$
Plug in $x=0$ and get
$$\frac1{\sin{\pi a}} = \frac{1}{\pi a} + \frac1{\pi}\sum_{k=1}^{\infty} (-1)^{k+1} \left (\frac1{k-a}-\frac1{k+a} \right )$$
Subbing $t=a \pi$ produces the desired result.
