Differential Equations for EngineersXYZ Homework Edition

⇩ 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 LL that is insulated except at the endpoints. Let xx denote the position along the wire and let tt 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)u(x,t) denote the temperature at point xx at time tt. The equation governing this setup is the so-called one-dimensional heat equation:

∂ u ∂ t = k ∂ 2 u ∂ x 2 , \frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2}, \nonumber

where k>0k>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 tt 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 utu_t instead of ∂u∂t\frac{\partial u}{\partial t}, and we will write uxxu_{xx} instead of ∂2u∂x2\frac{\partial^2 u}{\partial x^2}. With this notation the heat equation becomes

u t = k u x x . u_t=ku_{xx}. \nonumber

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 . u(0,t)=0 \quad\text{and}\quad u(L,t)=0. \nonumber

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 . u_x(0,t)=0 \quad\text{and}\quad u_x(L,t)=0. \nonumber

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

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

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

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

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

Separation of Variables

The heat equation is linear as uu 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 u1u_1 and u2u_2 are solutions and c1,c2c_1,c_2 are constants, then u=c1u1+c2u2u= c_1u_1+c_2u_2 is also a solution.

Superposition also preserves some of the side conditions. In particular, if u1u_1 and u2u_2 are solutions that satisfy u(0,t)=0u(0,t)=0 and u(L,t)=0u_(L,t)=0, and c1,c2c_1,\: c_2 are constants, then u=c1u1+c2u2u= c_1u_1+c_2u_2 is still a solution that satisfies u(0,t)=0u(0,t)=0 andu(L,t)=0u_(L,t)=0. Similarly for the side conditions ux(0,t)=0u_x(0,t)=0 and ux(L,t)=0u_x(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 ) . u(x,t)=X(x)T(t). \nonumber

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)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 ) . u_t=ku_{xx} \quad\text{with}\quad u(0,t)=0,\quad u(L,t)=0, \quad\text{and}\quad u(x,0)=f(x). \nonumber

Let us guess u(x,t)=X(x)T(t)u(x,t)=X(x)T(t). We will try to make this guess satisfy the differential equation, ut=kuxxu_{t}=ku_{xx}, and the homogeneous side conditions, u(0,t)=0u(0,t)=0 and u(L,t)=0u(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)u(x,0)=f(x).

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

X ( x ) T ′ ( t ) = k X ″ ( x ) T ( t ) . X(x)T'(t)=kX''(x)T(t). \nonumber

We rewrite as

T′(t)kT(t)=X″(x)X(x).\frac{T'(t)}{kT(t)}= \frac{X''(x)}{X(x)}. \nonumber

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

T ′ ( t ) k T ( t ) = − λ = X ″ ( x ) X ( x ) . \frac{T'(t)}{kT(t)}= - \lambda = \frac{X''(x)}{X(x)}. \nonumber

In other words

X ″ ( x ) + λ X ( x ) = 0 , T ′ ( t ) + λ k T ( t ) = 0 . \begin{align}\begin{aligned} X''(x) + \lambda X(x) &=0, \\ T'(t) + \lambda k T(t)& =0.\end{aligned}\end{align} \nonumber

The boundary condition u(0,t)=0u(0,t)=0 implies X(0)T(t)=0X(0)T(t)=0. We are looking for a nontrivial solution and so we can assume that T(t)T(t) is not identically zero. Hence X(0)=0X(0)=0. Similarly, u(L,t)=0u(L,t)=0 implies X(L)=0X(L)=0. We are looking for nontrivial solutions XX of the eigenvalue problem X″+λX=0,X(0)=0,X(L)=0X'' + \lambda X = 0, X(0)=0, X(L)=0. We have previously found that the only eigenvalues are λn=n2π2L2\lambda_n = \frac{n^2 \pi^2}{L^2}, for integers n≥1n \geq 1, where eigenfunctions are sin(nπLx)\sin \left( \frac{n \pi}{L}x \right). Hence, let us pick the solutions

X n ( x ) = sin ( n π L x ) . X_n(x)= \sin \left( \frac{n \pi}{L}x \right). \nonumber

The corresponding TnT_n must satisfy the equation

T n ′ ( t ) + n 2 π 2 L 2 k T n ( t ) = 0 . T'_n(t) + \frac{n^2 \pi^2}{L^2}kT_n(t)=0. \nonumber

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

T n ( t ) = e − n 2 π 2 L 2 k t . T_n(t)=e^{\frac{-n^2 \pi^2}{L^2}kt}. \nonumber

It will be useful to note that Tn(0)=1T_n(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 . u_n(x,t)=X_n(x)T_n(t)= \sin \left( \frac{n \pi}{L}x \right) e^{\frac{-n^2 \pi^2}{L^2}kt}. \nonumber

We note that un(x,0)=sin(nπLx)u_n(x,0)= \sin \left( \frac{n \pi}{L}x \right). Let us write f(x)f(x) as the sine series

f ( x ) = ∑ n = 1 ∞ b n sin ( n π L x ) . f(x)= \sum_{n=1}^{\infty} b_n \sin \left( \frac{n \pi}{L}x \right). \nonumber

That is, we find the Fourier series of the odd periodic extension of f(x)f(x). We used the sine series as it corresponds to the eigenvalue problem for X(x)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 . u(x,t)= \sum^{\infty}_{n=1}b_n u_n (x,t)= \sum^{\infty}_{n=1}b_n \sin \left(\frac{n \pi}{L}x \right)e^{\frac{-n^2 \pi^2}{L^2}kt}. \nonumber

Why does this solution work? First note that it is a solution to the heat equation by superposition. It satisfies u(0,t)=0u(0,t)=0 and u(L,t)=0u(L,t)=0, because x=0x=0 or x=Lx=L makes all the sines vanish. Finally, plugging in t=0t=0, we notice that Tn(0)=1T_n(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 ) . u(x,0)= \sum^{\infty}_{n=1}b_n u_n (x,0)= \sum^{\infty}_{n=1}b_n \sin \left(\frac{n \pi}{L}x \right)=f(x). \nonumber

We mention an interesting behavior of the solution to the heat equation. The heat equation “smoothes” out the function f(x)f(x) as tt grows. For a fixed tt, the solution is a Fourier series with coefficients bne−n2π2L2ktb_n e^{\frac{-n^2 \pi^2}{L^2}kt}. If t>0t>0, then these coefficients go to zero faster than any 1nP\frac{1}{n^P} for any power pp. In other words, the Fourier series has infinitely many derivatives everywhere. Thus even if the function f(x)f(x) has jumps and corners, then for a fixed t>0t>0, the solution u(x,t)u(x,t) as a function of xx 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 ) . u_t=ku_{xx}\quad\text{with}\quad u_x(0,t)=0,\quad u_x(L,t)=0,\quad\text{and}\quad u(x,0)=f(x). \nonumber

Yet again we try a solution of the form u(x,t)=X(x)T(t)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 . \begin{align}\begin{aligned} X''(x)+\lambda X(x) &=0, \\ T'(t)+\lambda kT(t) &=0.\end{aligned}\end{align} \nonumber

At this point the story changes slightly. The boundary condition ux(0,t)=0u_x(0,t)=0 implies X′(0)T(t)=0X'(0)T(t)=0. Hence X′(0)=0X'(0)=0. Similarly, ux(L,t)=0u_x(L,t)=0 implies X′(L)=0X'(L)=0. We are looking for nontrivial solutions XX of the eigenvalue problem X″+λX=0,X''+ \lambda X=0, X′(0)=0,X'(0)=0, X′(L)=0,X'(L)=0,. We have previously found that the only eigenvalues are λn=n2π2L2\lambda_n=\frac{n^2 \pi^2}{L^2}, for integers n≥0n \geq 0, where eigenfunctions are cos(nπL)X\cos(\frac{n \pi}{L})X (we include the constant eigenfunction). Hence, let us pick solutions

X n ( x ) = cos ( n π L x ) and X 0 ( x ) = 1 . X_n(x)= \cos(\frac{n \pi}{L}x)\quad\text{and}\quad X_0(x)=1. \nonumber

The corresponding TnT_n must satisfy the equation

T n ′ ( t ) + n 2 π 2 L 2 k T n ( t ) = 0 . T'_n(t)+ \frac{n^2 \pi^2}{L^2}kT_n(t)=0. \nonumber

For n≥1n \geq 1, as before,

T n ( t ) = e − n 2 π 2 L 2 k t . T_n(t)= e^{\frac{-n^2 \pi^2}{L^2}kt}. \nonumber

For n=0n=0, we have T0′(t)=0T'_0(t)=0 and hence T0(t)=1T_0(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 , u_n(x,t)=X_n(x)T_n(t)= \cos \left( \frac{n \pi}{L} x \right) e^{\frac{-n^2 \pi^2}{L^2}kt}, \nonumber

and

u 0 ( x , t ) = 1 . u_0(x,t)=1. \nonumber

We note that un(x,0)=cos(nπLx)u_n(x,0) =\cos \left( \frac{n \pi}{L} x \right). Let us write ff using the cosine series

f ( x ) = a 0 2 + ∑ n = 1 ∞ a n cos ( n π L x ) . f(x)= \frac{a_0}{2} + \sum^{\infty}_{n=1} a_n \cos \left( \frac{n \pi}{L} x \right). \nonumber

That is, we find the Fourier series of the even periodic extension of f(x)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 . u(x,t)= \frac{a_0}{2} + \sum^{\infty}_{n=1} a_n u_n(x,t)= \frac{a_0}{2} + \sum^{\infty}_{n=1} a_n \cos \left( \frac{n \pi}{L} x \right) e^{\frac{-n^2 \pi^2}{L^2}kt}. \nonumber

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

a02=1L∫0Lf(x)dx.\frac{a_0}{2} = \frac{1}{L} \int_0^L f(x) \, dx. \nonumber

In other words, a02\frac{a_0}{2} is the average value of f(x)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\frac{a_0}{2}. As time goes to infinity, the temperature goes to the constant a02\frac{a_0}{2} everywhere.

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.