Login
📚 Differential Equations for Engineers
Chapters ▾
⇩ Download ▾

4.6 PDEs, Separation of Variables, and The Heat Equation

Let us recall that a partial differential equation or PDE is an equation containing the partial derivatives with respect to several independent variables. Solving PDEs will be our main application of Fourier series.

A PDE is said to be linear if the dependent variable and its derivatives appear at most to the first power and in no functions. We will only talk about linear PDEs. Together with a PDE, we usually have specified some boundary conditions, where the value of the solution or its derivatives is specified along the boundary of a region, and/or some initial conditions where the value of the solution or its derivatives is specified for some initial time. Sometimes such conditions are mixed together and we will refer to them simply as side conditions.

We will study three specific partial differential equations, each one representing a more general class of equations. First, we will study the heat equation, which is an example of a parabolic PDE. Next, we will study the wave equation, which is an example of a hyperbolic PDE. Finally, we will study the Laplace equation, which is an example of an elliptic PDE. Each of our examples will illustrate behavior that is typical for the whole class.

Heat on an Insulated Wire

Let us first study the heat equation. Suppose that we have a wire (or a thin metal rod) of length L that is insulated except at the endpoints. Let x denote the position along the wire and let t denote time. See Figure 1.

Diagram of an insulated wire: a thin cylinder along the x-axis from 0 to L, capped at both ends, with a vertical axis at the left labelled temperature u.
Figure 1: Insulated wire.

Let u(x,t) denote the temperature at point x at time t. The equation governing this setup is the so-called one-dimensional heat equation:

u t = k 2 u x 2 ,

where k>0 is a constant (the thermal conductivity of the material). That is, the change in heat at a specific point is proportional to the second derivative of the heat along the wire. This makes sense; if at a fixed t the graph of the heat distribution has a maximum (the graph is concave down), then heat flows away from the maximum. And vice-versa.

We will generally use a more convenient notation for partial derivatives. We will write ut instead of ut, and we will write uxx instead of 2ux2. With this notation the heat equation becomes

u t = k u x x .

For the heat equation, we must also have some boundary conditions. We assume that the ends of the wire are either exposed and touching some body of constant heat, or the ends are insulated. For example, if the ends of the wire are kept at temperature 0, then we must have the conditions

u ( 0 , t ) = 0 and u ( L , t ) = 0 .

If, on the other hand, the ends are also insulated we get the conditions

u x ( 0 , t ) = 0 and u x ( L , t ) = 0 .

Let us see why that is so. If ux is positive at some point x0, then at a particular time, u is smaller to the left of x0, and higher to the right of x0. Heat is flowing from high heat to low heat, that is to the left. On the other hand if ux is negative then heat is again flowing from high heat to low heat, that is to the right. So when ux is zero, that is a point through which heat is not flowing. In other words, ux(0,t)=0 means no heat is flowing in or out of the wire at the point x=0.

We have two conditions along the x-axis as there are two derivatives in the x direction. These side conditions are said to be homogeneous (i.e., u or a derivative of u is set to zero).

We also need an initial condition—the temperature distribution at time t=0. That is,

u ( x , 0 ) = f ( x ) ,

for some known function f(x). This initial condition is not a homogeneous side condition.

Separation of Variables

The heat equation is linear as u and its derivatives do not appear to any powers or in any functions. Thus the principle of superposition still applies for the heat equation (without side conditions). If u1 and u2 are solutions and c1,c2 are constants, then u=c1u1+c2u2 is also a solution.

Superposition also preserves some of the side conditions. In particular, if u1 and u2 are solutions that satisfy u(0,t)=0 and u(L,t)=0, and c1,c2 are constants, then u=c1u1+c2u2 is still a solution that satisfies u(0,t)=0 andu(L,t)=0. Similarly for the side conditions ux(0,t)=0 and ux(L,t)=0. In general, superposition preserves all homogeneous side conditions.

The method of separation of variables is to try to find solutions that are sums or products of functions of one variable. For example, for the heat equation, we try to find solutions of the form

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

That the desired solution we are looking for is of this form is too much to hope for. What is perfectly reasonable to ask, however, is to find enough “building-block” solutions of the form u(x,t)=X(x)T(t) using this procedure so that the desired solution to the PDE is somehow constructed from these building blocks by the use of superposition.

Let us try to solve the heat equation

u t = k u x x with u ( 0 , t ) = 0 , u ( L , t ) = 0 , and u ( x , 0 ) = f ( x ) .

Let us guess u(x,t)=X(x)T(t). We will try to make this guess satisfy the differential equation, ut=kuxx, and the homogeneous side conditions, u(0,t)=0 and u(L,t)=0. Then, as superposition preserves the differential equation and the homogeneous side conditions, we will try to build up a solution from these building blocks to solve the nonhomogeneous initial condition u(x,0)=f(x).

First we plug u(x,t)=X(x)T(t) into the heat equation to obtain

X ( x ) T ( t ) = k X ( x ) T ( t ) .

We rewrite as

T(t)kT(t)=X(x)X(x).

This equation must hold for all x and all t. But the left hand side does not depend on x and the right hand side does not depend on t. Hence, each side must be a constant. Let us call this constant λ (the minus sign is for convenience later). We obtain the two equations

T ( t ) k T ( t ) = λ = X ( x ) X ( x ) .

In other words

X ( x ) + λ X ( x ) = 0 , T ( t ) + λ k T ( t ) = 0 .

The boundary condition u(0,t)=0 implies X(0)T(t)=0. We are looking for a nontrivial solution and so we can assume that T(t) is not identically zero. Hence X(0)=0. Similarly, u(L,t)=0 implies X(L)=0. We are looking for nontrivial solutions X of the eigenvalue problem X+λX=0,X(0)=0,X(L)=0. We have previously found that the only eigenvalues are λn=n2π2L2, for integers n1, where eigenfunctions are sin(nπLx). Hence, let us pick the solutions

X n ( x ) = sin ( n π L x ) .

The corresponding Tn must satisfy the equation

T n ( t ) + n 2 π 2 L 2 k T n ( t ) = 0 .

By the method of integrating factor, the solution of this problem is

T n ( t ) = e n 2 π 2 L 2 k t .

It will be useful to note that Tn(0)=1. Our building-block solutions are

u n ( x , t ) = X n ( x ) T n ( t ) = sin ( n π L x ) e n 2 π 2 L 2 k t .

We note that un(x,0)=sin(nπLx). Let us write f(x) as the sine series

f ( x ) = n = 1 b n sin ( n π L x ) .

That is, we find the Fourier series of the odd periodic extension of f(x). We used the sine series as it corresponds to the eigenvalue problem for X(x) above. Finally, we use superposition to write the solution as

u ( x , t ) = n = 1 b n u n ( x , t ) = n = 1 b n sin ( n π L x ) e n 2 π 2 L 2 k t .

Why does this solution work? First note that it is a solution to the heat equation by superposition. It satisfies u(0,t)=0 and u(L,t)=0, because x=0 or x=L makes all the sines vanish. Finally, plugging in t=0, we notice that Tn(0)=1 and so

u ( x , 0 ) = n = 1 b n u n ( x , 0 ) = n = 1 b n sin ( n π L x ) = f ( x ) .

We mention an interesting behavior of the solution to the heat equation. The heat equation “smoothes” out the function f(x) as t grows. For a fixed t, the solution is a Fourier series with coefficients bnen2π2L2kt. If t>0, then these coefficients go to zero faster than any 1nP for any power p. In other words, the Fourier series has infinitely many derivatives everywhere. Thus even if the function f(x) has jumps and corners, then for a fixed t>0, the solution u(x,t) as a function of x is as smooth as we want it to be.

Insulated Ends

Now suppose the ends of the wire are insulated. In this case, we are solving the equation

u t = k u x x with u x ( 0 , t ) = 0 , u x ( L , t ) = 0 , and u ( x , 0 ) = f ( x ) .

Yet again we try a solution of the form u(x,t)=X(x)T(t). By the same procedure as before we plug into the heat equation and arrive at the following two equations

X ( x ) + λ X ( x ) = 0 , T ( t ) + λ k T ( t ) = 0 .

At this point the story changes slightly. The boundary condition ux(0,t)=0 implies X(0)T(t)=0. Hence X(0)=0. Similarly, ux(L,t)=0 implies X(L)=0. We are looking for nontrivial solutions X of the eigenvalue problem X+λX=0, X(0)=0, X(L)=0,. We have previously found that the only eigenvalues are λn=n2π2L2, for integers n0, where eigenfunctions are cos(nπL)X (we include the constant eigenfunction). Hence, let us pick solutions

X n ( x ) = cos ( n π L x ) and X 0 ( x ) = 1 .

The corresponding Tn must satisfy the equation

T n ( t ) + n 2 π 2 L 2 k T n ( t ) = 0 .

For n1, as before,

T n ( t ) = e n 2 π 2 L 2 k t .

For n=0, we have T0(t)=0 and hence T0(t)=1. Our building-block solutions will be

u n ( x , t ) = X n ( x ) T n ( t ) = cos ( n π L x ) e n 2 π 2 L 2 k t ,

and

u 0 ( x , t ) = 1 .

We note that un(x,0)=cos(nπLx). Let us write f using the cosine series

f ( x ) = a 0 2 + n = 1 a n cos ( n π L x ) .

That is, we find the Fourier series of the even periodic extension of f(x).

We use superposition to write the solution as

u ( x , t ) = a 0 2 + n = 1 a n u n ( x , t ) = a 0 2 + n = 1 a n cos ( n π L x ) e n 2 π 2 L 2 k t .

Let us expand on the last point. The constant term in the series is

a02=1L0Lf(x)dx.

In other words, a02 is the average value of f(x), that is, the average of the initial temperature. As the wire is insulated everywhere, no heat can get out, no heat can get in. So the temperature tries to distribute evenly over time, and the average temperature must always be the same, in particular it is always a02. As time goes to infinity, the temperature goes to the constant a02 everywhere.

Adapted from Differential Equations for Engineers by Jiří Lebl (Oklahoma State University), hosted on LibreTexts (math.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.