Let
f(x)=\begin{cases}0, & -3\lt x\lt-1, \\1, & -1\lt x\lt1,\\0, & 1\lt x\lt3\end{cases} (21)
and suppose that f(x + 6) = f(x). Graph three periods of y = f(x). Find the coefficients in the Fourier series for f.
The graph of y = f(x) is shown in Figure 10.2.3.
Note that f(x) is not assigned a value at the points of discontinuity, such as x = −1 and x = 1, or at the ends of the period, such as x = −9, x = −3, x = 3, and x = 9. This has no effect on the values of the Fourier coefficients, because they result from the evaluation of integrals, and the value of an integral is not affected by the value of the integrand at a single point or at a finite number of points. Thus the coefficients are the same regardless of what value, if any, f(x) is assigned at a point of discontinuity.
Since f has period 6, it follows that L = 3 in this problem. Consequently, the Fourier series for f has the form
f(x)={\frac{a_{0}}{2}}+\sum_{n-1}^{\infty}\left(a_{n}\cos\left({\frac{n\pi x}{3}}\right)+b_{n}\sin\left({\frac{n\pi x}{3}}\right)\right), (22)
where the coefficients a_{n} and b_{n} are given by equations (13)
a_{n}=\frac{1}{L}\int_{-L}^{L}f(x)\cos\Bigl(\frac{n\pi x}{L}\Bigr)d x,\quad n=0,1,2,\dots\,. (13)
and (14)
b_{n}=\frac{1}{L}\int_{-L}^{L}f(x)\sin\Bigl(\frac{n\pi x}{L}\Bigr)d x,\quad n=1,2,3,\dots\,. (14)
with L = 3. We have
a_{0}=\frac{1}{3}\int_{-3}^{3}f(x)d x=\frac{1}{3}\int_{-1}^{1}1\,d x=\frac{2}{3}. (23)
Similarly,
a_{n}=\frac{1}{3}\int_{-1}^{1}\cos\left(\frac{n\pi x}{3}\right)d x=\frac{1}{n\pi}\sin\left(\frac{n\pi x}{3}\right)\biggr|_{-1}^{1}=\frac{2}{n\pi}\sin\left(\frac{n\pi}{3}\right),\;\;\;n=1,2,\ldots, (24)
and
b_{n}=\frac{1}{3}\int_{-1}^{1}\sin\left(\frac{n\pi x}{3}\right)d x=-\frac{1}{n\pi}\cos\left(\frac{n\pi x}{3}\right)\biggr|_{-1}^{1}=0,\;\;\;n=1,2,\ldots, (25)
Thus the Fourier series for f is
f(x)={\frac{1}{3}}+\sum_{n=1}^{\infty}{\frac{2}{n\pi}}\sin\left({\frac{n\pi}{3}}\right)\cos\left({\frac{n\pi x}{3}}\right)\\=\frac{1}{3}+\frac{\sqrt{3}}{\pi}\left(\cos\left(\frac{\pi x}{3}\right)+\frac{1}{2}\cos\left(\frac{2\pi x}{3}\right)-\frac{1}{4}\cos\left(\frac{4\pi x}{3}\right)-\frac{1}{5}\cos\left(\frac{5\pi x}{3}\right)+\cdots\right). (26)