0% found this document useful (0 votes)
9 views11 pages

12 Fourier Method For The Heat Equation: 12.1 A Zoo of Examples

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

12 Fourier method for the heat equation

Now I am well prepared to work through some simple problems for a one dimensional heat equation
on a bounded interval.

12.1 A zoo of examples


Example 12.1. Assume that I need to solve the heat equation

ut = α2 uxx , 0 < x < 1, t > 0, (12.1)

with the homogeneous Dirichlet boundary conditions

u(t, 0) = u(t, 1) = 0, t > 0, (12.2)

and with the initial condition


u(0, x) = g(x), 0 ≤ x ≤ 1. (12.3)
Let me start again with the ansatz

u(t, x) = T (t)X(x).

The equation (12.1) implies


T ′ X = α2 T X ′′ ,
where the primes denote the derivatives with respect to the corresponding variables. Separating the
variables implies that
T′ X ′′
= = −λ,
α2 T X
where the minus sign I chose for notational reasons. Therefore, I now have two ODE, moreover the
second ODE
X ′′ + λX = 0
is supplemented with the boundary conditions X(0) = X(1) = 0, which follows from (12.2).
Recall that I already analyzed a similar situation with periodic boundary conditions, and I con-
sidered all possible complex values of the separation constant. The goal is to determine all possible
constants λ such that the corresponding boundary value problem has a nontrivial solution (i.e., differ-
ent from being identically zero). Here I will consider only real values of λ, a rigorous (and elementary!)
general proof that they must be real will be given later.
I start with the case λ = 0. This means X ′′ = 0 =⇒ X(x) = Ax + B, where A and B are two
real constants. The boundary conditions imply that A = B = 0 and hence for λ = 0 my boundary
value problem has no nontrivial solution.
Now assume that λ < 0. The general solution to my ODE in this case is
√ √
−λx
X(x) = Ae + Be− −λx
,
Math 483/683: Partial Differential Equations by Artem Novozhilov
e-mail: [email protected]. Spring 2023

1
and the boundary conditions yield
√ √
−λ
A + B = 0, Ae + Be− −λ
= 0,

or √
−λ
B(e2 − 1) = 0,

which implies that A = B = 0 since e2 −λ ̸= 1 for any real negative λ. Therefore again no nontrivial
solutions.

√ 1. Reconsider the case λ < 0 starting with the general solution X(x) = A sinh −λx +
Exercise
B cosh −λx.
Finally, assuming that λ > 0, I get
√ √
X(x) = A cos λx + B sin λx,

and the boundary conditions imply that



A = 0, B sin λ = 0,

which can be true if B = 0 (trivial solution), or if


√ √
sin λ = 0 =⇒ λ = πk, k ∈ Z.

Therefore, for any


λk = (πk)2 , k = 1, 2, 3, . . .
note that I disregarded 0 and all negative values of k since they do not yield new solutions, I get
nontrivial solutions
Xk (x) = Bk sin πkx.
Now I can return to the ODE T ′ = −α2 λT with the solutions for admissible values of lambda in
the form
Tk (t) = Ck e−α π k t .
2 2 2

The analysis above implies (I take bk = Bk Ck ) that

uk (t, x) = bk e−α
2 π 2 k2 t
sin πkx, k = 1, 2, . . .

solve equation (12.1) and satisfy the boundary conditions (12.2). The remaining part is to satisfy the
initial condition (12.3). For this I will use the superposition principle that says that if uk solve (12.1)
then any linear combination is also a solution, i.e.,

∑ ∞

bk e−α
2 π 2 k2 t
u(t, x) = uk (t, x) = sin πkx
k=1 k=1

is my solution. I use (12.3) to find that



∑ ∞

g(x) = uk (0, x) = bk sin πkx,
k=1 k=1

2
Figure 1: Solution to the heat equation with the homogeneous Dirichlet boundary conditions and the
initial condition (bold curve) g(x) = x − x2 Left: Three dimensional plot, right: contour plot.

which is exactly the sine series for my function g, the coefficients of which can be found as
ˆ 1
bk = 2 g(x) sin πkx dx, k = 1, 2, . . . .
0

As a specific example I can take


g(x) = x − x2 .
Then
4(1 − (−1)k )
bk = .
π3 k3
The solutions are graphically represented in Fig. 1. We can see that, as expected, the temperature
in the rod approaches zero as time goes to infinity.
What else can be inferred from the representation of our solution as its Fourier series?
First I note that the exponents are responsible for the speed of approaching the equilibrium state,
moreover, for sufficiently large t, all the expressions of the form e−Ak t are very small compared to
2

the first exponent with index k if bk ̸= 0. Therefore, in many practical situations it is possible to
concentrate only on the first nonzero term of the Fourier series

u(t, x) ≈ uk (t, x) = bk e−α


2 k2 π 2 t
sin πkx, first bk ̸= 0.

The approximation
∑10 becomes better and better as t grows. In Fig. 2 one can see the difference
u1 (t, x) − k=1 uk (t, x) for my example with g(x) = x − x2 .
Second, and more important, I note that the same negative exponents in the representation of
the solution by the sine Fourier series will guarantee that any derivative of the Fourier series will
converge (it does require some proof). This is an important characterization of the solutions to the
heat equation: Its solution, irrespective of the initial condition, is an infinitely differentiable function
for any t > 0.

3
∑10
Figure 2: The difference u1 (t, x) − k=1 uk (t, x) in the example with g(x) = x − x2 .

Here is the same problem with




0, 0 < x < 1/4,
g(x) = 1, 1/4 < x < 3/4,


0, 3/4 < x < 1.

You can see the smoothing effect of the heat equation on the discontinuous initial condition (see
Fig. 3).

Figure 3: Solution to the heat equation with a discontinuous initial condition. For any t > 0 the
solution is an infinitely differential function.

I can also note that if we would like to revert the time and look into the past and not to the
future, then all the exponent would have the sign plus, which means that in general Fourier series will
diverge for any t < 0. This is actually a manifestation of the fact that the inverse problem for the

4
heat equation is not well posed, the heat equation represents a meaningful mathematical model only
for t > 0 and the solutions are not reversible. (As a side remark I note that ill-posed problems are
very important and there are special methods to attack them, including solving the heat equation for
t < 0, note that this is equivalent to solve for t > 0 the equation of the form ut = −α2 uxx .)
Example 12.2. Consider now the Neumann boundary value problem for the heat equation (recall
that homogeneous boundary conditions mean insulated ends, no energy flux):

ut =α2 uxx , t > 0,


ux (t, 0) = ux (t, 1) = 0, t > 0,
u(0, x) = g(x), 0 ≤ x ≤ 1.

Now, after introducing u(t, x) = T (t)X(x) I end up with the boundary value problem for X in the
form
X ′′ + λX = 0, X ′ (0) = X ′ (1) = 0.
I will leave it as an exercise to show that if λ < 0 then I do not have non-trivial solutions. If, however,
λ = 0, I have that
X(x) = A + Bx,
and the boundary conditions imply that B = 0 leaving me free variable A. Hence I conclude that for
λ = 0 my solution is X(x) = A. If λ > 0 then
√ √
X(x) = A cos λx + B sin λx,

and the boundary conditions imply that B = 0 and



A sin λ = 0,

which will be true if λ = π 2 k 2 , k = 1, 2, 3, . . .. Putting everything together I found that my ODE


boundary value problem has nontrivial solutions only if (note that I include k = 0)

λk = π 2 k 2 , k = 0, 1, 2, . . .

and these solutions are


Xk (x) = Ak cos πkx, k = 0, 1, . . . .
From the other ODE I find

Tk (t) = Ck e−α
2 k2 π 2 t
, k = 0, 1, . . .

and therefore, due to the same superposition principle, I can represent my solution as

∑ ∞
a0 ∑
ak e−α k π t cos πkx.
2 2 2
u(t, x) = Tk (t)Xk (x) = +
2
k=0 k=1

Using the initial condition, I find that



a0 ∑
g(x) = + ak cos πkx,
2
k=1

5
which is the cosine Fourier series for g, where
ˆ 1
ak = 2 g(x) cos πkx dx.
0

Note that as expected, my solution tends to


ˆ 1
a0
u(t, x) → = g(x) dx, t → ∞,
2 0

which is a mathematical description of the fact that the energy inside my rod must be conserved. The
solution that I found is also, as in the Dirichlet case, infinitely differentiable at any t > 0, and the
problem is ill-posed for t < 0.
Example 12.3. Recall the problem for the heat equation with periodic boundary conditions:

ut = α2 uxx , t > 0, −π < x ≤ π,


u(t, −π) = u(t, π), t > 0,
ux (t, −π) = u(t, π), t > 0,
u(0, x) = g(x), −π < x ≤ π.

We found that the boundary value problem

X ′′ + λX = 0, X(−π) = X(π), X ′ (−π) = X ′ (π)

has a non-trivial solution only if


λk = k 2 , k = 0, 1, 2, . . . ,
and these solutions are
Xk (x) = Ak cos kx + Bk sin kx.
Moreover, the full solution is given by the Fourier series

a0 ∑ −α2 k2 t
u(t, x) = + e (ak cos kx + bk sin kx),
2
k=1

where ak , bk are the coefficients of the trigonometric Fourier series for g on −π ≤ x ≤ π (the exact
expressions are given in the previous section). Again, since the rod is insulated, I find that as t → ∞
ˆ π
1
u(t, x) → g(x) dx.
2π −π
Example 12.4. Now let me consider a problem for the heat equation with Robin or Type III boundary
condition on one end. I need to solve

ut = α2 uxx , t > 0, 0 < x < 1,


u(t, 0) = 0, t > 0,
ux (t, 1) + hu(t, 1) = 0, t > 0,
u(0, x) = g(x), 0 ≤ x ≤ 1.

6
Here I will assume that my constant h is positive.
Again, using the usual method of the separation of variables, I end up with

T ′ = α2 λT,

and
X ′′ + λX = 0, X(0) = 0, X(1) + hX(1) = 0.
First I consider the latter problem. I will look into only real values of constant λ.
λ = 0 implies that X(x) = 0 and hence of no interest to me. If λ < 0 then I get the system

0 = A + B,
√ √ √ √ √ √
0 = A(he− −λ
− −λe− −λ ) + B( −λe −λ + he −λ ).

This is a system of linear homogeneous equations with respect to A and B, and it has a nontrivial
solution if and only if the corresponding determinant of the system vanishes, which is equivalent, after
some simplification, to √
√ h − −λ
2 −λ
e = √ .
h + −λ

Note that the left hand side as the function of −λ has positive derivative, and the left hand side has
negative derivative, moreover they cross at the point λ = 0. Therefore, for −λ > 0 it is impossible to
have solutions to this equations, which rules out the case λ < 0.
Finally, if λ > 0, then I get
√ √
X(x) = A cos λx + B sin λx,

and hence my boundary conditions imply that A = 0 and


√ √ √
B( λ cos λ + h sin λx) = 0.

The last equality can be true if B = 0 (not interesting) or if



√ λ
tan λ = − .
h

From the geometric considerations (see Fig. 4) it is clear that there is an infinite sequence of
(λk )∞
k=1 , 0 < λ1 < λ2 < . . ., such that λk → ∞ as k → ∞, and it is quite easy to find these lambdas
numerically, but I do not have a convenient formula for them. My solutions are

Xk (x) = Bk sin λk x,

and hence any function √


uk (t, x) = bk e−α

kt
sin λk x
solves the PDE and satisfies the boundary conditions. Now I need to satisfy the initial condition. For
this I will take the infinite linear combination of uk and plug t = 0. I get


g(x) = bk sin µk x,
k=1

7
Figure 4: Solutions to the equation tan µ = −µ/h.


where µk = λk . This looks like a Fourier sine series, but this is not, because in the classical Fourier
sine series I need µk = πk, which is not true for my example, and hence I cannot use the formulas for
the coefficients. Luckily, however, it turns out the the system of functions {sin µk x} is orthogonal on
[0, 1], and following the same steps that were done when I derived the coefficients for the trigonometric
Fourier series, I can find that
ˆ 1
2µk
bk = g(x) sin µk x dx.
µk − sin µk cos µk 0
Now my problem is fully solved because for any piecewise continuous g my time dependent Fourier
series is an infinitely differentiable function.

Exercise 2. Confirm that the system {sin µk x} is orthogonal on [0, 1] and also confirm the formula
for bk .

As a specific example let me take


g(x) = x.
Then the solution has the form as in Fig. 5.
Not surprisingly, the solution approaches the trivial steady state, since the problem can be inter-
preted as the spread of the heat in an insulated rod with the fixed zero temperature at the left end and
the temperature of the surrounding medium around the right end of the rod set to zero. Eventually
the temperature evens out.
To emphasize that what I found is not a usual Fourier sine series, I will plot my infinite series
for t = 0 in the symmetric interval (−5, 5) along with a periodic extension of function x on (−1, 1)
(Fig. 6).

In all the examples above the boundary conditions were homogeneous. I emphasize that it must
be always true to be able to proceed with the method of the separation of variables (more technically,
I always need an ODE plus some boundary conditions, but if the original problem has inhomogeneous
boundary conditions then I have no way to deduce from them the boundary conditions for my ODE
problem). What to do if I am given non-homogeneous boundary conditions? Sometimes we can reduce
the problem with inhomogeneous boundary conditions to the problem with homogeneous ones.

8
]

Figure 5: Solutions to the heat equation with Robin boundary condition and the initial condition
g(x) = x.

Figure 6: The periodic extension (black) of g(x) = x on (−1, 1) along with its generalized Fourier
series (blue) based on the system {sin µk x} on the interval (−5, 5).

Consider as an example the Dirichlet problem for the heat equation with

u(t, 0) = k1 , u(t, l) = k2 .

Here k1 , k2 are two given constants. It should be clear (if not, carefully do all the math) that the
equilibrium (stationary) temperature in this case is given by
x
ueq (x) = k1 + (k2 − k1 ).
l
Now consider
u(t, x) = ueq (x) + v(t, x).

9
For the function v I will get (check!) the problem
vt = α2 vxx ,
v(t, 0) = v(t, l) = 0,
v(0, x) = g(x) − ueq (x),
where g is the initial condition from the original problem for u. Now I have homogeneous boundary
conditions and can use the Fourier method. Such approach will usually work when the boundary
conditions do not depend on t, otherwise I will end up with a nonhomogeneous heat equation, which
still can be solved using the separation of variables technique, but the solution process is slightly more
involved.

12.2 Conclusion
In this lecture I considered four examples that have a lot of common features. In particular, all of
them involve solving
X ′′ + λX = 0,
or, better,
−X ′′ = λX,
with some boundary conditions. By solving I mean “identifying those values of the parameter λ such
that my boundary value problem for ODE has a nontrivial (nonzero) solution.” In all four cases I
find an infinite sequence of such lambdas, all of which are real. Even more importantly, in all four
cases the corresponding solutions form an orthogonal system of functions, and hence the Fourier series
technique can be applied to represent the solution to my original PDE problem in the form of a
generalized Fourier series.
Is it a coincidence? Will it be the same for some other boundary conditions? I will answer these
questions in the next section.

12.3 Test yourself


1. Consider three BVP for
X ′′ + λX = 0
with
(a) X(0) = X(l) = 0, (b) X ′ (0) = X ′ (l) = 0, (c) X(−l) = X(l), X ′ (−l) = X ′ (l).
All three problems are solved in the text (up to a scaling of the length of the interval). Reproduce
these solutions and clearly state for which λ there are nontrivial solutions, and write down these
solutions.
2. Solve
ut = α2 uxx , x ∈ (0, 1), t>0
with u(t, 0) = u(t, 1) = 0 and u(0, x) = sin 2πx − sin 5πx. 1
2

3. Solve
ut = α2 uxx , x ∈ (0, 1), t>0
with u′ (t, 0) = u′ (t, 1) = 0 and u(0, x) = cos 2πx − π cos 3πx.

10
12.4 Solutions to the exercises
Exercise 1. The goal of this exercise is to show that in some situations a specific choice of the general
solution leads to much simpler calculations. I need to solve X ′′ + λX = 0 with X(0) = X(1) = 0 and
λ < 0. My general solution is given by X(x) = AX1 (x) + BX2 (x), where √
X1 and X2 are any√ linearly
independent solutions to my ODE. Very often one takes X1 (x) = e −λx and X2 (x) = e√ − −λx but

√ not the only possible choice. Another possibility is to take X1 (x) = sinh −λx and
this is certainly
X2 (x) = cosh −λx. Hence
√ √
X(x) = A sinh −λx + B cosh −λx.

Using the boundary conditions and the basic properties of the hyperbolic sine and cosine I immediately
get that the first boundary condition implies that B = 0. The second one yields hence that

A sinh −λ = 0,

which can be true if either A = 0 or λ = 0, and therefore there exists no nontrivial solutions to my
boundary value problem with λ < 0, much simpler than the calculations (mainly skipped!) in the
main text.
I repeat that in many situations using this particular choice for the general solution of X ′′ +λX = 0
leads to significant simplifications in calculations. 

Exercise 2. The goal is to show that is µk are the positive solutions to tan µk = −µk /h then the
system of functions {sin µk x} is orthogonal on [0, 1]. Assume that µk ̸= µm are two such roots, and
consider
ˆ 1 ˆ
1 1( )
sin µk x sin µm x dx = cos(µk − µm )x − cos(µk + µm ) dx
0 2 0
1 (µk + µm ) sin(µk − µm ) − (µk − µm ) sin(µk − µm )
=
2 µ2k − µ2m
µm sin µk cos µm − µk sin µm cos µk
= .
µ2k − µ2m

Now, using the fact that tan µk = sin µk / cos µk = −µk /h implies that sin µk = −µk cos µk /h, I get,
as expected
µm sin µk cos µm − µk sin µm cos µk −µk µm cos µk cos µm + µk µm cos µm cos µk
= = 0.
µk − µm
2 2 h(µ2k − µ2m )

To confirm the formula for bk I need to calculate


ˆ 1 ˆ
1 1 1 1 µk − sin µk cos µk
sin2 µk x dx = (1 − cos 2µk x) dx = − sin 2µk = ,
0 2 0 2 4µ k 2

compare this with the expression for bk . 

11

You might also like