TITLE: Which Fourier series formula is correct
QUESTION [15 upvotes]: I'm getting started on Fourier series but I'm confused over the formulae involved.
My lecturers notes, including Wikipedia state that, for the interval $(-\pi \le x \le \pi)$ 
$$a_0 = \frac1\pi \int \cdots $$
whereas videos on Youtube and other tutorials I've found seem to be using:
$$a_0 = \frac1{2\pi} \int \cdots $$
Which one am I supposed to use?

REPLY [12 votes]: The trigonometric Fourier series of a function $f(x)$ defined on the interval $-\pi \leq
x\leq \pi $ is 
$$
f(x)=C+\sum_{n=1}^{\infty }\left( a_{n}\cos nx+b_{n}\sin nx\right), \tag{1}
$$
where the constant $C$ and the coefficients $a_n$ and $b_n$ are given by the following integrals:
$$
\begin{eqnarray*}
a_{n} &=&\frac{1}{\pi }\int_{-\pi }^{\pi }f(x)\cos nx\,dx,\qquad
n=1,2,3,\ldots  \\
b_{n} &=&\frac{1}{\pi }\int_{-\pi }^{\pi }f(x)\sin nx\,dx,\qquad
n=1,2,3,\ldots  \\
C &=&\frac{1}{2\pi }\int_{-\pi }^{\pi }f(x)\, dx.
\end{eqnarray*}\tag{2}
$$
The constant $C$ is the average value of the function $f(x)$ on the given
interval. If we extend the $a_{n}$ formula to $n=0$, we get
$$
a_{0}=\frac{1}{\pi }\int_{-\pi }^{\pi }f(x)\,dx=2C\Leftrightarrow C=\frac{
a_{0}}{2}.\tag{3}
$$
With this definition of $a_0$ we have
$$
f(x)=\frac{a_{0}}{2}+\sum_{n=1}^{\infty }\left( a_{n}\cos nx+b_{n}\sin
nx\right)\tag{4} 
$$
On the other hand if we had defined 
$$
a_{0}=\frac{1}{2\pi }\int_{-\pi }^{\pi }f(x)\,dx\tag{3'}
$$
then the expansion of $f(x)$ into a Fourier Series would be
$$
f(x)=a_{0}+\sum_{n=1}^{\infty }\left( a_{n}\cos nx+b_{n}\sin nx\right)\tag{4'} 
$$
References: The definition $(3)$ is used in Angus Taylor's Advanced Calculus and Tom Apostol's Mathematical Analysis.