Skip to main content
Mathematics LibreTexts

7.3: The Nonhomogeneous Heat Equation

  • Page ID
    90270
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Boundary value green’s functions do not only arise in the solution of nonhomogeneous ordinary differential equations. They are also important in arriving at the solution of nonhomogeneous partial differential equations. In this section we will show that this is the case by turning to the nonhomogeneous heat equation.

    Nonhomogeneous Time Independent Boundary Conditions

    Consider the nonhomogeneous heat equation with nonhomogeneous boundary conditions: \[\begin{align} u_{t}-k u_{x x} &=h(x), \quad 0 \leq x \leq L, \quad t>0,\nonumber \\ u(0, t) &=a, \quad u(L, t)=b,\nonumber \\ u(x, 0) &=f(x) .\label{eq:1} \end{align}\] We are interested in finding a particular solution to this initial-boundary value problem. In fact, we can represent the solution to the general nonhomogeneous heat equation as the sum of two solutions that solve different problems.

    First, we let \(v(x, t)\) satisfy the homogeneous problem \[\begin{align} v_{t}-k v_{x x} &=0, \quad 0 \leq x \leq L, \quad t>0,\nonumber \\ v(0, t) &=0, \quad v(L, t)=0,\nonumber \\ v(x, 0) &=g(x),\label{eq:2} \end{align}\] which has homogeneous boundary conditions.

    Note

    The steady state solution, \(w(t)\), satisfies a nonhomogeneous differential equation with nonhomogeneous boundary conditions. The transient solution, \(v(t)\), satisfies the homogeneous heat equation with homogeneous boundary conditions and satisfies a modified initial condition.

    We will also need a steady state solution to the original problem. A steady state solution is one that satisfies \(u_{t}=0\). Let \(w(x)\) be the steady state solution. It satisfies the problem \[\begin{align} -k w_{x x} &=h(x), \quad 0 \leq x \leq L .\nonumber \\ w(0, t) &=a, \quad w(L, t)=b .\label{eq:3} \end{align}\]

    Now consider \(u(x, t)=w(x)+v(x, t)\), the sum of the steady state solution, \(w(x)\), and the transient solution, \(v(x, t)\). We first note that \(u(x, t)\) satisfies the nonhomogeneous heat equation, \[\begin{align} u_{t}-k u_{x x} &=(w+v)_{t}-(w+v)_{x x}\nonumber \\ &=v_{t}-k v_{x x}-k w_{x x} \equiv h(x) .\label{eq:4} \end{align}\]

    The boundary conditions are also satisfied. Evaluating, \(u(x, t)\) at \(x=0\) and \(x=L\), we have \[\begin{align} &u(0, t)=w(0)+v(0, t)=a\nonumber \\ &u(L, t)=w(L)+v(L, t)=b\label{eq:5} \end{align}\]

    Note

    The transient solution satisfies \[v(x,0)=f(x)-w(x).\nonumber\]

    Finally, the initial condition gives \[u(x, 0)=w(x)+v(x, 0)=w(x)+g(x) .\nonumber \] Thus, if we set \(g(x)=f(x)-w(x)\), then \(u(x, t)=w(x)+v(x, t)\) will be the solution of the nonhomogeneous boundary value problem. We all ready know how to solve the homogeneous problem to obtain \(v(x, t)\). So, we only need to find the steady state solution, \(w(x)\).

    There are several methods we could use to solve Equation \(\eqref{eq:3}\) for the steady state solution. One is the Method of Variation of Parameters, which is closely related to the Green’s function method for boundary value problems which we described in the last several sections. However, we will just integrate the differential equation for the steady state solution directly to find the solution. From this solution we will be able to read off the Green’s function.

    Integrating the steady state equation \(\eqref{eq:3}\) once, yields \[\frac{d w}{d x}=-\frac{1}{k} \int_{0}^{x} h(z) d z+A \text {, }\nonumber \] where we have been careful to include the integration constant, \(A=w^{\prime}(0)\). Integrating again, we obtain \[w(x)=-\frac{1}{k} \int_{0}^{x}\left(\int_{0}^{y} h(z) d z\right) d y+A x+B,\nonumber \] where a second integration constant has been introduced. This gives the general solution for Equation \(\eqref{eq:3}\).

    The boundary conditions can now be used to determine the constants. It is clear that \(B=a\) for the condition at \(x=0\) to be satisfied. The second condition gives \[b=w(L)=-\frac{1}{k} \int_{0}^{L}\left(\int_{0}^{y} h(z) d z\right) d y+A L+a .\nonumber\] Solving for \(A\), we have \[A=\frac{1}{k L} \int_{0}^{L}\left(\int_{0}^{y} h(z) d z\right) d y+\frac{b-a}{L} .\nonumber \]

    Inserting the integration constants, the solution of the boundary value problem for the steady state solution is then \[w(x)=-\frac{1}{k} \int_{0}^{x}\left(\int_{0}^{y} h(z) d z\right) d y+\frac{x}{k L} \int_{0}^{L}\left(\int_{0}^{y} h(z) d z\right) d y+\frac{b-a}{L} x+a .\nonumber \]

    This is sufficient for an answer, but it can be written in a more compact form. In fact, we will show that the solution can be written in a way that a Green’s function can be identified.

    First, we rewrite the double integrals as single integrals. We can do this using integration by parts. Consider integral in the first term of the solution, \[I=\int_{0}^{x}\left(\int_{0}^{y} h(z) d z\right) d y .\nonumber \] Setting \(u=\int_{0}^{y} h(z) d z\) and \(d v=d y\) in the standard integration by parts formula, we obtain \[\begin{align} I &=\int_{0}^{x}\left(\int_{0}^{y} h(z) d z\right) d y\nonumber \\ &=\left.y \int_{0}^{y} h(z) d z\right|_{0} ^{x}-\int_{0}^{x} y h(y) d y\nonumber \\ &=\int_{0}^{x}(x-y) h(y) d y .\label{eq:6} \end{align}\]

    Thus, the double integral has now collapsed to a single integral. Replacing the integral in the solution, the steady state solution becomes \[w(x)=-\frac{1}{k} \int_{0}^{x}(x-y) h(y) d y+\frac{x}{k L} \int_{0}^{L}(L-y) h(y) d y+\frac{b-a}{L} x+a .\nonumber \]

    We can make a further simplification by combining these integrals. This can be done if the integration range, \([0, L]\), in the second integral is split into two pieces, \([0, x]\) and \([x, L]\). Writing the second integral as two integrals over these subintervals, we obtain \[\begin{align} w(x)=&-\frac{1}{k} \int_{0}^{x}(x-y) h(y) d y+\frac{x}{k L} \int_{0}^{x}(L-y) h(y) d y\nonumber \\ &+\frac{x}{k L} \int_{x}^{L}(L-y) h(y) d y+\frac{b-a}{L} x+a .\label{eq:7} \end{align}\]

    Next, we rewrite the integrands, \[\begin{align} w(x)=&-\frac{1}{k} \int_{0}^{x} \frac{L(x-y)}{L} h(y) d y+\frac{1}{k} \int_{0}^{x} \frac{x(L-y)}{L} h(y) d y\nonumber \\ &+\frac{1}{k} \int_{x}^{L} \frac{x(L-y)}{L} h(y) d y+\frac{b-a}{L} x+a .\label{eq:8} \end{align}\] It can now be seen how we can combine the first two integrals: \[w(x)=-\frac{1}{k} \int_{0}^{x} \frac{y(L-x)}{L} h(y) d y+\frac{1}{k} \int_{x}^{L} \frac{x(L-y)}{L} h(y) d y+\frac{b-a}{L} x+a .\nonumber \]

    The resulting integrals now take on a similar form and this solution can be written compactly as \[w(x)=-\int_{0}^{L} G(x, y)\left[-\frac{1}{k} h(y)\right] d y+\frac{b-a}{L} x+a,\nonumber \] where \[G(x, y)= \begin{cases}\frac{x(L-y)}{L}, & 0 \leq x \leq y, \\ \frac{y(L-x)}{L}, & y \leq x \leq L,\end{cases}\nonumber \] is the Green’s function for this problem.

    The full solution to the original problem can be found by adding to this steady state solution a solution of the homogeneous problem, \[\begin{align} u_{t}-k u_{x x} &=0, \quad 0 \leq x \leq L, \quad t>0,\nonumber \\ u(0, t) &=0, \quad u(L, t)=0,\nonumber \\ u(x, 0) &=f(x)-w(x) .\label{eq:9} \end{align}\]

    Example \(\PageIndex{1}\)

    Solve the nonhomogeneous problem, \[\begin{align} u_{t}-u_{x x} &=10, \quad 0 \leq x \leq 1, \quad t>0,\nonumber \\ u(0, t) &=20, \quad u(1, t)=0,\nonumber \\ u(x, 0) &=2 x(1-x) .\label{eq:10} \end{align}\]

    Solution

    In this problem we have a rod initially at a temperature of \(u(x, 0)=2 x(1-x)\). The ends of the rod are maintained at fixed temperatures and the bar is continually heated at a constant temperature, represented by the source term, 10 .

    First, we find the steady state temperature, \(w(x)\), satisfying \[\begin{align} -w_{x x} &=10, \quad 0 \leq x \leq 1 .\nonumber \\ w(0, t) &=20, \quad w(1, t)=0 .\label{eq:11} \end{align}\]

    Using the general solution, we have \[w(x)=\int_{0}^{1} 10 G(x, y) d y-20 x+20,\nonumber \] where \[G(x, y)= \begin{cases}x(1-y), & 0 \leq x \leq y, \\ y(1-x), & y \leq x \leq 1,\end{cases}\nonumber \] we compute the solution \[\begin{align} w(x) &=\int_{0}^{x} 10 y(1-x) d y+\int_{x}^{1} 10 x(1-y) d y-20 x+20\nonumber \\ &=5\left(x-x^{2}\right)-20 x+20,\nonumber \\ &=20-15 x-5 x^{2} .\label{eq:12} \end{align}\] Checking this solution, it satisfies both the steady state equation and boundary conditions.

    The transient solution satisfies \[\begin{align} v_{t}-v_{x x} &=0, \quad 0 \leq x \leq 1, \quad t>0,\nonumber \\ v(0, t) &=0, \quad v(1, t)=0, \nonumber \\ v(x, 0) &=x(1-x)-10 .\label{eq:13} \end{align}\] Recall, that we have determined the solution of this problem as \[v(x, t)=\sum_{n=1}^{\infty} b_{n} e^{-n^{2} \pi^{2} t} \sin n \pi x,\nonumber \] where the Fourier sine coefficients are given in terms of the initial temperature distribution, \[b_{n}=2 \int_{0}^{1}[x(1-x)-10] \sin n \pi x d x, \quad n=1,2, \ldots .\nonumber \]

    Therefore, the full solution is \[u(x, t)=\sum_{n=1}^{\infty} b_{n} e^{-n^{2} \pi^{2} t} \sin n \pi x+20-15 x-5 x^{2} .\nonumber \] Note that for large \(t\), the transient solution tends to zero and we are left with the steady state solution as expected.

    Time Dependent Boundary Conditions

    In the last section we solved problems with time independent boundary conditions using equilibrium solutions satisfying the steady state heat equation sand nonhomogeneous boundary conditions. When the boundary conditions are time dependent, we can also convert the problem to an auxiliary problem with homogeneous boundary conditions.

    Consider the problem \[\begin{align} u_{t}-k u_{x x} &=h(x), & 0 \leq x \leq L, & t>0, \nonumber \\ u(0, t) &=a(t), & u(L, t)=b(t), & t>0,\nonumber \\ u(x, 0) &=f(x), & 0 \leq x \leq L .\label{eq:14} \end{align}\]

    We define \(u(x, t)=v(x, t)+w(x, t)\), where \(w(x, t)\) is a modified form of the steady state solution from the last section, \[w(x, t)=a(t)+\frac{b(t)-a(t)}{L} x .\nonumber \] Noting that \[\begin{align} u_{t} &=v_{t}+\dot{a}+\frac{\dot{b}-\dot{a}}{L} x,\nonumber \\ u_{x x} &=v_{x x},\label{eq:15} \end{align}\] we find that \(v(x, t)\) is a solution of the problem \[\begin{align} v_{t}-k v_{x x} &=h(x)-\left[\dot{a}(t)+\frac{\dot{b}(t)-\dot{a}(t)}{L} x\right], & 0 \leq x \leq L, \quad t>0,\nonumber \\ v(0, t) &=0, \quad v(L, t)=0, \quad t>0, &\nonumber \\ v(x, 0) &=f(x)-\left[a(0)+\frac{b(0)-a(0)}{L} x\right], \quad & 0 \leq x \leq L .\label{eq:16} \end{align}\] Thus, we have converted the original problem into a nonhomogeneous heat equation with homogeneous boundary conditions and a new source term and new initial condition.

    Example \(\PageIndex{2}\)

    Solve the problem \[\begin{align} u_{t}-u_{x x} &=x, \quad 0 \leq x \leq 1, \quad t>0,\nonumber \\ u(0, t) &=2, \quad u(L, t)=t, \quad t>0\nonumber \\ u(x, 0) &=3 \sin 2 \pi x+2(1-x), \quad 0 \leq x \leq 1 .\label{eq:17} \end{align}\]

    Solution

    We first define \[u(x, t)=v(x, t)+2+(t-2) x .\nonumber \] Then, \(v(x, t)\) satisfies the problem \[\begin{align} v_{t}-v_{x x} &=0, \quad 0 \leq x \leq 1, \quad t>0,\nonumber \\ v(0, t) &=0, \quad v(L, t)=0, \quad t>0,\nonumber \\ v(x, 0) &=3 \sin 2 \pi x, \quad 0 \leq x \leq 1 .\label{eq:18} \end{align}\]

    This problem is easily solved. The general solution is given by \[v(x, t)=\sum_{n=1}^{\infty} b_{n} \sin n \pi x e^{-n^{2} \pi^{2} t} .\nonumber \] We can see that the Fourier coefficients all vanish except for \(b_{2}\). This gives \(v(x, t)=\) \(3 \sin 2 \pi x e^{-4 \pi^{2} t}\) and, therefore, we have found the solution \[u(x, t)=3 \sin 2 \pi x e^{-4 \pi^{2} t}+2+(t-2) x .\nonumber\]


    This page titled 7.3: The Nonhomogeneous Heat Equation is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.