I have just started learning the basics of Fourier series and have some doubts about it. I am aware that Fourier series can be used to compute infinite sums. For example, $\zeta(2)$ and $\eta(2)$ can be evaluated by using the Fourier series expansion of $x^2$, where $x\in[-\pi, \pi]$. $$x^2=\frac{\pi^2}{3}+\sum_{n \ge 1}\frac{4(-1)^n}{n^2}\cos{nx}$$ Letting $x=\pi$ and $x=0$ will yield the required results. This then brings me to my question. Given a sum to compute, how does one determine the appropriate $f(x)$ and $L$? For example, given a sum like $$\beta(3)=\sum_{n \ge 0}\frac{(-1)^n}{(2n+1)^3}$$ , may I ask how we are supposed to know which function we have to consider?
Also, I am interested in knowing how to apply this technique to evaluate sums of the more general form
$$\sum_{n \ge 0}\frac{z^n}{(n+a)^s}$$
i.e. the lerch transcendent, and how to determine if it is not possible to utilise this method. (For example, it does not work on $\zeta(2n+1)$)
Thank you for putting up with my ignorance. Help will be greatly appreciated.