Let $D = f - g$ where $f(x) = \pi \operatorname{cotan}(\pi x)$ and $g(x) = \frac{1}{x} + \sum_{n=1}^{+\infty}\left(\frac{1}{x+n} + \frac{1}{x-n}\right)$, and let $\widetilde{D}$ be its continuous extension to $\mathbb{R}$. Deduce that the function $\widetilde{D}$ is zero on $\mathbb{R}$, then that:
$$\forall x \in \mathbb{R} \backslash \mathbb{Z}, \quad \pi x \operatorname{cotan}(\pi x) = 1 + 2\sum_{n=1}^{+\infty} \frac{x^2}{x^2 - n^2}$$