The $\text{n:th}$ Fourier coefficient (for the $\cos(nx)$ part) is defined by
$$a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(\theta) \cos(n\theta)d\theta.$$
Inserting $n=0$, we get
$$a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} f(\theta) d\theta.$$
which will give us the zeroth coefficient.
For the function $f(\theta)=(2a)^{-1},\, |\theta|\lt a$, we get
$$a_n = \cdots = \frac{\sin(na)}{\pi na},\, n \neq 0$$
However, taking the limit here as $n\to 0$ we get $a_0 = \frac{1}{\pi}$ which is the same as we would get from setting $n=0$ before integrating.
My question is: does this work in general? Will you always get the correct (zeroth or other) coefficient by taking the limit rather than setting $n$ before integration?
I've thought about this a bit but I'm not sure about moving the limit inside the integration. I think that requires uniform convergence and I don't know if we have that in general.