Problem with evaluating $a_n$ in $f(x)=a_0+\sum_{n=1}^{\infty}\left(a_n\cos(nx)+b_n\sin(nx)\right)$

60 Views Asked by At

According to my understanding, for the Fourier series of the function $f(x)$ if we want to find $a_n$ we multiply both sides by $\cos(mx)$ for $m\in\mathbb{Z^+}$then integrate both sides on the interval $[-\pi,\pi],$

$$f(x)=a_0+\sum_{n=1}^{\infty}\left(a_n\cos(nx)+b_n\sin(nx)\right)$$

$$\int_{-\pi}^{\pi}\cos(mx)f(x)dx=\int_{-{\pi}}^{\pi}a_0\cos(mx) dx+\sum_{n=1}^{\infty}\left(a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx+b_n\int_{-{\pi}}^{{\pi}}\sin(nx)\cos(mx)dx\right)$$

The function $g(x)=\sin(nx)\cos(mx)$ is odd, hence the last integral is equal to zero. Also $$\int_{-{\pi}}^{{\pi}}a_0\cos(mx) dx=\frac{2a_0}m\sin(m\pi)=0$$

Hence, $$\int_{-\pi}^{\pi}\cos(mx)f(x)dx=\sum_{n=1}^{\infty}a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx\tag 1$$

And the integral in the RHS can be evaluated as follow, $$\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx=\frac12\int_{-\pi}^{\pi}\cos(n+m)x+\cos(n-m)xdx$$

And it is non-zero only in the case $n=m$ and the integral will be equal to $\pi$. Substituting this value in the equation $(1)$ gives

$$\int_{-\pi}^{\pi}\cos(nx)f(x)dx=\pi\sum_{n=1}^{\infty}a_n$$

But I saw everywhere that the formula to calculate $a_n$ is$$a_n=\frac1{\pi}\int_{-\pi}^{\pi}\cos(nx)f(x)dx$$ But according to the work I showed LHS should be$\sum_{n=1}^{\infty}a_n$. But I don't know what I'm missing.

1

There are 1 best solutions below

0
On BEST ANSWER

You almost have it. In the step where you substituted into the right side of ($1$) to get

$$ \sum_{n=1}^{\infty}a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx = \pi \sum_{n=1}^\infty a_n,$$

you substituted as though the integral is equal to $\pi$ for every $n$. But as you said, it equals $\pi$ when $n=m$ and equals $0$ when $n \neq m$. So we're summing an infinite sequence of values, but it turns out all but one of those values is zero. So the correct equation is

$$ \sum_{n=1}^{\infty}a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx = \pi a_m,$$

To write this out in even more detail, we could say

$$ \sum_{n=1}^{\infty}a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx = a_1 \cdot 0 + a_2 \cdot 0 + \cdots + a_{m-1} \cdot 0 + a_m \pi + a_{m+1} \cdot 0 + \cdots $$

Or if you prefer Kronecker delta notation,

$$ \sum_{n=1}^{\infty}a_n\int_{-\pi}^{\pi}\cos(nx)\cos(mx)dx = \sum_{n=1}^\infty \pi a_n \delta_{mn} = a_m \pi $$