Mathematics, Sciences, and Technologies

“Every secret of a writer’s soul, every experience of his life, every quality of his mind is written large in his works.”
– Virginia Woolf

ODEs 5-5: Termwise Differentiation and Integration of Fourier Series

,

Term-by-term Differentiation of Fourier Series

It is very tempting to apply Calculus operations on an infinite Fourier series, like differentiation or integration formally. In this tutorial, we will discuss when they are allowed and valid. First, Fourier series are induced by the Hermitian operator \( \mathcal{L} = d^2/dx^2 \), with the boundary conditions (3) stated in this tutorial, i.e. the function and its first-order derivative in question has to be periodic at the end-points, \( f(-\pi) = f(\pi), f'(-\pi) = f'(\pi) \). Then, applying \( \mathcal{L} = d^2/dx^2 \) will be possible as stated by Item 2 of the Spectral Theorem in the same tutorial, where the effect of the twice differentiation amounts to just multiplying each of the sinusoidal basis functions by the corresponding eigenvalue. In fact, we have a stronger statement for the formal differentiation of a Fourier series given suitable conditions. (Reference here)

Theorem 1. (Term-by-term Differentiation of Fourier Series) If \( f(x) \) is continuous on \( (-\pi, \pi) \) (the interval can be shifted appropriately) where it obeys the periodic boundary condition \( f(-\pi) = f(\pi) \), and \( f'(x) \) is piecewise continuous on \( (-\pi, \pi) \), then the Fourier series of \( f(x) \) can be differentiated term-by-term.

The proof is as follows. Write down the Fourier series for the continuous \( f(x) \) as usual:

\begin{align}
f(x) = \frac{a_0}{2} + \sum_{m=1}^{\infty} (a_m \cos (mx) + b_m \sin(mx)) \tag{1}
\end{align}

Also, suppose the piecewise continuous (this means \(L^2\)-integrability) derivative \( f'(x) \) has a Fourier series of

\begin{align}
f'(x) = \frac{\alpha_0}{2} + \sum_{m=1}^{\infty} (\alpha_m \cos (mx) + \beta_m \sin(mx)) \tag{2}
\end{align}

except at the jump discontinuities of \( f'(x) \). Then if the formal differentiation does work, we need to show \( \alpha_0 = 0 \) and \( \alpha_m = m b_m, \beta_m = -m a_m \). According to the definition of the Fourier coefficients ((8) and (9) of this tutorial), we indeed have

\begin{align}
\alpha_0 &= \frac{1}{\pi} \int_{-\pi}^{\pi} f'(x) dx = \frac{1}{\pi} [f(x)]_{-\pi}^{\pi} = \frac{1}{\pi}[f(\pi) -f(-\pi)] = 0 \tag{3} \\
\alpha_m &= \frac{1}{\pi} \int_{-\pi}^{\pi} f'(x) \cos(mx) dx \\
&= \frac{1}{\pi} [f(x) \cos(mx)]_{-\pi}^{\pi} -\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) (-m\sin(mx)) dx \\
&= (0) + m (\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(mx) dx) = mb_m \tag{4}
\end{align}

with integration by parts. The \( \beta_m \) part is shown similarly and the result is established.

Example

From the previous exercise in this tutorial, we know that the Fourier series of \(x^2\) is

\begin{align}
x^2 = \frac{\pi^2}{3} + \sum_{m=1}^{\infty} \frac{4(-1)^m}{m^2} \cos(mx) \tag{5}
\end{align}

If we proceed with the formal differentiation, we can obtain

\begin{align}
\frac{d}{dx}(x^2) &= \frac{d}{dx} (\frac{\pi^2}{3} + \sum_{m=1}^{\infty} \frac{4(-1)^m}{m^2} \cos(mx)) \\
2x &= \sum_{m=1}^{\infty} -\frac{4(-1)^m}{m} \sin(mx) \tag{6}
\end{align}

which is consistent with the Fourier series of \( x \) derived as (11) in the same tutorial.

Term-by-term Integration of Fourier Series

Formal integration of a given Fourier series is also possible and even less restrictive:

Theorem 2. (Term-by-term Integration of Fourier Series) For any function \( f(x) \) that is piecewise continuous on \( (-\pi, \pi) \), its Fourier series can be integrated term-by-term.

This means that given the Fourier series of (1), its integral should have the following form:

\begin{align}
F(x) &= \int_0^x f(s) ds \\
&= \frac{a_0}{2}x + \sum_{m=1}^{\infty} [\frac{a_m}{m} \sin (mx) + \frac{b_m}{m} (1-\cos(mx))] \tag{7}
\end{align}

Define \( G(x) = F(x) -a_0x/2 \), which will be continuous, and let’s assume that it has a Fourier series

\begin{align}
G(x) = \frac{A_0}{2} + \sum_{m=1}^{\infty} [A_m \cos (mx) + B_m \sin(mx)] \tag{8}
\end{align}

The Fourier coefficients of \( G(x) \) are then

\begin{align}
A_m &= \frac{1}{\pi} \int_{-\pi}^{\pi} G(x) \cos(mx) dx \\
&= \frac{1}{\pi} [\frac{1}{m} G(x) \sin(mx)]_{-\pi}^{\pi} -\frac{1}{\pi} \int_{-\pi}^{\pi} \frac{1}{m} G'(x) \sin(mx) dx \\
&= (0) -\frac{1}{m\pi} \int_{-\pi}^{\pi} (f(x)-\frac{a_0}{2}) \sin(mx) dx \\
&= -\frac{1}{m\pi} \int_{-\pi}^{\pi} f(x) \sin(mx) dx + \frac{a_0}{2m\pi} \int_{-\pi}^{\pi} \sin(mx) dx\\
&= -\frac{b_m}{m} + (0) = -\frac{b_m}{m} \tag{9}
\end{align}

again using integration by parts. Similarly, \( B_m = a_m/m \). Hence

\begin{align}
G(x) &= \frac{A_0}{2} + \sum_{m=1}^{\infty} [-\frac{b_m}{m} \cos (mx) + \frac{a_m}{m} \sin(mx)] \tag{10}
\end{align}

and

\begin{align}
G(0) &= \frac{A_0}{2} + \sum_{m=1}^{\infty} [-\frac{b_m}{m} \cos (0) + \frac{a_m}{m} \sin(0)] \\
F(0) -a_0\frac{(0)}{2} &= \frac{A_0}{2} -\sum_{m=1}^{\infty} \frac{b_m}{m} \\
0 &= \frac{A_0}{2} -\sum_{m=1}^{\infty} \frac{b_m}{m} \\
\frac{A_0}{2} &= \sum_{m=1}^{\infty} \frac{b_m}{m} \tag{11}
\end{align}

Therefore,

\begin{align}
G(x) &= \sum_{m=1}^{\infty} \frac{b_m}{m} + \sum_{m=1}^{\infty} [-\frac{b_m}{m} \cos (mx) + \frac{a_m}{m} \sin(mx)] \\
&= \sum_{m=1}^{\infty} [\frac{b_m}{m} (1-\cos (mx)) + \frac{a_m}{m} \sin(mx)] \\
F(x) &= \frac{a_0}{2}x + \sum_{m=1}^{\infty} [\frac{a_m}{m} \sin (mx) + \frac{b_m}{m} (1-\cos(mx))] \tag{12}
\end{align}

which confirms (7). Sometimes, we may also want to expand the leading \((a_0/2) x\) term into a Fourier series.

Exercise

For the Fourier series of \(x\) obtained in (11) by this post, if we differentiate both sides twice, the L.H.S. will readily become zero, but the R.H.S. will still contain non-trivial sine terms afterwards so they are obviously unequal. Why does this paradox occur?

Answer

An obvious explanation is that the condition of Theorem (1) is not satisfied because \( x \) is not periodic, so a formal differentiation will fail. Another point to see this is that the corresponding Sturm-Liouville operator \( \mathcal{L} = d^2/dx^2 \) is not Hermitian as the boundary conditions are not satisfied and thus the Spectral Theorem does not work as well.

Leave a Reply

I’m Benjamin

Welcome to my Mathematical World! Here you can find posts and tutorials related to applied topics like Linear Algebra, Calculus, Differential Equations, as well as Programming. Feel free to leave comments and suggestions!

Let’s connect

Discover more from Benjamin's Maths World

Subscribe now to keep reading and get access to the full archive.

Continue reading