Fourier series solutions VII - Solving differential equations with Fourier series

Let's see how we can sometimes use Fourier series to help us solve differential equations, including some partial differential equations. We will give two real-world examples, both involving a concept known as heat flow. In both cases, we will be dealing with two-variable functions, where our two variables are position x and time t. In the first example, our function will be periodic in position, while in the second example it will be periodic in time.

Heat flow


Let's first give a quick-and-dirty derivation of the so-called "heat equation". If you're already familiar with the heat equation, you can skip to the first example.

If you're still here, then suppose something one-dimensional is heating up and u(x,t) denotes the temperature at position and time (all in your favorite chosen units). Also let q(x,t) denote the rate at which energy flows at position and time , where the rate is positive if the energy flows in the positive -direction.

We make two basic assumptions about the functions u(x,t) and q(x,t):

Assumption 1: Newton's Law of Heating

At each fixed position x, we assume the rate of energy flow with respect to time t is proportional to the negative gradient (with respect to x) of temperature. In other words, if the temperature increases greatly as we move in the positive x-direction, then we are assuming that the energy should flow proportionally in the direction from hot-to-cold. In terms of an equation, we are assuming

q(x,t)=βˆ’kux(x,t)

for some positive constant k. Physically, the constant k can be thought of as a measure of how easily energy flows across the substance when there is a temperature difference. Because of this (and unfortunate history), the reciprocal 1k is sometimes called the thermal resistance of the substance.

Assumption 2: Energy accumulation

Suppose we look at a small chunk of the substance, of width Ξ”x from location x to location x+Ξ”x. Let's consider the rate at which energy increases in this little piece. On the one hand, energy enters this region on the left at a rate q(x,t) and exists the piece on the right at rate q(x+Ξ”x,t). So, the rate of change of energy in this little piece should be approximately

q(x,t)βˆ’q(x+Ξ”x,t).

On the other hand, we will also assume that the rate at which energy in this little piece increases is proportional to the length of the piece and the rate at which the temperature is increasing in the piece.In other words, we will assume

q(x,t)βˆ’q(x+Ξ”x,t)β‰ˆlβ‹…ut(x,t)β‹…Ξ”x

for some positive constant l>0. This constant l is sometimes called the thermal capacity of the substance.

We can rewrite the above equation as

ut(x,t)β‰ˆβˆ’q(x+Ξ”x,t)βˆ’q(x,t)lβ‹…Ξ”xβ‰ˆβˆ’1lqx(x,t).

Our second assumption is therefore that

ut(x,t)=βˆ’1lqx(x,t).

Combining these two assumptions

Using the above assumptions, we are suppose u(x,t) and q(x,t) are related by the two partial differential equations

q(x,t)=βˆ’kux(x,t)ut(x,t)=βˆ’1lqx(x,t).

We can combine these two differential equations to deduce a single differential equation that u(x,t) must satisfy, as follows. Take partial derivatives with respect to x in the first equation to obtain

qx(x,t)=βˆ’kuxx(x,t).

Now substitute this into the second differential equation to obtain

ut(x,t)=kluxx(x,t).

We call this equation the Heat Equation, since it gives a model for how heat behaves in a one-dimensional substance.

Example: Hot wire


Suppose we heat a thin circular wire. Let's center a polar coordinate system on this wire and let x denote the position on the wire at polar angle ΞΈ=2Ο€x. Then let u(x,t) denote the temperature of the wire at position x and time t.

By our choice of coordinate x, the function u(x,t) is periodic in x with period 1. We now make two assumptions:

  1. The function u(x,t) satisfies the heat equation ut=uxx.

  2. For each fixed value of t, the function u(x,t) can be represented by a Fourier series in x, i.e., for each value of t there are complex numbers cn(t) such that

    u(x,t)=βˆ‘n=βˆ’βˆžβˆžcn(t)e2Ο€inx.
Pay close attention to the variables

Imagine u(x,t) is a family of functions of x, one function at each time t. Each of those functions is periodic in x, so we represent it as a linear combination of our favorite periodic functions in x, namely e2Ο€inx. The coefficients of those linear combinations presumably depend on t, however, which is why they're denoted cn(t).

Before moving on, let's note that for each fixed value of t, the coefficient cn(t) of e2Ο€inx is the Fourier coefficient of the function u(x,t) at index n. In particular, the nth Fourier coefficient of u(x,0) is the coefficient cn(0), and hence satisfies

cn(0)=∫01u(x,0)eβˆ’2Ο€inxdx.

This will come up again at the very end of this example.

Solving this partial differential equation

Let's now use the method we employed with power series (and Frobenius series), i.e., substitute our candidate series into the differential equation. In this case, let's first compute

ut=βˆ‚βˆ‚t(βˆ‘n=βˆ’βˆžβˆžcn(t)e2Ο€inx)=βˆ‘n=βˆ’βˆžβˆžβˆ‚βˆ‚t(cn(t)e2Ο€inx)=βˆ‘n=βˆ’βˆžβˆžcnβ€²(t)e2Ο€inx.

(We interchanged the infinite sum and the partial differentiation, which probably deserves justification.)

On the other hand, we can also similarly compute

ux=βˆ‚βˆ‚x(βˆ‘n=βˆ’βˆžβˆžcn(t)e2Ο€inx)=βˆ‘n=βˆ’βˆžβˆžβˆ‚βˆ‚x(cn(t)e2Ο€inx)=βˆ‘n=βˆ’βˆžβˆžcn(t)β‹…2Ο€inβ‹…e2Ο€nx

and then

uxx=βˆ‚βˆ‚x(βˆ‘n=βˆ’βˆžβˆžcn(t)β‹…2Ο€ine2Ο€inx)=βˆ‘n=βˆ’βˆžβˆžβˆ‚βˆ‚x(cn(t)β‹…2Ο€ine2Ο€inx)=βˆ‘βˆ’βˆžβˆžcn(t)β‹…4Ο€2i2n2e2Ο€inx=βˆ‘n=βˆ’βˆžβˆžβˆ’4Ο€2n2cn(t)e2Ο€inx.

It follows that our Fourier series is a solution to our differential equation exactly when

βˆ‘n=βˆ’βˆžβˆžcnβ€²(t)e2Ο€inx=βˆ‘n=βˆ’βˆžβˆžβˆ’4Ο€2n2cn(t)e2Ο€inx.

Notice that, from the point of view of the variable x, both sides of this equation are linear combinations of the functions e2Ο€inx for n∈Z. Since the set of functions {e2Ο€inx∣n∈Z} is a linearly independent set, the only way two linear combinations can be equal is if the coefficient of e2Ο€inx is the same on each side, for every n. In other words, we must have

cnβ€²(t)=βˆ’4Ο€2n2cn(t)

for every integer n.

A different kind of relation

When we looked for power series (or Frobenius series) solutions, we always found the coefficients of the mystery series needed to satisfy a recursion relation. Here, however, we see that something different has happened: the coefficients of our mystery Fourier series need to satisfy another differential equation!

You might think we've wasted our time, exchanging the problem of solving one differential equation for satisfying an entire family of new differential equations. Notice, however, that these new differential equations are ordinary, first-order, homogeneous, linear differential equations. If we fix n for the moment, we can rewrite our new differential equation as

cnβ€²(t)=Ancn(t),

where An=βˆ’4Ο€2n2 is a constant. The general solution to this differential equation is

cn(t)=BneAnt,

where Bn is any constant. In fact, if we evaluation at t=0 we see that Bn=cn(0), so we can write our solution as

cn(t)=cn(0)eβˆ’4Ο€2n2t.

We've done it! Under the assumptions we've made for this problem, we've proven that the general solution is

u(x,t)=βˆ‘n=βˆ’βˆžβˆžcn(0)eβˆ’4Ο€2n2te2Ο€inx.

Additional observations that foreshadow some cool things

It is common to describe the solution to a differential equation using two pieces of information:

  1. A description of the initial state of the system.
  2. A description of how the system evolves over time, i.e., of the dynamics of the system.

In our case, the first piece of information is the function u(x,0), which gives the initial temperature at each point x on the wire. Let's denote this function f(x). This function is periodic with period 1 and its Fourier coefficients satisfy

f^(n)=∫01f(x)eβˆ’2Ο€inxdx=∫01u(x,0)eβˆ’2Ο€inxdx=cn(0).

We can now rewrite our final solution, above, as

u(x,t)=βˆ‘n=βˆ’βˆžβˆžf^(n)eβˆ’4Ο€2n2te2Ο€inx.

So now the initial state of the system can be seen as contributing to the solution. But we can do even better. Let's replace f^(n) in the above sum with its integral value and then move around some terms:

u(x,t)=βˆ‘n=βˆ’βˆžβˆžf^(n)eβˆ’4Ο€2n2te2Ο€inx=βˆ‘n=βˆ’βˆžβˆž(∫01f(y)eβˆ’2Ο€inydy)eβˆ’4Ο€2n2te2Ο€inx=βˆ‘n=βˆ’βˆžβˆž(∫01f(y)eβˆ’4Ο€2n2te2Ο€in(xβˆ’y))=∫01f(y)(βˆ‘n=βˆ’βˆžβˆžeβˆ’4Ο€2n2te2Ο€in(xβˆ’y))dy=∫01f(y)g(xβˆ’y,t)dy,

where g(z,t)=βˆ‘n=βˆ’βˆžβˆžeβˆ’4Ο€2n2te2Ο€inz.

Why did we do all of this? It turns out that our energy system (of a hot wire) is governed by:

  1. The initial temperature information, which is function f(x) that is periodic (with period 1). This is sometimes called the initial impulse.
  2. A function g(x,t) that determines how the energy moves through the system. This is sometimes called the impulse response or convolving function.
  3. The integral above, which combines the functions f(x) and g(x,t), is called the convolution of the two functions. We will see that it can be seen as a "smoothed average" of the nearby temperatures, using the convolving function as a weighting function.

For now this all might seem a bit much, but as our theory develops it will prove remarkable prescient!

Example: Hot Earth


In this example, let us now imagine we've chosen a fixed position on the surface of the earth, and we let u(x,t) denote the temperature x meters below the surface at time t (in years). This time, let us assume:

  1. The function satisfies the heat equation ut=12uxx. There is nothing special about the value of 12, other than to provide slight contrast with the previous example (and possibly make some numbers later on slightly nicer looking).

  2. The function u(x,t) is periodic in t with period 1. In other words, at any fixed position x, the temperature should repeat annually. While that's not totally realistic, it's not an entirely terrible assumption. In places like Michigan, for instance, it tends to be cold every December and hot every July. Because of this assumption, we will assume we can represent u(x,t) by a Fourier series in t, i.e., as

    u(x,t)=βˆ‘n=βˆ’βˆžβˆžcn(x)e2Ο€int.
Compare with the previous example

Note that in this example our function u(x,t) is assumed to be periodic in time t, not in position x. That means our Fourier series should be a combination of our basic periodic functions in t, namely e2Ο€int, where the coefficients depend on the position variable x.

We now substitute this proposed Fourier series into our heat equation, this time finding that

βˆ‘n=βˆ’βˆžβˆž2Ο€inβ‹…cn(x)e2Ο€int=βˆ‘n=βˆ’βˆžβˆž12cnβ€³(x)e2Ο€int.

Once again, by the linear independence of the functions {e2Ο€int}n, the above equality implies that for all n we just have

2Ο€inβ‹…cn(x)=12cnβ€³(x),

or equivalently,

cnβ€³(x)=4Ο€inβ‹…cn(x).

Solving this new differential equation

This new differential equation[1] is a second-order, linear, homogeneous differential equation. We can solve it using our methods from Linear Analysis I, although there's a good chance you never worked through an example with complex coefficients like this. Fortunately, the process is the same, so long as you're familiar with how to find roots of complex numbers.

In operator notation, we can write our new differential equation as

(D2βˆ’4Ο€in)cn=0,

where D is the differential operator ddx. We now need to find the roots of the so-called auxiliary polynomial, namely p(z)=z2βˆ’4Ο€in. In other words, we need to find all complex numbers z such that z2=4Ο€in. Fortunately, there is a straightforward process to do this, using exponential notation.

Suppose z is one of the roots, so that z2=4Ο€in. Let's rewrite both sides in polar-exponential form. On the left-hand side we'll simply write z=reiΞΈ. On the right-hand side we have two cases to consider. When nβ‰₯0, the number 4Ο€in is purely imaginary with nonnegative imaginary part, i.e., lies on the positive imaginary axis. Its polar angle is therefore Ο€2 and its polar length is 4Ο€n, so in polar-exponential form this number is 4Ο€nβ‹…eiβ‹…Ο€2. The equality z2=4Ο€in then becomes

r2eiβ‹…2ΞΈ=4Ο€nβ‹…eiβ‹…Ο€2.

In polar-exponential form, two complex number are the same exactly when they have the same polar distance and the same angle, up to integer multiples of 2Ο€. So, the above equation implies that r2=4Ο€n and 2ΞΈ=Ο€2+2Ο€k for k∈Z. It follows that r=2Ο€n and ΞΈ=Ο€4+Ο€k for k∈Z. This leads to the two distinct complex numbers z1=2Ο€nβ‹…eiβ‹…Ο€4 and z2=2Ο€nβ‹…eiβ‹…5Ο€4.

We now repeat the previous computation in the case n<0. In that case, the number 4Ο€in is purely imaginary with negative imaginary part, i.e., lies on the negative imaginary axis. Its polar angle is therefore βˆ’Ο€2 and its polar length is 4Ο€|n|, so in polar-exponential form this number is 4Ο€|n|eβˆ’iβ‹…Ο€2. The equality z2=4Ο€in then becomes

r2eiβ‹…2ΞΈ=4Ο€|n|eβˆ’iβ‹…Ο€2.

It follows that r=2Ο€|n| and ΞΈ=βˆ’Ο€4+Ο€k for k∈Z. This leads to the two distinct complex numbers z3=2Ο€|n|β‹…eβˆ’iβ‹…Ο€4 and z4=2Ο€|n|β‹…eβˆ’iβ‹…5Ο€4. (We've written the angles in this way so that it's clear z1 and z3 are complex conjugates, as are z2 and z4).

Before returning to our Fourier series, in this case it helps to rewrite the above complex numbers in their real and imaginary parts. Using Euler's identity, we have

z1=2Ο€nβ‹…eiβ‹…Ο€4=2Ο€nβ‹…(cos⁑(Ο€/4)+isin⁑(Ο€/4))=2Ο€nβ‹…(22+iβ‹…22)=2Ο€n(1+i)

Similarly, we find that

z2=βˆ’2Ο€n(1+i)z3=2Ο€|n|(1βˆ’i)z4=βˆ’2Ο€|n|(1βˆ’i).

Now that we finally have these roots, we can conclude that the general solution to the second-order differential equation

(D2βˆ’4Ο€in)cn=0

is

cn(x)={Ane2Ο€n(1+i)x+Bneβˆ’2Ο€n(1+i)xΒ whenΒ nβ‰₯0Ane2Ο€|n|(1βˆ’i)x+Bneβˆ’2Ο€|n|(1βˆ’i)xΒ whenΒ n<0
Time to cheat

It turns out that, in our particular problem, our Fourier coefficients must have An=0 for all n. We will take that as a fact for now, but I encourage you to investigate what happens to our final solution (below) if we do not make that assumption.

Using the above cheat, we can now conclude that

cn(x)={Bneβˆ’2Ο€n(1+i)xΒ whenΒ nβ‰₯0Bneβˆ’2Ο€|n|(1βˆ’i)xΒ whenΒ n<0

As usual, if we set x=0 in the above expression then we obtain cn(0)=Bn, so we can rewrite the above as

cn(x)={cn(0)eβˆ’2Ο€n(1+i)xΒ whenΒ nβ‰₯0cn(0)eβˆ’2Ο€|n|(1βˆ’i)xΒ whenΒ n<0

Even better, if we let f(t)=u(0,t) (the temperature at the surface, which we can think of as the initial data for this system), then just as in the previous example we can verify that f^(n)=cn(0), and so we can rewrite the previous expression as

cn(x)={f^(n)eβˆ’2Ο€n(1+i)xΒ whenΒ nβ‰₯0f^(n)eβˆ’2Ο€|n|(1βˆ’i)xΒ whenΒ n<0

The solution to our "Hot Earth" problem is therefore

u(x,t)=βˆ‘n=βˆ’βˆžβˆ’1f^(n)eβˆ’2Ο€|n|(1βˆ’i)xe2Ο€int+βˆ‘n=0∞f^(n)eβˆ’2Ο€n(1+i)xe2Ο€int

Analyzing a special case

The above formula looks pretty complicated, so let's consider a special case in which a bunch of the terms greatly simplify. Suppose the temperature at the surface were given by f(t)=sin⁑(2Ο€t). Converting this function directly into complex exponential functions, we find that

f(t)=i2eβˆ’2Ο€itβˆ’i2e2Ο€it.

It follows that f^(βˆ’1)=i2, f^(1)=βˆ’i2 and f^(n)=0 for all other n. Our giant summation above then reduces to simply

u(x,t)=i2eβˆ’2Ο€(1βˆ’i)xeβˆ’2Ο€itβˆ’i2eβˆ’2Ο€(1+i)xe2Ο€it

We can simplify this expression and convert it into a function involving only real numbers, as follows:

u(x,t)=i2eβˆ’2Ο€(1βˆ’i)xeβˆ’2Ο€itβˆ’i2eβˆ’2Ο€(1+i)xe2Ο€it=i2eβˆ’2Ο€β‹…x(ei(2Ο€β‹…xβˆ’2Ο€t)βˆ’eβˆ’i(2Ο€β‹…xβˆ’2Ο€t))=i2eβˆ’2Ο€β‹…x(2isin⁑(2Ο€β‹…xβˆ’2Ο€t))=βˆ’eβˆ’2Ο€β‹…xsin⁑(2Ο€β‹…xβˆ’2Ο€t)=eβˆ’2Ο€β‹…xsin⁑(2Ο€tβˆ’2Ο€β‹…x).

A physicist might call this a damped and phase-shifted sine function. The term eβˆ’2Ο€β‹…x is the damping term, while the βˆ’2Ο€β‹…x inside the sine function causes the phase shift.

To make things even nice, suppose we fixed our attention at position x=Ο€/2β‰ˆ1.25 meters, i.e., about 4 feet below the ground. In this case, the above expression simplifies even further to

u(Ο€/2,t)=eβˆ’Ο€sin⁑(2Ο€tβˆ’Ο€).

Comparing the graph of this function with the graph of the surface temperature, we see the following:

cellarGraph.png|600

In other words, the temperature four feet down:

  1. Doesn't vary much.
  2. Is cool when the surface is warm and warm when the surface is cool.

This sounds a lot like how a cellar works, and it's the reason cellars are so useful!

A last observation

Before leaving this example, let's end by noting that the same trick used in the previous example can let us rewrite the general solution u(x,t) in the form

u(x,t)=∫01f(s)g(x,tβˆ’s)ds,

where f(t) is our surface temperature (the initial impulse in our system) and where

g(x,y)=βˆ‘n=βˆ’βˆžβˆ’1eβˆ’2Ο€|n|(1βˆ’i)xe2Ο€iny+βˆ‘n=0∞eβˆ’2Ο€n(1+i)xe2Ο€iny

is the impulse response (aka Green's function, fundamental solution, convolving function, ...).

There's definitely something going on here, and we'll see exactly what that is when we get familiar with the Fourier transform.

Suggested next notes


Fourier transform I - Pushing Fourier series to the limit


  1. Really a family of differential equations, one for each integer n. β†©οΈŽ