Fourier series: Introduction
Calculating a Fourier sine series
We have the following formula: \[\tfrac{1}{2} x=\sin(x) - \tfrac{1}{2}\sin(2x)+\tfrac{1}{3}\sin(3x)-\tfrac{1}{4}\sin(4x)+\cdots\] The formula describes \(\tfrac{1}{2}x\) as infinite sum of sine terms. But how do you get this result? Fourier searched systematically for methods to rewrite other functions in the form of an infinite sum of trigonometric functions. In other words, he just assumed, as in the example shown, that a particular function \(f(x)\) can be rewritten as \[f(x)=b_1\sin(x) +b_2\sin(2x)+b_3\sin(3x)+b_4\sin(4x)+\cdots\] and then tried to determine the coefficients \(b_1\), \(b_2\), \(b_3\). A series like this is now called a Fourier sine series and the coefficients \(b_n\) are called Fourier sine coefficients.
The Fourier sine coefficient \(b_n\) can be regarded as the 'level' of \(\sin nx\) in the function \(f(x)\). For example, if \(f(x)\) is equal to \(4\sin(x)+ 3\sin(2x)\), then the level of \(\sin(x)\) equal to \(4\) and the level of \(\sin(2x)\) is equal to \(3\). The frequency level of a function, i.e., the sequence of \(b_1,b_2, b_3,\ldots\), is often represented through a bar graph, which is referred to as the frequency-amplitude spectrum.
How do you determine, in general, the level of \(\sin(nx)\) in the function \(f(x)\)? You can try to choose \(b_n\) such that \(b_n\sin( nx)\) approximates the function \(f(x)\) as best as possible. This then leads to the following formula:
\[b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\,\dd x\]
If \(f(x)=\tfrac{1}{2}x\) we get: \[b_n=\frac{(-1)^{n+1}}{n}\]
After all, partial integration yields: \[\begin{aligned} \int_{-\pi}^{\pi} \frac{x}{2}\cdot \sin(nx)\,\dd x &= \Bigl[\frac{x\cos(nx)}{2n}\Bigr]_{-\pi}^{\pi} + \int_{-\pi}^{\pi}\frac{\cos(nx)}{2n}\,\dd x \\ \\ &= \frac{-\pi\cos(n\pi)}{n}+ \Bigl[\frac{\sin(nx)}{(2n)^2}\Bigr]_{-\pi}^{\pi}\\ \\ &= \frac{-\pi (-1)^{n}}{n}=\frac{\pi (-1)^{n+1}}{n}\end{aligned}\] Dus: \[ b_n=\frac{1}{\pi}\int_{-\pi}^{\pi} \frac{x}{2}\cdot \sin(nx)\,\dd x= \frac{(-1)^{n+1}}{n}\]
Some well-known formulas With the above Fourier sine series you obtain with the substitution \(x=\tfrac{1}{2}\pi\) the following alternating harmonic series of Leibniz: \[\frac{\pi}{4}=1-\frac{1}{3}+ \frac{1}{5}-\frac{1}{7}+\cdots\] For \(x=\tfrac{1}{4}\pi\) you find one of Euler's formulas, namely: \[\pi=2\sqrt{2}\bigl( 1+\frac{1}{3}-\frac{1}{5}-\frac{1}{7}+\frac{1}{9}+\frac{1}{11}-\frac{1}{13}-\frac{1}{15}+\cdots\bigr)\]