Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to the main page for the fourth course APMA0360
Return to Part V of the course APMA0340
Introduction to Linear Algebra with Mathematica

Preface


Definition of Fourier Series


 

Finite Partial Sums of Fourier Series


For any real x, the finite sum
\[ F_N (x) = \frac{a_0}{2} + \sum_{k=1}^{N} \left[ a_k \cos \left( \frac{k \pi x}{\ell} \right) + b_k \sin \left( \frac{k \pi x}{\ell} \right) \right] \]
or
\[ F_N (x) = \sum_{k=-N}^{N} \alpha_n e^{{\bf j}n \pi x/\ell} \]
is called a trigonometric polynomial of order N.

In calculus, you learnt that an infinite series \( \sum_{k\ge 0} a_k \) converges (or is convergent) to S if the sequence of partial sums \( S_n = \sum_{k= 0}^n a_k \) tends to S as n → ∞. In case of Fourier series, elements of series depend on real parameter x ∈ [−ℓ, ℓ], and we come to definition of its partial sums.

Theorem 1: For any real-valued function f : [−ℓ, ℓ] → ℝ and any positive integer N ∈ ℕ = { 0, 1, 2, … }, its N-th partial Fourier exponential sum
\begin{equation} \label{EqFourier.5} S_N (f;x) = \sum_{n=-N}^N \hat{f}(n)\,e^{{\bf j} n\pi x/\ell} \end{equation}
and N-th partial Fourier trigonometric sum
\begin{equation} \label{EqFourier.6} S_N (f;x) = \frac{1}{2}\,a_0 + \sum_{k=1}^N \left[ a_k \cos \left( \frac{k\pi x}{\ell} \right) + b_k \sin \left( \frac{k\pi x}{\ell} \right) \right] \end{equation}
are the same; here coefficients 𝑎k, bk and \( \displaystyle \hat{f}(n) \) are determined by the Euler--Fouier formulas \eqref{EqFourier.2} and \eqref{EqFourier.4}, respectively. Moreover, the N-th partial Fourier sum is expressed in an integral form, known as a convolution, which is denoted by star:
\[ S_N (f;x) = \frac{1}{\ell} \int_{-\ell}^{\ell} f(y)\,D_N \left( \frac{\pi (x-y)}{\ell} \right) {\text d}y = \frac{1}{\ell} \left( f \star D_N \right) (x), \]
where DN(z) is called the Dirichlet kernel, and
\[ D_N (z) = \frac{\sin \left( N + \frac{1}{2} \right) z}{2\,\sin\frac{z}{2}} . \]
Note that according to the L'Hôpital's rule, DN(0) = N + ½. It is a custom to utilize ★ for convolution of two functions:
\[ \left( f \star g \right) (x) = g \star f (x) = \int f(y) g(x-y)\,{\text d} y . \]
We are going to prove the statement for a particular case when ℓ = π in order to simplify calculations. We compute
\begin{align*} S_N (f; x) &= \sum_{n=-N}^N \hat{f}(n) \,e^{{\bf j}nx} = \sum_{n=-N}^N \frac{1}{2\pi} \int_{-\pi}^{\pi} f(y)\,e^{-{\bf j}n y} {\text d}y\, e^{{\bf j}nx} \\ &= \frac{1}{2\pi} \int_{-\pi}^{\pi} f(y) \sum_{n=-N}^N e^{{\bf j}n\left( x-y \right)} \\ &= \frac{1}{\pi} \int_{-\pi}^{\pi} f(y)\,D_N (x-y) \,{\text d}y = \frac{1}{\pi} \, f \star D_N (x) . \end{align*}
Here
\[ D_N (t) = \frac{1}{2}\,\delta_N (t) = \frac{1}{2} \sum_{n=-N}^N e^{{\bf j}n t} \qquad ({\bf j}^2 =1) \]
is the Dirichlet kernel. Also, fg means the convolution of f and g, which is defined as
\[ f \star g (x) = \int_{-\ell}^{\ell} f(y)\,g(x-y)\,{\text d}y = \int_{-\ell}^{\ell} f(x-y)\,g(y)\,{\text d}y = g \star f . \]
Next, we have
\begin{align*} \delta_N (x) &= \sum_{n=-N}^N e^{{\bf j} n x} = e^{-{\bf j} N x} \sum_{n=0}^{2N} e^{{\bf j} n x} \\ &= e^{-{\bf j} N x} \frac{1 - e^{-{\bf j} \left( 2N+1 \right) x}}{1 - e^{{\bf j} x}} = \frac{e^{-{\bf j} Nx} - e^{-{\bf j} \left( N+1 \right) x}}{1 - e^{{\bf j} x}} \\ &= \frac{e^{-{\bf j} \left( N + \frac{1}{2} \right) x} - e^{{\bf j} \left( N + \frac{1}{2} \right) x}}{e^{-{\bf j} x/2} - e^{-{\bf j} x/2}} \\ &= \frac{\sin \left( N + \frac{1}{2} \right) x}{\sin\frac{x}{2}} \end{align*}
because
\[ \sin\theta - \frac{1}{2{\bf j}} \left( e^{{\bf j}\theta} - e^{-{\bf j}\theta} \right) . \]

 

The formula for trigonometric partial sum is proved in Lemma 1 of convergence section.
Lemma 1: The following integrals diverge:
\[ \lim_{N\to\infty}\int_{-\pi}^{\pi} D_N (x)^2 {\text d} x = \infty , \qquad \mbox{and} \qquad \int_{-\pi}^{\pi} \left\vert D_N (x) \right\vert {\text d} x \ge 4\,\mbox{Si}(\pi ) + \frac{8}{\pi}\,\ln n , \]
where Si(x) is the sine integral.
For any small δ, we break the integral into three parts:
\[ I_N = \int_{-\pi}^{\pi} D_N (x)^2 {\text d} x = I_{\delta} (N) + I_2 + I_3 , \]
where
\[ I_{\delta} (N) = 8 \int_{0}^{\delta} \frac{\sin^2 \left( N + \frac{1}{2} \right) x}{x^2} \, {\text d} x , \]
and
\[ I_2 = \int_{|x| \le \delta} \sin^2 \left( N + \frac{1}{2} \right) x \left( \frac{1}{\sin^2 \frac{x}{2}} - \frac{4}{x^2} \right) {\text d} x , \qquad I_3 = \int_{|x| > \delta} D_N (x)^2 {\text d} x . \]
Since the kernel of integral I2 is bounded in a neighborhood of the origin,
Series[1/(Sin[x/2])^2 - 4/x^2, {x, 0, 5}]
SeriesData[x, 0, { Rational[1, 3], 0, Rational[1, 60], 0, Rational[1, 1512]}, 0, 6, 1]
both integrals, I2 and I3, tend to zero as N → ∞ according to Riemann--Lebesgue lemma. Using substitution s = (N + ½)x in integral Iδ, we get
\[ I_{\delta} (N) = 4 \left( 2N + 1 \right) \int_{0}^{\delta \left( N + 1/2\right)} \frac{\sin^2 s}{s^2}\, {\text d}s . \]
Since the latter integral converges
Integrate[(Sin[s])^2/s^2, {s, 0, Infinity}]
\[Pi]/2
\[ \int_0^{\infty} \frac{\sin^2 s}{s^2}\,{\text d}s = \frac{\pi}{2} , \]
we conclude that
\[ I_{\delta} (N) = O\left( 2N + 1 \right) \to \infty \qquad\mbox{as} \quad s N \to infty . \]
End of Proof for the first part
We have
\begin{align*} \| D_N (x) \|_1 &= \int_{-\pi}^{\pi} \left\vert D_N (x) \right\vert {\text d}x = 2 \int_{0}^{\pi} \left\vert D_N (x) \right\vert {\text d}x \ge \int_0^{\pi} \frac{\left\vert \sin [(2N+1) x/2] \right\vert}{x}\,{\text d} x \end{align*}
because \( \displaystyle \frac{2}{x} \le \frac{1}{\left\vert \sin (x/2) \right\vert} . \) In the latter integral, we make substitution \( \displaystyle t = \left( 2N+1 \right) x/2 \) to obtain
\begin{align*} \| D_N (x) \|_1 &\ge \int_0^{(2N+1) \pi /2} \frac{|\sin t|}{t}\,{\text d}t \\ &= \sum_{k=0}^{N-1} \int_{k\pi}^{(k+1)\pi} \frac{|\sin t|}{t}\,{\text d}t + \int_{N\pi}^{N\pi + \pi /2}\frac{|\sin t|}{t}\,{\text d}t \\ &\ge \sum_{k=0}^{N-1} \int_{k\pi}^{(k+1)\pi} \frac{|\sin t|}{(k+1)\pi}\,{\text d}t + \int_{N\pi}^{N\pi + \pi /2}\frac{|\sin t|}{\pi \left( N + 1/2 \right)}\,{\text d}t . \end{align*}
In each integral of the latter sum, we change the dummy variable of integration so each integration starts from zero:
\begin{align*} \| D_N (x) \|_1 &\ge \left\vert \sum_{k=0}^{N-1} \int_0^{\pi} \frac{\sin (s)} {\left( k+1 \right) \pi} \,{\text d} s \right\vert + \frac{1}{\left( N + 1/2 \right) \pi} \int_0^{\pi /2} \frac{\sin (s)}{s} \,{\text d} s \\ & \ge \frac{2}{\pi} \sum_{k=0}^{N-1} \frac{1}{k+1} + \frac{2}{\left( 2N + 1 \right) \pi} \,\mbox{Si} \left( \frac{\pi}{2} \right) \\ &= \frac{2}{\pi}\, H_N + \frac{2}{\left( 2N + 1 \right) \pi} \,\mbox{Si} \left( \frac{\pi}{2} \right) , \end{align*}
where HN is the harmonic number that approaches infinity as logarithm when N → ∞. Indeed, Hn = lnn + γ +o(n) as n → ∞, where γ = 0.5772156649 is the Euler–Mascheroni constant.
The Dirichlet kernel is related to Fourier expansion of the Dirac delta function:
\[ \delta (x-a) = \frac{1}{2\pi} \, \int_{-\infty}^{\infty} e^{{\bf j} (x-a)t} \, {\text d} t = \lim_{n\to \infty} \, \frac{1}{2\pi} \, \sum_{k=-n}^n \, e^{{\bf j} k(x-a)} \quad \left( = \frac{\sin \left[ \left( n+ \frac{1}{2} \right) (x-a) \right]}{2\pi\, \sin \frac{x-a}{2}} \right) , \]
where j is the unit vector in the positive vertical direction on the complex plane ℂ, so j² = −1.

Example 3: The following sum

\[ D_N^{\ast} = \sum_{k=1}^N \sin (kx) = \frac{\cos \frac{x}{2} - \cos \left( N + \frac{1}{2} \right) x}{2\,\sin\frac{x}{2}} \tag{3.1} \]
is known as the Dirichlet conjugate kernel. The derivation of formula (3.1) is based on extracting the imaginary part of
\[ \sum_{k=1}^N z^k = \Im \frac{z - z^{N+1}}{1-z} , \qquad z = e^{{\bf j} x} . \]
Multiplying by the complex conjugate (1 - z)*, we get
\[ D_N^{\ast} = \Im \frac{z - z^{N+1}}{1-z} \cdot \frac{(1-z)^{\ast}}{( 1- z)^{\ast}} = \Im \frac{z - z^{N+1} -|z|^2 - z^{N+1} z^{\ast}}{(1-\cos x)^2 + \sin^2 x} . \tag{3.2} \]
Extraction of the imaginary part yields
\[ D_N^{\ast} = \frac{\sin x - \sin (N+1) x - \sin Nx}{2 - 2\,\cos x} \]
Then using trigonometric identities
\begin{align*} 2\,\sin\alpha\,\cos\beta &= \sin \left( \alpha + \beta \right) + \sin \left( \alpha - \beta \right) , \qquad \alpha = 1/2, \quad \beta = N + 1/2 , \\ \sin x &= 2 \sin\tfrac{x}{2}\,\cos \tfrac{x}{2} , \\ 1- \cos x &= 2\,\sin^2 \tfrac{x}{2} , \end{align*}
we derive the required formula for the Dirichlet conjugate kernel.    ■
End of Example 3

 

 

 

Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions