12.1 The Heat Equation

We begin the study of partial differential equations with the problem of heat flow in a uniform bar of length \(L\), situated on the \(x\) axis with one end at the origin and the other at \(x=L\) (Figure 12.1.1).

We assume that the bar is perfectly insulated except possibly at its endpoints, and that the temperature is constant on each cross section and therefore depends only on \(x\) and \(t\). We also assume that the thermal properties of the bar are independent of \(x\) and \(t\). In this case, it can be shown that the temperature \(u=u(x,t)\) at time \(t\) at a point \(x\) units from the origin satisfies the partial differential equation

\[ u_t=a^2u_{xx},\quad 0<x<L,\quad t>0, \]

where \(a\) is a positive constant determined by the thermal properties. This is the heat equation.

A uniform bar of length L
Figure 12.1.1. A uniform bar of length \(L\)

To determine \(u\), we must specify the temperature at every point in the bar when \(t=0\), say

\[ u(x,0)=f(x),\quad 0\le x\le L. \]

We call this the initial condition. We must also specify boundary conditions that \(u\) must satisfy at the ends of the bar for all \(t>0\). We’ll call this problem an initial-boundary value problem.

We begin with the boundary conditions \(u(0,t)=u(L,t)=0\), and write the initial-boundary value problem as

\begin{equation} \begin{array}{c} u_t=a^2u_{xx},\quad 0<x<L,\quad t>0,\\ u(0,t)=0,\quad u(L,t)=0,\quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L. \end{array} \tag{12.1.1}\end{equation}

Our method of solving this problem is called separation of variables (not to be confused with method of separation of variables used in Section 2.2 for solving ordinary differential equations). We begin by looking for functions of the form

\[ v(x,t)=X(x)T(t) \]

that are not identically zero and satisfy

\[ v_t=a^2v_{xx},\quad v(0,t)=0,\quad v(L,t)=0 \]

for all \((x,t)\). Since

\[ v_t=XT'\mbox{\quad and \quad}v_{xx}=X''T, \]

\(v_t=a^2v_{xx}\) if and only if

\[ XT'=a^2X''T, \]

which we rewrite as

\[ {T'\over a^2T}={X''\over X}. \]

Since the expression on the left is independent of \(x\) while the one on the right is independent of \(t\), this equation can hold for all \((x,t)\) only if the two sides equal the same constant, which we call a separation constant, and write it as \(-\lambda\); thus,

\[ {X''\over X}={T'\over a^2T}=-\lambda. \]

This is equivalent to

\[ X''+\lambda X=0 \]

and

\begin{equation} T'=-a^2\lambda T. \tag{12.1.2}\end{equation}

Since \(v(0,t)=X(0)T(t)=0\) and \(v(L,t)=X(L)T(t)=0\) and we don’t want \(T\) to be identically zero, \(X(0)=0\) and \(X(L)=0\). Therefore \(\lambda\) must be an eigenvalue of the boundary value problem

\begin{equation} X''+\lambda X=0,\quad X(0)=0,\quad X(L)=0, \tag{12.1.3}\end{equation}

and \(X\) must be a \(\lambda\)-eigenfunction. From Theorem 11.1.2, the eigenvalues of (12.1.3) are \(\lambda_n=n^2\pi^2/L^2\), with associated eigenfunctions

\[ X_n=\sin{n\pi x\over L}, \quad n=1,2,3,\dots. \]

Substituting \(\lambda=n^2\pi^2/L^2\) into (12.1.2) yields

\[ T'=-(n^2\pi^2a^2/L^2)T, \]

which has the solution

\[ T_n=e^{-n^2\pi^2a^2t/L^2}. \]

Now let

\[ v_n(x,t)=X_n(x)T_n(t)=e^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L},\quad n=1,2,3,\dots \]

Since

\[ v_n(x,0)=\sin{n\pi x\over L}, \]

\(v_n\) satisfies (12.1.1) with \(f(x)=\sin n\pi x/L\). More generally, if \(\alpha_1,\dots,\alpha_m\) are constants and

\[ u_m(x,t)= \sum_{n=1}^m \alpha_ne^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}, \]

then \(u_m\) satisfies (12.1.1) with

\[ f(x)=\sum_{n=1}^m \alpha_n\sin{n\pi x\over L}. \]

This motivates the next definition.

Definition 12.1.1

The formal solution of the initial-boundary value problem

\begin{equation} \begin{array}{c} u_t=a^2u_{xx},\quad 0<x<L,\quad t>0,\\ u(0,t)=0,\quad u(L,t)=0,\quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L \end{array} \tag{12.1.4}\end{equation}

is

\begin{equation} u(x,t)=\sum_{n=1}^\infty \alpha_ne^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}, \tag{12.1.5}\end{equation}

where

\[ S(x)=\sum_{n=1}^\infty \alpha_n\sin{n\pi x\over L} \]

is the Fourier sine series of \(f\) on \([0,L]\); that is,

\[ \alpha_n={2\over L}\int_0^Lf(x)\sin{n\pi x\over L}\,dx. \]

We use the term “formal solution” in this definition because it’s not in general true that the infinite series in (12.1.5) actually satisfies all the requirements of the initial-boundary value problem (12.1.4) when it does, we say that it’s an actual solution of (12.1.4).

Because of the negative exponentials in (12.1.5), \(u\) converges for all \((x,t)\) with \(t>0\) (Exercise 54). Since each term in (12.1.5) satisfies the heat equation and the boundary conditions in (12.1.4), \(u\) also has these properties if \(u_t\) and \(u_{xx}\) can be obtained by differentiating the series in (12.1.5) term by term once with respect to \(t\) and twice with respect to \(x\), for \(t>0\). However, it’s not always legitimate to differentiate an infinite series term by term. The next theorem gives a useful sufficient condition for legitimacy of term by term differentiation of an infinite series. We omit the proof.

Theorem 12.1.2

A convergent infinite series

\[ W(z)=\sum_{n=1}^\infty w_n(z) \]

can be differentiated term by term on a closed interval \([z_1,z_2]\) to obtain

\[ W'(z)=\sum_{n=1}^\infty w_n'(z) \]

\((\)where the derivatives at \(z=z_1\) and \(z=z_2\) are one-sided\()\) provided that \(w_n'\) is continuous on \([z_1,z_2]\) and

\[ |w_n'(z)|\le M_n,\quad z_1\le z\le z_2,\quad n=1,2,3,\dots, \]

where \(M_1,\) \(M_2,\) …, \(M_n,\) …, are constants such that the series \(\sum_{n=1}^\infty M_n\) converges.

Theorem 12.1.2, applied twice with \(z=x\) and once with \(z=t\), shows that \(u_{xx}\) and \(u_t\) can be obtained by differentiating \(u\) term by term if \(t>0\) (Exercise 54). Therefore \(u\) satisfies the heat equation and the boundary conditions in (12.1.4) for \(t>0\). Therefore, since \(u(x,0)=S(x)\) for \(0\le x\le L\), \(u\) is an actual solution of (12.1.4) if and only if \(S(x)=f(x)\) for \(0\le x\le L\). From Theorem 11.3.2, this is true if \(f\) is continuous and piecewise smooth on \([0,L]\), and \(f(0)=f(L)=0\).

In this chapter we’ll define formal solutions of several kinds of problems. When we ask you to solve such problems, we always mean that you should find a formal solution.

Example 12.1.1

Solve (12.1.4) with \(f(x)=x(x^2-3Lx+2L^2)\).

Solution From Example 11.3.6, the Fourier sine series of \(f\) on \([0,L]\) is

\[ S(x)=\dst{12L^3\over\pi^3}\sum_{n=1}^\infty{1\over n^3} \sin{n\pi x\over L}. \]

Therefore

\[ u(x,t)=\dst{12L^3\over\pi^3}\sum_{n=1}^\infty{1\over n^3} e^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}. \tag*{\bbox} \]

If both ends of bar are insulated so that no heat can pass through them, then the boundary conditions are

\[ u_x(0,t)=0,\quad u_x(L,t)=0,\quad t>0. \]

We leave it to you (Exercise 1) to use the method of separation of variables and Theorem 11.1.3 to motivate the next definition.

Definition 12.1.3

The formal solution of the initial-boundary value problem

\begin{equation} \begin{array}{c} u_t=a^2u_{xx},\quad 0<x<L,\quad t>0,\\ u_x(0,t)=0,\quad u_x(L,t)=0, \quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L \end{array} \tag{12.1.6}\end{equation}

is

\[ u(x,t)=\alpha_0+\sum_{n=1}^\infty \alpha_ne^{-n^2\pi^2 a^2t/L^2}\cos{n\pi x\over L}, \]

where

\[ C(x)=\alpha_0+\sum_{n=1}^\infty \alpha_n\cos{n\pi x\over L} \]

is the Fourier cosine series of \(f\) on \([0,L];\) that is\(,\)

\[ \alpha_0={1\over L}\int_0^Lf(x)\,dx \mbox{\quad and \quad} \alpha_n={2\over L}\int_0^Lf(x)\cos{n\pi x\over L}\,dx,\quad n=1,2,3,\dots. \]

Example 12.1.2

Solve (12.1.6) with \(f(x)=x\).

Solution From Example 11.3.1, the Fourier cosine series of \(f\) on \([0,L]\) is

\[ C(x)=\dst{L\over2}-{4L\over\pi^2}\sum_{n=1}^\infty{1\over(2n-1)^2} \cos{(2n-1)\pi x\over L}. \]

Therefore

\[ u(x,t)={L\over2}-{4L\over\pi^2}\sum_{n=1}^\infty {1\over(2n-1)^2} e^{-(2n-1)^2\pi^2a^2t/L^2}\cos{(2n-1)\pi x\over L}. \tag*{\bbox} \]

We leave it to you (Exercise 2) to use the method of separation of variables and Theorem 11.1.4 to motivate the next definition.

Definition 12.1.4

The formal solution of the initial-boundary value problem

\begin{equation} \begin{array}{c} u_t=a^2u_{xx},\quad 0<x<L,\quad t>0, \\ u(0,t)=0,\quad u_x(L,t)=0,\quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L \end{array} \tag{12.1.7}\end{equation}

is

\[ u(x,t)=\sum_{n=1}^\infty \alpha_ne^{-(2n-1)^2\pi^2a^2t/4L^2}\sin{(2n-1)\pi x\over2L}, \]

where

\[ S_M(x)=\sum_{n=1}^\infty \alpha_n\sin{(2n-1)\pi x\over2L} \]

is the mixed Fourier sine series of \(f\) on \([0,L];\) that is\(,\)

\[ \alpha_n={2\over L}\int_0^Lf(x)\sin{(2n-1)\pi x\over2L}\,dx. \]

Example 12.1.3

Solve (12.1.7) with \(f(x)=x\).

Solution From Example 11.3.4, the mixed Fourier sine series of \(f\) on \([0,L]\) is

\[ S_M(x)=-{8L\over\pi^2}\sum_{n=1}^\infty{(-1)^n\over(2n-1)^2} \sin{(2n-1)\pi x\over2L}. \]

Therefore

\[ u(x,t)=-{8L\over\pi^2}\sum_{n=1}^\infty{(-1)^n\over(2n-1)^2} e^{-(2n-1)^2\pi^2a^2t/4L^2}\sin{(2n-1)\pi x\over2L}. \tag*{\bbox} \]

Figure 12.1.2 shows a graph of \(u=u(x,t)\) plotted with respect to \(x\) for various values of \(t\). The line \(y=x\) corresponds to \(t=0\). The other curves correspond to positive values of \(t\). As \(t\) increases, the graphs approach the line \(u=0\).

Figure 12.1.2.

We leave it to you (Exercise 3) to use the method of separation of variables and Theorem 11.1.5 to motivate the next definition.

Definition 12.1.5

The formal solution of the initial-boundary value problem

\begin{equation} \begin{array}{c} u_t=a^2u_{xx},\quad 0<x<L,\quad t>0, \\ u_x(0,t)=0,\quad u(L,t)=0,\quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L \end{array} \tag{12.1.8}\end{equation}

is

\[ u(x,t)=\sum_{n=1}^\infty \alpha_ne^{-(2n-1)^2\pi^2a^2t/4L^2}\cos{(2n-1)\pi x\over2L}, \]

where

\[ C_M(x)=\sum_{n=1}^\infty \alpha_n\cos{(2n-1)\pi x\over2L} \]

is the mixed Fourier cosine series of \(f\) on \([0,L]\); that is,

\[ \alpha_n={2\over L}\int_0^Lf(x)\cos{(2n-1)\pi x\over2L}\,dx. \]

Example 12.1.4

Solve (12.1.8) with \(f(x)=x-L\).

Solution From Example 11.3.3, the mixed Fourier cosine series of \(f\) on \([0,L]\) is

\[ C_M(x)=-{8L\over\pi^2}\sum_{n=1}^\infty{1\over(2n-1)^2} \cos{(2n-1)\pi x\over2L}. \]

Therefore

\[ u(x,t)=-{8L\over\pi^2}\sum_{n=1}^\infty{1\over(2n-1)^2} e^{-(2n-1)^2\pi^2a^2t/4L^2}\cos{(2n-1)\pi x\over2L}. \]

Nonhomogeneous Problems

A problem of the form

\begin{equation} \begin{array}{c} u_t=a^2u_{xx}+h(x),\quad 0<x<L,\quad t>0,\\ u(0,t)=u_0,\quad u(L,t)=u_L,\quad t>0,\\ u(x,0)=f(x),\quad 0\le x\le L \end{array} \tag{12.1.9}\end{equation}

can be transformed to a problem that can be solved by separation of variables. We write

\begin{equation} u(x,t)=v(x,t)+q(x), \tag{12.1.10}\end{equation}

where \(q\) is to be determined. Then

\[ u_t=v_t\mbox{\quad and \quad}u_{xx}=v_{xx}+q'' \]

so \(u\) satisfies (12.1.9) if \(v\) satisfies

\[ \begin{array}{c} v_t=a^2v_{xx}+a^2q''(x)+h(x),\quad 0<x<L,\quad t>0,\\ v(0,t)=u_0-q(0),\quad v(L,t)=u_L-q(L),\quad t>0,\\ v(x,0)=f(x)-q(x),\quad 0\le x\le L. \end{array} \]

This reduces to

\begin{equation} \begin{array}{c} v_t=a^2v_{xx},\quad 0<x<L,\quad t>0,\\ v(0,t)=0,\quad v(L,t)=0,\quad t>0,\\ v(x,0)=f(x)-q(x),\quad 0\le x\le L \end{array} \tag{12.1.11}\end{equation}

if

\[ a^2q''+h(x)=0,\quad q(0)=u_0,\quad q(L)=u_L. \]

We can obtain \(q\) by integrating \(q''=-h/a^2\) twice and choosing the constants of integration so that \(q(0)=u_0\) and \(q(L)=u_L\). Then we can solve (12.1.11) for \(v\) by separation of variables, and (12.1.10) is the solution of (12.1.9).

Example 12.1.5

Solve

\[ \begin{array}{c} u_t=u_{xx}-2,\quad 0<x<1,\quad t>0,\\ u(0,t)=-1,\quad u(1,t)=1,\quad t>0,\\ u(x,0)=x^3-2x^2+3x-1,\quad 0\le x\le1. \end{array} \]

Solution We leave it to you to show that

\[ q(x)=x^2+x-1 \]

satisfies

\[ q''-2=0,\quad q(0)=-1,\quad q(1)=1. \]

Therefore

\[ u(x,t)=v(x,t)+x^2+x-1, \]

where

\[ v_t=v_{xx},\quad 0<x<1,\quad t>0, \]
\[ v(0,t)=0,\quad v(1,t)=0,\quad t>0, \]

and

\[ v(x,0)=x^3-2x^2+3x-1-x^2-x+1=x(x^2-3x+2). \]

From Example 12.1.1 with \(a=1\) and \(L=1\),

\[ v(x,t)= {12\over\pi^3}\sum_{n=1}^\infty{1\over n^3} e^{-n^2\pi^2t}\sin n\pi x. \]

Therefore

\[ u(x,t)=x^2+x-1+ {12\over\pi^3}\sum_{n=1}^\infty{1\over n^3} e^{-n^2\pi^2t}\sin n\pi x. \tag*{\bbox} \]

A similar procedure works if the boundary conditions in (12.1.11) are replaced by mixed boundary conditions

\[ u_x(0,t)=u_0,\quad u(L,t)=u_L,\quad t>0 \]

or

\[ u(0,t)=u_0,\quad u_x(L,t)=u_L,\quad t>0; \]

however, this isn’t true in general for the boundary conditions

\[ u_x(0,t)=u_0,\quad u_x(L,t)=u_L,\quad t>0. \]

(See Exercise 47.)

Using Technology

Numerical experiments can enhance your understanding of the solutions of initial-boundary value problems. To be specific, consider the formal solution

\[ u(x,t)=\sum_{n=1}^\infty \alpha_ne^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}, \]

of (12.1.4), where

\[ S(x)=\sum_{n=1}^\infty \alpha_n \sin{n\pi x \over L} \]

is the Fourier sine series of \(f\) on \([0,L]\). Consider the \(m\)-th partial sum

\begin{equation} u_m(x,t)=\sum_{n=1}^m \alpha_ne^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}. \tag{12.1.12}\end{equation}

For several fixed values of \(t\) (including \(t=0\)), graph \(u_m(x,t)\) versus \(t\). In some cases it may be useful to graph the curves corresponding to the various values of \(t\) on the same axes in other cases you may want to graph the various curves sucessively (for increasing values of \(t\)), and create a primitive motion picture on your monitor. Repeat this experiment for several values of \(m\), to compare how the results depend upon \(m\) for small and large values of \(t\). However, keep in mind that the meanings of “small” and “large” in this case depend upon the constants \(a^2\) and \(L^2\). A good way to handle this is to rewrite (12.1.12) as

\[ u_m(x,t)=\sum_{n=1}^m \alpha_ne^{-n^2\tau}\sin{n\pi x\over L}, \]

where

\begin{equation} \tau={\pi^2a^2t\over L^2}, \tag{12.1.13}\end{equation}

and graph \(u_m\) versus \(x\) for selected values of \(\tau\).

These comments also apply to the situations considered in Definitions 12.1.3-12.1.5, except that (12.1.13) should be replaced by

\[ \tau={\pi^2a^2t\over 4L^2}, \]

in Definitions 12.1.4 and 12.1.5.

In some of the exercises we say “perform numerical experiments.” This means that you should perform the computations just described with the formal solution obtained in the exercise.

12.1 Exercises

  1. Explain Definition 12.1.3.

  2. Explain Definition 12.1.4.

  3. Explain Definition 12.1.5.

  4. C Perform numerical experiments with the formal solution obtained in Example 12.1.1.

  5. C Perform numerical experiments with the formal solution obtained in Example 12.1.2.

  6. C Perform numerical experiments with the formal solution obtained in Example 12.1.3.

  7. C Perform numerical experiments with the formal solution obtained in Example 12.1.4.

In Exercises 8-42 solve the initial-boundary value problem. Where indicated by C , perform numerical experiments. To simplify the computation of coefficients in some of these problems, check first to see if \(u(x,0)\) is a polynomial that satisfies the boundary conditions. If it does, apply Theorem 11.3.5; also, see Exercises \(11.3.\) 35(b), \(11.3.\) 42(b), and \(11.3.\) 50(b).

  1. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x(1-x),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{8\over\pi^3}\sum_{n=1}^\infty {1\over(2n-1)^3} e^{-(2n-1)^2\pi^2t}\sin(2n-1)\pi x\)

  2. \(u_t=9u_{xx},\quad 0<x<4,\quad t>0\),
    \(u(0,t)=0,\quad u(4,t)=0,\quad t>0\),
    \(u(x,0)=1,\quad 0\le x\le 4\)

    Show answer

    \(u(x,t)=\dst{4\over\pi}\sum_{n=1}^\infty{1\over(2n-1)} e^{-9(2n-1)^2\pi^2t/16}\sin{(2n-1)\pi x\over 4}\)

  3. \(u_t=3u_{xx},\quad 0<x<\pi,\quad t>0\),
    \(u(0,t)=0,\quad u(\pi,t)=0,\quad t>0\),
    \(u(x,0)=x\sin x,\quad 0\le x\le \pi\)

    Show answer

    \(u(x,t)=\dst{\pi\over2}e^{-3t}\sin x-{16\over\pi}\sum_{n=1}^\infty{n\over(4n^2-1)^2}e^{-12n^2t}\sin2nx\)

  4. C \(u_t=9u_{xx},\quad 0<x<2,\quad t>0\),
    \(u(0,t)=0,\quad u(2,t)=0,\quad t>0\),
    \(u(x,0)=x^2(2-x),\quad 0\le x\le 2\)

    Show answer

    \(u(x,t)=\dst-{32\over\pi^3}\sum_{n=1}^\infty {(1+(-1)^n2)\over n^3} e^{-9n^2\pi^2t/4}\sin{n\pi x\over 2}\)

  5. \(u_t=4u_{xx},\quad 0<x<3,\quad t>0\),
    \(u(0,t)=0,\quad u(3,t)=0,\quad t>0\),
    \(u(x,0)=x(9-x^2),\quad 0\le x\le 3\)

    Show answer

    \(u(x,t)=\dst-{324\over\pi^3}\sum_{n=1}^\infty{(-1)^n\over n^3} e^{-4n^2\pi^2t/9}\sin{n\pi x\over 3}\)

  6. \(u_t=4u_{xx},\quad 0<x<2,\quad t>0\),
    \(u(0,t)=0,\quad u(2,t)=0,\quad t>0\),
    \(u(x,0)= \left\{\begin{array}{cl} x,&0\le x\le1,\\2-x,&1\le x\le 2. \end{array}\right.\)

    Show answer

    \(u(x,t)=\dst{8\over\pi^2}\sum_{n=1}^\infty{(-1)^{n+1}\over(2n-1)^2} e^{-(2n-1)^2\pi^2t}\sin{(2n-1)\pi x\over 2}\)

  7. \(u_t=7u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x(3x^4-10x^2+7),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst-{720\over\pi^5}\sum_{n=1}^\infty{(-1)^n\over n^5}e^{-7n^2\pi^2t}\sin n\pi x\)

  8. \(u_t=5u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x(x^3-2x^2+1),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{96\over\pi^5}\sum_{n=1}^\infty{1\over(2n-1)^5} e^{-5(2n-1)^2\pi^2t}\sin(2n-1)\pi x\)

  9. \(u_t=2u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x(3x^4-5x^3+2),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst-{240\over\pi^5}\sum_{n=1}^\infty{1+(-1)^n2\over n^5}e^{-2n^2\pi^2t}\sin n\pi x\).

  10. C \(u_t=9u_{xx},\quad 0<x<4,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(4,t)=0,\quad t>0\),
    \(u(x,0)=x^2,\quad 0\le x\le 4\)

    Show answer

    \(u(x,t)=\dst{16\over3}+{64\over\pi^2}\sum_{n=1}^\infty{(-1)^n\over n^2} e^{-9\pi^2n^2t/16}\cos{n\pi x\over 4}\)

  11. \(u_t=4u_{xx},\quad 0<x<2,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(2,t)=0,\quad t>0\),
    \(u(x,0)=x(x-4),\quad 0\le x\le 2\)

    Show answer

    \(u(x,t)=\dst-{8\over3}+{16\over\pi^2}\sum_{n=1}^\infty{1\over n^2}e^{-n^2\pi^2t}\cos{n\pi x\over 2}\)

  12. C \(u_t=9u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x(1-x),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{1\over6}-{1\over\pi^2}\sum_{n=1}^\infty{1\over n^2}e^{-36n^2\pi^2t}\cos 2n\pi x\)

  13. \(u_t=3u_{xx},\quad 0<x<2,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(2,t)=0,\quad t>0\),
    \(u(x,0)=2x^2(3-x),\quad 0\le x\le 2\)

    Show answer

    \(u(x,t)=\dst4-{384\over\pi^4}\sum_{n=1}^\infty{1\over (2n-1)^4}e^{-3(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over 2}\)

  14. \(u_t=5u_{xx},\quad 0<x<\sqrt2,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(\sqrt2,t)=0,\quad t>0\),
    \(u(x,0)=3x^2(x^2-4),\quad 0\le x\le \sqrt2\)

    Show answer

    \(u(x,y)=\dst-{28\over5}-{576\over\pi^4}\sum_{n=1}^\infty{(-1)^n\over n^4}e^{-5n^2\pi^2t/2}\cos{n\pi x\over\sqrt2}\)

  15. C \(u_t=3u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x^3(3x-4),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst-{2\over5}-{48\over\pi^4}\sum_{n=1}^\infty{1+(-1)^n2\over n^4}e^{-3n^2\pi^2t}\cos n\pi x\)

  16. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x^2(3x^2-8x+6),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{3\over5}-{48\over\pi^4}\sum_{n=1}^\infty{2+(-1)^n\over n^4}e^{-n^2\pi^2t}\cos n\pi x\)

  17. \(u_t=u_{xx},\quad 0<x<\pi,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(\pi,t)=0,\quad t>0\),
    \(u(x,0)=x^2(x-\pi)^2,\quad 0\le x\le \pi\)

    Show answer

    \(\dst u(x,t)={\pi^4\over30}-3\sum_{n=1}^\infty{1\over n^4}e^{-4n^2t}\cos2nx\)

  18. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=\sin\pi x,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{{8\over\pi} \sum^\infty_{n=1} {(-1)^n\over(2n+1)(2n-3)} e^{-(2n-1)^2\pi^2 t/4}\sin{(2n-1)\pi x\over 2}}\)

  19. C \(u_t=3u_{xx},\quad 0<x<\pi,\quad t>0\),
    \(u(0,t)=0,\quad u_x(\pi,t)=0,\quad t>0\),
    \(u(x,0)=x(\pi-x),\quad 0\le x\le \pi\)

    Show answer

    \(u(x,t)=\dst8\sum_{n=1}^\infty{1\over(2n-1)^2}\left[ (-1)^n+{4\over(2n-1)\pi}\right]e^{-3(2n-1)^2t/4}\sin{(2n-1) x\over 2}\)

  20. \(u_t=5u_{xx},\quad 0<x<2,\quad t>0\),
    \(u(0,t)=0,\quad u_x(2,t)=0,\quad t>0\),
    \(u(x,0)=x(4-x),\quad 0\le x\le 2\)

    Show answer

    \(u(x,t)=\dst {128\over\pi^3}\sum_{n=1}^\infty{1\over (2n-1)^3}e^{-5(2n-1)^2t/16}\sin{(2n-1)\pi x\over4}\)

  21. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x^2(3-2x),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t) =\dst-{96\over\pi^3}\sum_{n=1}^\infty {1\over(2n-1)^3}\left[1+(-1)^n{4\over(2n-1)\pi}\right] e^{-(2n-1)^2\pi^2t/4}\sin{(2n-1)\pi x\over2}\)

  22. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=(x-1)^3+1,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t) =\dst{96\over\pi^3}\sum_{n=1}^\infty {1\over(2n-1)^3}\left[1+(-1)^n{2\over(2n-1)\pi}\right] e^{-(2n-1)^2\pi^2t/4}\sin{(2n-1)\pi x\over2}\)

  23. C \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x(x^2-3),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{192\over\pi^4}\sum_{n=1}^\infty{(-1)^n\over(2n-1)^4} e^{-(2n-1)^2\pi^2t/4}\sin{(2n-1)\pi x\over2}\)

  24. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x^3(3x-4),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{1536\over\pi^4}\sum_{n=1}^\infty{1\over(2n-1)^4} \left[(-1)^n+{3\over(2n-1)\pi}\right] e^{-(2n-1)^2\pi^2t/4}\sin{(2n-1)\pi x\over2}\)

  25. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=0,\quad t>0\),
    \(u(x,0)=x(x^3-2x^2+2),\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{384\over\pi^4}\sum_{n=1}^\infty{1\over(2n-1)^4} \left[(-1)^n+{4\over(2n-1)\pi}\right] e^{-(2n-1)^2\pi^2t/4}\sin{(2n-1)\pi x\over2}\)

  26. \(u_t=3u_{xx},\quad 0<x<\pi,\quad t>0\),
    \(u_x(0,t)=0,\quad u(\pi,t)=0,\quad t>0\),
    \(u(x,0)=x^2(\pi-x),\quad 0\le x\le \pi\)

    Show answer

    \(u(x,t)=-\dst64\sum_{n=1}^\infty{e^{-3(2n-1)^2t/4}\over(2n-1)^3}\left[ (-1)^n+{3\over(2n-1)\pi}\right]\cos{(2n-1) x\over2}\)

  27. \(u_t=16u_{xx},\quad 0<x<2\pi,\quad t>0\),
    \(u_x(0,t)=0,\quad u(2\pi,t)=0,\quad t>0\),
    \(u(x,0)=4,\quad 0\le x\le 2\pi\)

    Show answer

    \(u(x,t)=-\dst{16\over\pi} \sum^\infty_{n=1} {(-1)^n\over2n-1} e^{-(2n-1)^2t}\cos{(2n-1)x\over4}\)

  28. \(u_t=9u_{xx},\quad 0<x<4,\quad t>0\),
    \(u_x(0,t)=0,\quad u(4,t)=0,\quad t>0\),
    \(u(x,0)=x^2,\quad 0\le x\le 4\)

    Show answer

    \(u(x,t)=\dst-{64\over\pi}\sum_{n=1}^\infty{(-1)^n\over2n-1}\left[ 1-{8\over(2n-1)^2\pi^2}\right]e^{-9(2n-1)^2\pi^2 t/64}\cos{(2n-1)\pi x\over8}\)

  29. C \(u_t=3u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=1-x,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)= \dst{8\over\pi^2}\sum_{n=1}^\infty{1\over(2n-1)^2} e^{-3(2n-1)^2\pi^2t/4} \cos{(2n-1)\pi x\over2}\)

  30. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=1-x^3,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=-\dst{96\over\pi^3}\sum_{n=1}^\infty{1\over(2n-1)^3}\left[ (-1)^n+{2\over(2n-1)\pi}\right]e^{-(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over2}\)

  31. \(u_t=7u_{xx},\quad 0<x<\pi,\quad t>0\),
    \(u_x(0,t)=0,\quad u(\pi,t)=0,\quad t>0\),
    \(u(x,0)=\pi^2-x^2,\quad 0\le x\le \pi\)

    Show answer

    \(u(x,t)=-\dst {32\over\pi}\sum_{n=1}^\infty{(-1)^n\over (2n-1)^3}e^{-7(2n-1)^2t/4}\cos{(2n-1) x\over2}\)

  32. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=4x^3+3x^2-7,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{96\over\pi^3}\sum_{n=1}^\infty{1\over(2n-1)^3}\left[ (-1)^n5+{8\over(2n-1)\pi}\right]e^{-(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over2}\)

  33. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=2x^3+3x^2-5,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst{96\over\pi^3}\sum_{n=1}^\infty{1\over(2n-1)^3}\left[ (-1)^n3+{4\over(2n-1)\pi}\right]e^{-(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over2}\)

  34. C \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x^4-4x^3+6x^2-3,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=-\dst{768\over\pi^4}\sum_{n=1}^\infty{1\over(2n-1)^4}\left[ 1+{(-1)^n2\over(2n-1)\pi}\right]e^{-(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over2}\)

  35. \(u_t=u_{xx},\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=0,\quad u(1,t)=0,\quad t>0\),
    \(u(x,0)=x^4-2x^3+1,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=-\dst{384\over\pi^4}\sum_{n=1}^\infty{1\over(2n-1)^4}\left[ 1+{(-1)^n4\over(2n-1)\pi}\right]e^{-(2n-1)^2\pi^2t/4}\cos{(2n-1)\pi x\over2}\)

In Exercises 43-46 solve the initial-boundary value problem. Perform numerical experiments for specific values of \(L\) and \(a\).

  1. C \(u_t=a^2u_{xx},\quad 0<x<L,\quad t>0\),
    \(u_x(0,t)=0,\quad u_x(L,t)=0,\quad t>0\),
    \(u(x,0)= \left\{\begin{array}{cl} 1,&0\le x\le{L\over2},\\0,&{L\over2}<x<L \end{array}\right.\)

    Show answer

    \(u(x,t)=\dst{1\over2}-{2\over\pi}\sum_{n=1}^\infty {(-1)^n\over2n-1}e^{-(2n-1)^2\pi^2a^2t/L^2}\cos{(2n-1)\pi x\over L}\)

  2. C \(u_t=a^2u_{xx},\quad 0<x<L,\quad t>0\),
    \(u(0,t)=0,\quad u(L,t)=0,\quad t>0\),
    \(u(x,0)= \left\{\begin{array}{cl} 1,&0\le x\le{L\over2},\\0,&{L\over2}<x<L \end{array}\right.\)

    Show answer

    \(u(x,t)=\dst{2\over\pi}\sum_{n=1}^\infty{1\over n} \left[1-\cos{n\pi\over2}\right]e^{-n^2\pi^2a^2t/L^2}\sin{n\pi x\over L}\)

  3. C \(u_t=a^2u_{xx},\quad 0<x<L,\quad t>0\),
    \(u_x(0,t)=0,\quad u(L,t)=0,\quad t>0\),
    \(u(x,0)= \left\{\begin{array}{cl} 1,&0\le x\le{L\over2},\\0,&{L\over2}<x<L \end{array}\right.\)

    Show answer

    \(u(x,t)=\dst{4\over\pi}\sum_{n=1}^\infty{1\over2n-1}\sin{(2n-1)\pi\over4} e^{-(2n-1)^2\pi^2a^2t/4L^2}\cos{(2n-1)\pi x\over 2L}\)

  4. C \(u_t=a^2u_{xx},\quad 0<x<L,\quad t>0\),
    \(u(0,t)=0,\quad u_x(L,t)=0,\quad t>0\),
    \(u(x,0)= \left\{\begin{array}{cl} 1,&0\le x\le{L\over2},\\0,&{L\over2}<x<L \end{array}\right.\)

    Show answer

    \(u(x,t)=\dst{4\over\pi}\sum_{n=1}^\infty{1\over2n-1} \left[1-\cos{(2n-1)\pi)\over4}\right] e^{-(2n-1)^2\pi^2a^2t/4L^2}\sin{(2n-1)\pi x\over 2L}\)

  5. Let \(h\) be continuous on \([0,L]\) and let \(u_0\), \(u_L\), and \(a\) be constants, with \(a>0\). Show that it’s always possible to find a function \(q\) that satisfies (a), (b), or (c), but that this isn’t so for (d).

    1. \(a^2q''+h=0,\quad q(0)=u_0,\quad q(L)=u_L\)

    2. \(a^2q''+h=0,\quad q'(0)=u_0,\quad q(L)=u_L\)

    3. \(a^2q''+h=0,\quad q(0)=u_0,\quad q'(L)=u_L\)

    4. \(a^2q''+h=0,\quad q'(0)=u_0,\quad q'(L)=u_L\)

In Exercises 48-53 solve the nonhomogeneous initial-boundary value problem

  1. \(u_t=9u_{xx}-54x,\quad 0<x<4,\quad t>0\),
    \(u(0,t)=1,\quad u(4,t)=61,\quad t>0\),
    \(u(x,0)=2-x+x^3,\quad 0\le x\le 4\)

    Show answer

    \(u(x,t)=1-x+x^3+\dst{4\over\pi}\sum_{n=1}^\infty{e^{-9\pi^2(2n-1)^2t/16}\over(2n-1)} \sin{(2n-1)\pi x\over 4}\)

  2. \(u_t=u_{xx}-2,\quad 0<x<1,\quad t>0\),
    \(u(0,t)=1,\quad u(1,t)=3,\quad t>0\),
    \(u(x,0)=2x^2+1,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\dst1+x+x^2 -\dst{8\over\pi^3}\sum_{n=1}^\infty {e^{-(2n-1)^2\pi^2t}\over(2n-1)^3} \sin(2n-1)\pi x\)

  3. \(u_t=3u_{xx}-18x,\quad 0<x<1,\quad t>0\),
    \(u_x(0,t)=-1,\quad u(1,t)=-1,\quad t>0\),
    \(u(x,0)=x^3-2x,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=-1-x+x^3+ \dst{8\over\pi^2}\sum_{n=1}^\infty{1\over(2n-1)^2} e^{-3(2n-1)^2\pi^2t/4} \cos{(2n-1)\pi x\over2}\)

  4. \(u_t=9u_{xx}-18,\quad 0<x<4,\quad t>0\),
    \(u_x(0,t)=-1,\quad u(4,t)=10,\quad t>0\),
    \(u(x,0)=2x^2-x-2,\quad 0\le x\le 4\)

    Show answer

    \(u(x,t)=x^2-x-2\dst-{64\over\pi}\sum_{n=1}^\infty{(-1)^n\over2n-1}\left[ 1-{8\over(2n-1)^2\pi^2}\right]e^{-9(2n-1)^2\pi^2 t/64}\cos{(2n-1)\pi x\over8}\)

  5. \(u_t=u_{xx}+\pi^2\sin\pi x,\quad 0<x<1,\quad t>0\),
    \(u(0,t)=0,\quad u_x(1,t)=-\pi,\quad t>0\),
    \(u(x,0)=2\sin\pi x,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=\sin\pi x+\dst{{8\over\pi} \sum^\infty_{n=1} {(-1)^n\over(2n+1)(2n-3)} e^{-(2n-1)^2\pi^2 t/4}\sin{(2n-1)\pi x\over 2}}\)

  6. \(u_t=u_{xx}-6x,\quad 0<x<L,\quad t>0,\)
    \(u(0,t)=3,\quad u_x(1,t)=2,\quad t>0\),
    \(u(x,0)=x^3-x^2+x+3,\quad 0\le x\le 1\)

    Show answer

    \(u(x,t)=x^3-x+3+\dst{32\over\pi^3}\sum_{n=1}^\infty{e^{-(2n-1)^2\pi^2t/4}\over (2n-1)^3}\sin{(2n-1)\pi x\over2}\)

  7. In this exercise take it as given that the infinite series \(\sum_{n=1}^\infty n^pe^{-qn^2}\) converges for all \(p\) if \(q>0\), and, where appropriate, use the comparison test for absolute convergence of an infinite series.

    Let

    \[ u(x,t)=\sum_{n=1}^\infty \alpha_n e^{-n^2\pi^2 a^2t/L^2}\sin{n\pi x\over L} \]

    where

    \[ \alpha_n={2\over L}\int_0^L f(x)\sin{n\pi x\over L}\,dx \]

    and \(f\) is piecewise smooth on \([0,L]\).

    1. Show that \(u\) is defined for \((x,t)\) such that \(t>0\).

    2. For fixed \(t>0\), use Theorem 12.1.2 with \(z=x\) to show that

      \[ u_x(x,t)={\pi\over L}\sum_{n=1}^\infty n\alpha_n e^{-n^2\pi^2 a^2t/L^2}\cos{n\pi x\over L},\quad -\infty<x<\infty. \]
    3. Starting from the result of (a), use Theorem 12.1.2 with \(z=x\) to show that, for a fixed \(t>0\),

      \[ u_{xx}(x,t)=-{\pi^2\over L^2}\sum_{n=1}^\infty n^2\alpha_n e^{-n^2\pi^2 a^2t/L^2}\sin{n\pi x\over L},\quad-\infty<x<\infty. \]
    4. For fixed but arbitrary \(x\), use Theorem 12.1.2 with \(z=t\) to show that

      \[ u_t(x,t)=-{\pi^2a^2\over L^2}\sum_{n=1}^\infty n^2\alpha_n e^{-n^2\pi^2 a^2t/L^2}\sin{n\pi x\over L}, \]

      if \(t>t_0>0\), where \(t_0\) is an arbitrary positive number. Then argue that since \(t_0\) is arbitrary, the conclusion holds for all \(t>0\).

    5. Conclude from (c) and (d) that

      \[ u_t=a^2u_{xx},\quad -\infty<x<\infty,\quad t>0. \]

    By repeatedly applying the arguments in (a) and (c), it can be shown that \(u\) can be differentiated term by term any number of times with respect to \(x\) and/or \(t\) if \(t>0\).