Prove that for all $-\pi\le x\le \pi$ and all $a \notin \mathbb Z$, $$\cos(ax)=\frac{\sin(\pi a)}{\pi a}+\sum_{n=1}^{\infty }(-1)^{n}\frac{2a\sin(\pi a)}{\pi (a^{2}-n^{2})}\cos(nx).$$
I understand general Fourier analysis; however, I am unsure of any steps I should follow to be able to solve this sort of question. Any help or links to material that would help me to understand the process of how to solve a question like this would be much appreciated.
Hint:
I leave the details to the OP (integrability issues and the like)
Consider the function $f_a(x)=e^{a ix}$ over $(-\pi,\pi)$ for $a\in(0,1)$. Its Fourier coefficients are given by $$c_n(f_a)=\frac1{2\pi}\int^{\pi}_{-\pi}e^{i(a-n)x}\,dx=\sin(a\pi)\frac{(-1)^n}{\pi(a-n)}$$
From this, it follows (why?) that
$$f_a(x)=e^{a ix} =\sum_{n\in\mathbb{Z}}c_n(f_a) e^{in x}= \sin(a\pi)\sum_{n\in\mathbb{Z}} \frac{(-1)^n}{\pi(a-n)}e^{inx}$$ almost surely (in fact for all points in $(-\pi,\pi)$ by continuity and differentiability of $f_a$). Matching real and imaginary parts gives
$$\cos(a x)=\sin(a\pi)\sum_{n\in\mathbb{Z}} \frac{(-1)^n}{\pi(a-n)}\cos(nx)$$
Now split the sum $\sum_{n\in\mathbb{Z}}T_n(x)=T_0(x)+\sum^\infty_{n=1}(T_n(x)+T_{-n}(x))$ where $T_m(x)=\frac{(-1)^m}{\pi(a-m)}\cos(mx)$ for all $m\in\mathbb{Z}$.
Comment: A similar expression can be obtained for $\sin(a x)$.