Fourier Series Confusion with constant an

29 Views Asked by At

I am currently evaluating the classical Fourier series for $f(x) = \cos(2x)$ on $(-\pi,\pi)$. We can compute the coefficient $a_n$ as

\begin{align} a_{n} &= \frac1\pi \int_{-\pi}^{\pi}f(x) \cos(nx)dx \\ &= \frac{2n \sin(n \pi )}{\pi(n^2-4)} \end{align}

My abilities in performing Fourier series means I can get to the end result but I decided to slow down and look at this result. I am very confused why I have a $\sin(n \pi)$ in the numerator as I would then expect $a_n$ to be zero for any $n$.

Can someone explain to me if I have performed this wrong or if I am just looking at the result the wrong way? Any help would be greatly appreciated.

Andrew

2

There are 2 best solutions below

0
On

$$\sin(\pi n ) = 0$$

Sines vanishes at integer multiple of $\pi$.

0
On

$\sin(n\pi)=0$ for all $n$, which means that as long as there is no other singularity in the formula at a value of $n$, the result can be understood as just $0$. But there is such a singularity in the $n=2$ case. In this case this formula is meaningless since it reads 0/0.

You can work around it by doing the $n=2$ calculation in a different way, e.g. apply $\cos(2x)^2=\frac{1+\cos(4x)}{2}$. Alternatively you can salvage this calculation by thinking of the frequency $n$ as a continuous quantity and taking the limit as $n \to 2$; this works because $g(a)=\int_{-\pi}^\pi f(x) \cos(ax) \, dx$ is a continuous function.