The exercise
Let $f$ be a $2\pi$ periodical function defined as $f(x)=\cos ax, \; |x|\leq \pi, \; a \notin \mathbb{Z}$. Expand $f$ in a Fourier series and prove that: $$\pi \cot \pi a = \sum_{n=-\infty}^{\infty} \frac{1}{n+a}, \; a \notin \mathbb{Z}$$
The Fourier series is pretty straight forward. By evaluating the coefficients one gets that:
$$\cos ax = \frac{\sin \pi a}{\pi a}+ \frac{2a \sin \pi a}{\pi}\sum_{n=1}^{\infty}\frac{(-1)^n \cos nx}{(a-n)(a+n)} \overset{x=\pi}{\implies }\\ \overset{x=\pi}{\implies}\pi \cot \pi a =\frac{1}{a}+ 2a\sum_{n=1}^{\infty}\frac{1}{(a-n)(a+n)}$$
How do I derive the series from $-\infty$ to $\infty$? I cannot see how to manipulate the last series in order to get what I want.
HINT:
Note that for the substitution $n \to -n$ the series is unchanged. Thus, the sum over non-zero integers is twice the sum over the positive integers only.
Can you finish now?