[Math] Fourier Series of $f(x) = \sin x$ on $-\pi \leq x \leq \pi$

fourier seriesordinary differential equationspartial differential equations

Find the Fourier series of,

$$f(x) = \sin (x)$$

on the interval $- \pi \leq x \leq \pi. $ I am not quite sure if my workings are correct or if I have chose the right formulas to use since this is my first encounter of Fourier series of trigonometric functions.

My logic here is that $f(x)$ is a period function so I have to use the formula,

$$f(x) = \frac{A_0}{2} + \sum _ {n=1}^{\infty}\Big(A_n\cos(nx) + B_n\sin (nx)\Big)$$

where,

$$A_0 = \frac{1}{\pi} \int^{\pi}_{-\pi} f(x)dx$$
$$A_n = \frac{1}{\pi} \int^{\pi}_{-\pi} f(x)\cos (nx)dx$$
$$B_n = \frac{1}{\pi} \int^{\pi}_{-\pi} f(x)\sin (nx)dx$$

Looking at the function $f(x) = \sin x$ this is a odd function so $A_0$ is a odd function, so $A_0=0$.

Next looking at $A_n$, $f(x)$ is a odd function at $\cos(nx)$ is a even function, so a even function multiplied by a odd function is a odd function and therefore $A_n = 0 $

Finally considering $B_n$,

$$B_n = \frac{1}{\pi } \int^{\pi}_{-\pi} \sin (x) \sin(nx) = \frac{cos(x)sin(nx)-nsin(x)cos(nx)}{n^2-1}\Bigg|_{-\pi}^{\pi} = – \frac{2sin(\pi n )}{n^2-1}$$

Therefore, the Fourier series of $f(x) = \sin x $ on $-\pi \leq x \leq \pi$ is,

$$f(x) = \sum_{n=1}^{\infty} – \frac{2sin(\pi n )}{n^2-1}\sin(nx) = \sum _{n=1}^{\infty} \sin x$$

Best Answer

You can skip all of the difficult work in this problem and a similar set of problems by thinking slightly differently about the problem. The Fourier series is simply a sum of the form:

$$A_0+\sum^\infty_{n=1}(A_n\cos(nx)+B_n\sin(nx)).$$

Where $A$ and $B$ are such that the sum equals $f(x)$ on a specific domain. For trig functions, no calculus is necessary. Simply realize that the sum is really just

$$A_0 + (A_1\cos(1x) + A_2\cos(2x) + \cdots) + (B_1\sin(1x) + B_2\sin(2x) + \cdots)$$

and so if we want to find the $A$s and $B$s necessary to have that sum equal $\sin(kx)$ or $\cos(kx)$ for an integer $k$, we just set all but one of them to $0$.

In this case, we set $B_1$ to $1$ and everything else to $0$:

$$A_0 + (A_1\cos(1x) + A_2\cos(2x) + \cdots) + (B_1\sin(1x) + B_2\sin(2x) + \cdots)\\ = 0 + (0\cos(1x)+0\cos(2x)+\cdots) + (1\sin(1x)+0\sin(2x) + \cdots)\\=\sin(x).$$

Related Question