# How to find $a_0$ in Fourier Series

When we are trying to find $a_0$ in Fourier series we need to integrate it from $-L$ to $L$:

\begin{align} f(x)&= a_0/2 + \sum_{m=1}^{\infty}a_m\cos\frac{m\pi x}{L}+\sum_{m=1}^{\infty}b_m\sin\frac{n\pi x}{L}\\ \implies \int_{-L}^{L}f(x)dx&=\int_{-L}^{L}(a_0/2 + \sum_{m=1}^{\infty}a_m\cos\frac{m\pi x}{L}+\sum_{m=1}^{\infty}b_m\sin\frac{n\pi x}{L})dx\\ &=La_0+ \sum_{m+1}^{\infty}a_m\frac{L}{m\pi}\sin\frac{m\pi x}{L}\Big|_{-L}^{L}+ \sum_{m=1}^{\infty}-b_m\frac{L}{m\pi}\cos\frac{m\pi x}{L}\Big|_{-L}^{L} \end{align}

Here I get $\sum_{m=1}^{\infty}-b_m\frac{L}{m\pi}\cos\frac{m\pi x}{L}|_{-L}^{L}=-2b_m\frac{L}{m\pi}$, which is not equal to zero. Am I mistaken?

Your final line equates $\cos \frac{m \pi x}{L}\Big|^L_{-L}=\cos m\pi-\cos (-m\pi)$ to $2$, which is false.
• If you recall how $\cos x$ relates to $\cos(-x)$, then the answer is immediate. @user96369 – Semiclassical Aug 4 '17 at 15:06