Compute $$\sum_{n\geq1}\frac{1}{\pi^2+n^2}.$$
by expanding $e^{\pi x}$ in its Fourier series.
So I calculated that
$$c_n=\frac{1}{2\pi}\int_{-\pi}^{\pi}e^{\pi x} e^{-inx} \ dx=\frac{\sinh{(\pi^2)}(-1)^n}{\pi(\pi-in)},$$
which is correct. Now,
$$f(x)=e^{\pi x}=\sum_{n\in{\mathbb{Z}}}\frac{\sinh{(\pi^2)}(-1)^n}{\pi(\pi-in)}e^{inx}.$$
At $x=0$ we have
$$1=\sum_{n\in{\mathbb{Z}}}\frac{\sinh{(\pi^2)}(-1)^n}{\pi(\pi-in)}=\frac{\sinh(\pi^2)}{\pi}\sum_{n\in\mathbb{Z}}\frac{(-1)^n}{\pi-in}.$$
Taking out the case $n=0$ and splitting the sum by $n \rightarrow -n$ in one of them we get
\begin{align} 1&=\frac{\sinh(\pi^2)}{\pi}\left(\frac{1}{\pi}+\sum_{n\geq1}\frac{(-1)^n}{\pi-in} + \sum_{n\geq1}\frac{(-1)^{-n}}{\pi+in}\right)\\ &=\frac{\sinh(\pi^2)}{\pi}\left(\frac{1}{\pi}+2\pi\sum_{n\geq1}\frac{(-1)^n}{\pi^2+n^2}\right). \end{align}
So I almost have the desired sum here, only thing bothering me is the $(-1)^n$. How do I proceed?
Note that I'm not interested in alternate solutions. I already know at least 2 other methods.
Just to put in into an answer rather than into a comment I have to say that I am almost sure the only, and most likely intended way is to evaluate the series at $x=\pi$, as pointed out by Semiclassical. This is yet alone the only possibilty to get rid of the $(-1)^n$ since this factor has nothing to do with the original function but more with underlying structure of the Fourier Coefficients.
A typical approach to find oscillating series, such as the one you derived from the non-oscillating one, is by playing the good old even odd cancelation game $($here similiar is done with the Riemann Zeta Function and its relative, the Dirichlet Eta Function$)$. However, applying this method to the given problem, and ignoring the constant factors for a moment, we get the following
$$\underbrace{\sum_{n\ge1}\frac{(-1)^n}{\pi^2+n^2}}_{=S_1}=\underbrace{\sum_{n\ge1}\frac1{\pi^2+n^2}}_{=S}-\underbrace{2\sum_{n\ge1}\frac1{\pi^2+(2n)^2}}_{=S_2}$$
Our main goal is to find $S$ wherease $S_1$ can be computed by your given formula. What remains to find is an expression for $S_2$. And from hereon we cannot get any further by only taking the Fourier Series Expansion of $f(x)=e^{\pi x}$, at least as far as I can tell. One could use the expansion of $F(x)=e^{ax}$, for a positive real number $a$, instead and it is quite funny following this ansatz since it is way off what I think was intended by this question. Computing $c_n$ for $F(x)$ we obtain
$$F(x)=\frac{\sinh(a\pi)}\pi\sum_{n\in\mathbb Z}\frac{\color{red}{(-1)^n}}{a-in}e^{-inx}$$
Well, there is it again, the oscillating minus sign. However, note that for $a=\frac\pi2$ we are actually able to deduce an expression for $S_2$; by evaluating at $x=\pi$ ... Moreover I am certainly sure that this is not the expected method, even though it works afterall.