Skip to main content
Mathematics LibreTexts

7.7: Green’s Function Solution of Nonhomogeneous Heat Equation

  • Page ID
    90963
  • \( \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}}\)

    We solved the one dimensional heat equation with a source using an eigenfunction expansion. In this section we rewrite the solution and identify the Green’s function form of the solution. Recall that the solution of the nonhomogeneous problem, \[\begin{align} u_{t} &=k u_{x x}+Q(x, t), \quad 0<x<L, \quad t>0,\nonumber \\ u(0, t) &=0, \quad u(L, t)=0, \quad t>0,\nonumber \\ u(x, 0) &=f(x), \quad 0<x<L,\label{eq:1} \end{align}\] is given by Equation (7.6.11) \[\begin{align} u(x, t) &=\sum_{n=1}^{\infty} a_{n}(t) \phi_{n}(x)\nonumber \\ &=\sum_{n=1}^{\infty}\left[a_{n}(0) e^{-k \lambda_{n} t}+\int_{0}^{t} q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} d \tau\right] \phi_{n}(x) \cdot(7 \cdot 134)\label{eq:2} \end{align}\] The generalized Fourier coefficients for \(a_{n}(0)\) and \(q_{n}(t)\) are given by \[a_{n}(0)=\frac{1}{\left\|\phi_{n}\right\|^{2}} \int_{0}^{L} f(x) \phi_{n}(x) d x,\label{eq:3}\] \[q_{n}(t)=\frac{1}{\left\|\phi_{n}\right\|^{2}} \int_{0}^{L} Q(x, t) \phi_{n}(x) d x .\label{eq:4}\]

    The solution in Equation \(\eqref{eq:2}\) can be rewritten using the Fourier coefficients in Equations \(\eqref{eq:3}\) and \(\eqref{eq:4}\). \[\begin{align} u(x, t)=&\sum_{n=1}^{\infty}\left[a_{n}(0) e^{-k \lambda_{n} t}+\int_{0}^{t} q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} d \tau\right] \phi_{n}(x)\nonumber \\ =& \sum_{n=1}^{\infty} a_{n}(0) e^{-k \lambda_{n} t} \phi_{n}(x)+\int_{0}^{t} \sum_{n=1}^{\infty}\left(q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} \phi_{n}(x)\right) d \tau\nonumber \\ =& \sum_{n=1}^{\infty} \frac{1}{\left\|\phi_{n}\right\|^{2}}\left(\int_{0}^{L} f(\xi) \phi_{n}(\xi) d \xi\right) e^{-k \lambda_{n} t} \phi_{n}(x)\nonumber \\ &+\int_{0}^{t} \sum_{n=1}^{\infty} \frac{1}{\left\|\phi_{n}\right\|^{2}}\left(\int_{0}^{L} Q(\xi, \tau) \phi_{n}(\xi) d \xi\right) e^{-k \lambda_{n}(t-\tau)} \phi_{n}(x) d \tau\nonumber \\ =& \int_{0}^{L}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n} t}}{\left\|\phi_{n}\right\|^{2}}\right) f(\xi) d \xi\nonumber \\ &+\int_{0}^{t} \int_{0}^{L}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}}\right) Q(\xi, \tau) d \xi d \tau\label{eq:5} .\end{align}\]

    Defining \[G(x, t ; \xi, \tau)=\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}}\nonumber \] we see that the solution can be written in the form \[u(x, t)=\int_{0}^{L} G(x, t ; \xi, 0) f(\xi) d \xi+\int_{0}^{t} \int_{0}^{L} G(x, t ; \xi, \tau) Q(\xi, \tau) d \xi d \tau .\nonumber \] Thus, we see that \(G(x, t ; \xi, 0)\) is the initial value Green’s function and \(G(x, t ; \xi, \tau)\) is the general Green's function for this problem.

    Note

    The solution can be written in terms of the initial value Green’s function, \(G(x, t ; \xi, 0)\), and the general Green’s function, \(G(x, t ; \varepsilon, \tau)\).

    The only thing left is to introduce nonhomogeneous boundary conditions into this solution. So, we modify the original problem to the fully nonhomogeneous heat equation: \[\begin{align} u_{t} &=k u_{x x}+Q(x, t), \quad 0<x<L, \quad t>0\nonumber \\ u(0, t) &=\alpha(t), \quad u(L, t)=\beta(t), \quad t>0\nonumber \\ u(x, 0) &=f(x), \quad 0<x<L\label{eq:6} \end{align}\]

    As before, we begin with the expansion of the solution in the basis of \[u(x, t)=\sum_{n=1}^{\infty} a_{n}(t) \phi_{n}(x)\nonumber \] However, due to potential convergence problems, we cannot expect that \(u_{x x}\) can be obtained by simply differentiating the series twice and expecting the resulting series to converge to \(u_{x x}\). So, we need to be a little more careful.

    We first note that \[u_{t}=\sum_{n=1}^{\infty} \dot{a}_{n}(t) \phi_{n}(x)=k u_{x x}+Q(x, t) .\nonumber \] Solving for the expansion coefficients, we have \[\dot{a}(t)=\frac{\int_{0}^{L}\left(k u_{x x}+Q(x, t)\right) \phi_{n}(x) d x}{\left\|\phi_{n}\right\|^{2}} .\nonumber \] In order to proceed, we need an expression for \(\int_{a}^{b} u_{x x} \phi_{n}(x) d x\). We can find this using Green’s identity from Section 4.2.2.

    We start with \[\int_{a}^{b}(u \mathcal{L} v-v \mathcal{L} u) d x=\left[p\left(u v^{\prime}-v u^{\prime}\right)\right]_{a}^{b}\nonumber \] and let \(v=\phi_{n}\). Then, \[\begin{aligned} \int_{0}^{L}\left(u(x, t) \phi_{n}^{\prime \prime}(x)-\phi_{n}(x) u_{x x}(x, t)\right) d x=&\left.\left[u(x, t) \phi_{n}^{\prime}(x)-\phi_{n}(x) u_{x}(x, t)\right)\right]_{0}^{L} \\ \int_{0}^{L}\left(-\lambda_{n} u(x, t)+u_{x x}(x, t)\right) \phi_{n}(x) d x=&\left.\left[u(L, t) \phi_{n}^{\prime}(L)-\phi_{n}(L) u_{x}(L, t)\right)\right] \\ &\left.-\left[u(0, t) \phi_{n}^{\prime}(0)-\phi_{n}(0) u_{x}(0, t)\right)\right] \\ -\lambda_{n} a_{n}\left\|\phi_{n}\right\|^{2}-\int_{0}^{L} u_{x x}(x, t) \phi_{n}(x) d x=& \beta(t) \phi_{n}^{\prime}(L)-\alpha(t) \phi_{n}^{\prime}(0) . \end{aligned}\] Thus, \[\int_{0}^{L} u_{x x}(x, t) \phi_{n}(x) d x=-\lambda_{n} a_{n}\left\|\phi_{n}\right\|^{2}+\alpha(t) \phi_{n}^{\prime}(0)-\beta(t) \phi_{n}^{\prime}(L) .\nonumber \]

    Inserting this result into the equation for \(\dot{a}_{n}(t)\), we have \[\dot{a}(t)=-k \lambda_{n} a_{n}(t)+q_{n}(t)+k \frac{\alpha(t) \phi_{n}^{\prime}(0)-\beta(t) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}} .\nonumber \] As we had seen before, this first order equation can be solved using the integrating factor \[\mu(t)=\exp \int^{t} k \lambda_{n} d \tau=e^{k \lambda_{n} t} .\nonumber \]

    Multiplying the differential equation by the integrating factor, we find \[\begin{align} \left[\dot{a}_{n}(t)+k \lambda_{n} a_{n}(t)\right] e^{k \lambda_{n} t} &=\left[q_{n}(t)+k \frac{\alpha(t) \phi_{n}^{\prime}(0)-\beta(t) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{k \lambda_{n} t}\nonumber \\ \frac{d}{d t}\left(a_{n}(t) e^{k \lambda_{n} t}\right) &=\left[q_{n}(t)+k \frac{\alpha(t) \phi_{n}^{\prime}(0)-\beta(t) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{k \lambda_{n} t} .\label{eq:7} \end{align}\]

    Integrating, we have \[a_{n}(t) e^{k \lambda_{n} t}-a_{n}(0)=\int_{0}^{t}\left[q_{n}(\tau)+k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{k \lambda_{n} \tau} d \tau,\nonumber \] or \[a_{n}(t)=a_{n}(0) e^{-k \lambda_{n} t}+\int_{0}^{t}\left[q_{n}(\tau)+k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{-k \lambda_{n}(t-\tau)} d \tau .\nonumber \]

    We can now insert these coefficients into the solution and see how to extract the Green’s function contributions. Inserting the coefficients, we have \[\begin{align} u(x, t)=& \sum_{n=1}^{\infty} a_{n}(t) \phi_{n}(x)\nonumber \\ =& \sum_{n=1}^{\infty}\left[a_{n}(0) e^{-k \lambda_{n} t}+\int_{0}^{t} q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} d \tau\right] \phi_{n}(x)\nonumber \\ &+\sum_{n=1}^{\infty}\left(\int_{0}^{t}\left[k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{-k \lambda_{n}(t-\tau)} d \tau\right) \phi_{n}(x)\label{eq:8} \end{align}\] Recall that the generalized Fourier coefficients for \(a_{n}(0)\) and \(q_{n}(t)\) are given by \[a_{n}(0)=\frac{1}{\left\|\phi_{n}\right\|^{2}} \int_{0}^{L} f(x) \phi_{n}(x) d x,\label{eq:9}\] \[q_{n}(t)=\frac{1}{\left\|\phi_{n}\right\|^{2}} \int_{0}^{L} Q(x, t) \phi_{n}(x) d x .\label{eq:10}\]

    The solution in Equation \(\eqref{eq:8}\) can be rewritten using the Fourier coefficients in Equations \(\eqref{eq:9}\) and \(\eqref{eq:10}\). \[\begin{align} u(x, t)=& \sum_{n=1}^{\infty}\left[a_{n}(0) e^{-k \lambda_{n} t}+\int_{0}^{t} q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} d \tau\right] \phi_{n}(x)\nonumber \\ &+\sum_{n=1}^{\infty}\left(\int_{0}^{t}\left[k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{-k \lambda_{n}(t-\tau)} d \tau\right) \phi_{n}(x)\nonumber \\ =& \sum_{n=1}^{\infty} a_{n}(0) e^{-k \lambda_{n} t} \phi_{n}(x)+\int_{0}^{t} \sum_{n=1}^{\infty}\left(q_{n}(\tau) e^{-k \lambda_{n}(t-\tau)} \phi_{n}(x)\right) d \tau\nonumber \\ &+\int_{0}^{t} \sum_{n=1}^{\infty}\left(\left[k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{-k \lambda_{n}(t-\tau)}\right) \phi_{n}(x) d \tau\nonumber \\ =& \sum_{n=1}^{\infty} \frac{1}{\left\|\phi_{n}\right\|^{2}}\left(\int_{0}^{L} f(\xi) \phi_{n}(\xi) d \xi\right) e^{-k \lambda_{n} t} \phi_{n}(x)\nonumber \\ &+\int_{0}^{t} \sum_{n=1}^{\infty} \frac{1}{\left\|\phi_{n}\right\|^{2}}\left(\int_{0}^{L} Q(\xi, \tau) \phi_{n}(\xi) d \xi\right) e^{-k \lambda_{n}(t-\tau)} \phi_{n}(x) d \tau\nonumber \\ &+\int_{0}^{t} \sum_{n=1}^{\infty}\left(\left[k \frac{\alpha(\tau) \phi_{n}^{\prime}(0)-\beta(\tau) \phi_{n}^{\prime}(L)}{\left\|\phi_{n}\right\|^{2}}\right] e^{-k \lambda_{n}(t-\tau)}\right) \phi_{n}(x) d \tau\nonumber \\ =& \int_{0}^{L}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n} t}}{\left\|\phi_{n}\right\|^{2}}\right) f(\xi) d \xi\nonumber \\ &+\int_{0}^{t} \int_{0}^{L}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}}\right) Q(\xi, \tau) d \xi^{2} d \tau .\nonumber \\ &+k \int_{0}^{t}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}^{\prime}(0) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}}\right) \alpha(\tau) d \tau\nonumber \\ &-k \int_{0}^{t}\left(\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}^{\prime}(L) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}}\right) \beta(\tau) d \tau .\label{eq:11} \end{align}\]

    As before, we can define the general Green’s function as \[G(x, t ; \xi, \tau)=\sum_{n=1}^{\infty} \frac{\phi_{n}(x) \phi_{n}(\xi) e^{-k \lambda_{n}(t-\tau)}}{\left\|\phi_{n}\right\|^{2}} .\nonumber \] Then, we can write the solution to the fully homogeneous problem as \[\begin{align} u(x, t)=& \int_{0}^{t} \int_{0}^{L} G(x, t ; \xi, \tau) Q(\xi, \tau) d \xi d \tau+\int_{0}^{L} G(x, t ; \xi, 0) f(\xi) d \xi\nonumber \\ &+k \int_{0}^{t}\left[\alpha(\tau) \frac{\partial G}{\partial \xi}(x, 0 ; t, \tau)-\beta(\tau) \frac{\partial G}{\partial \xi}(x, L ; t, \tau)\right] d \tau . \label{eq:12} \end{align}\] The first integral handles the source term, the second integral handles the initial condition, and the third term handles the fixed boundary conditions.

    This general form can be deduced from the differential equation for the Green’s function and original differential equation by using a more general form of Green’s identity. Let the heat equation operator be defined as \(\mathcal{L}=\) \(\frac{\partial}{\partial t}-k \frac{\partial^{2}}{\partial x^{2}}\). The differential equations for \(u(x, t)\) and \(G(x, t ; \xi, \tau)\) for \(0 \leq x, \xi \leq\) \(L\) and \(t, \tau \geq 0\), are taken to be \[\begin{array}{r} \mathcal{L} u(x, t)=Q(x, t), \\ \mathcal{L} G(x, t ; \xi, \tau)=\delta(x-\xi) \delta(t-\tau) . \end{array}\label{eq:13}\]

    Multiplying the first equation by \(G(x, t ; \xi, \tau)\) and the second by \(u(x, t)\), we obtain \[\begin{array}{r} G(x, t ; \xi, \tau) \mathcal{L} u(x, t)=G(x, t ; \xi, \tau) Q(x, t), \\ u(x, t) \mathcal{L} G(x, t ; \xi, \tau)=\delta(x-\xi) \delta(t-\tau) u(x, t) . \end{array}\label{eq:14}\]

    Now, we subtract the equations and integrate with respect to \(x\) and \(t\). This gives \[\begin{align} & \int_{0}^{\infty} \int_{0}^{L}[G(x, t ; \xi, \tau) \mathcal{L} u(x, t)-u(x, t) \mathcal{L} G(x, t ; \xi, \tau)] d x d t\nonumber \\ =& \int_{0}^{\infty} \int_{0}^{L}[G(x, t ; \xi, \tau) Q(x, t)-\delta(x-\xi) \delta(t-\tau) u(x, t)] d x d t\nonumber \\ =& \int_{0}^{\infty} \int_{0}^{L} G(x, t ; \xi, \tau) Q(x, t) d x d t-u(\xi, \tau) .\label{eq:15} \end{align}\] and \[\begin{align} & \int_{0}^{\infty} \int_{0}^{L}[G(x, t ; \xi, \tau) \mathcal{L} u(x, t)-u(x, t) \mathcal{L} G(x, t ; \xi, \tau)] d x d t\nonumber \\ =& \int_{0}^{L} \int_{0}^{\infty}\left[G(x, t ; \xi, \tau) u_{t}-u(x, t) G_{t}(x, t ; \xi, \tau)\right] d t d x\nonumber \\ &-k \int_{0}^{\infty} \int_{0}^{L}\left[G(x, t ; \xi, \tau) u_{x x}(x, t)-u(x, t) G_{x x}(x, t ; \xi, \tau)\right] d x d t\nonumber \\ =& \int_{0}^{L}\left[\left.G(x, t ; \xi, \tau) u_{t}\right|_{0} ^{\infty}-2 \int_{0}^{\infty} u(x, t) G_{t}(x, t ; \xi, \tau) d t\right] d x\nonumber \\ &-k \int_{0}^{\infty}\left[G(x, t ; \xi, \tau) \frac{\partial u}{\partial x}(x, t)-u(x, t) \frac{\partial G}{\partial x}(x, t ; \xi, \tau)\right]_{0}^{L} d x d t\label{eq:16} \end{align}\]

    Equating these two results and solving for \(u(\xi, \tau)\), we have \[\begin{align} u(\xi, \tau)=& \int_{0}^{\infty} \int_{0}^{L} G(x, t ; \xi, \tau) Q(x, t) d x d t\nonumber \\ &+k \int_{0}^{\infty}\left[G(x, t ; \xi, \tau) \frac{\partial u}{\partial x}(x, t)-u(x, t) \frac{\partial G}{\partial x}(x, t ; \xi, \tau)\right]_{0}^{L} d x d t\nonumber \\ &+\int_{0}^{L}\left[G(x, 0 ; \xi, \tau) u(x, 0)+2 \int_{0}^{\infty} u(x, t) G_{t}(x, t ; \xi, \tau) d t\right] d x .\label{eq:17} \end{align}\] Exchanging \((\xi, \tau)\) with \((x, t)\) and assuming that the Green’s function is symmetric in these arguments, we have \[\begin{align} u(x, t)&=\int_{0}^{\infty} \int_{0}^{L} G(x, t ; \xi, \tau) Q(\xi, \tau) d \xi d \tau\nonumber \\ &+k \int_{0}^{\infty}\left[G(x, t ; \xi, \tau) \frac{\partial u}{\partial \xi}(\xi, \tau)-u(\xi, \tau) \frac{\partial G}{\partial \xi}(x, t ; \xi, \tau)\right]_{0}^{L} d x d t\nonumber \\ &+\int_{0}^{L} G(x, t ; \xi, 0) u(\xi, 0) d \xi +2 \int_{0}^{L} \int_{0}^{\infty} u(\xi, \tau) G_{\tau}(x, t ; \xi, \tau) d \tau d \xi \label{eq:18}\end{align}\]

    This result is almost in the desired form except for the last integral. Thus, if \[\int_{0}^{L} \int_{0}^{\infty} u(\xi, \tau) G_{\tau}(x, t ; \xi, \tau) d \tau d \xi=0,\nonumber \] then we have \[\begin{align} u(x, t)=& \int_{0}^{\infty} \int_{0}^{L} G(x, t ; \xi, \tau) Q(\xi, \tau) d \xi d \tau+\int_{0}^{L} G(x, t ; \xi, 0) u(\xi, 0) d \xi\nonumber \\ &+k \int_{0}^{\infty}\left[G(x, t ; \xi, \tau) \frac{\partial u}{\partial \xi}(\xi, \tau)-u(\xi, \tau) \frac{\partial G}{\partial \xi}(x, t ; \xi, \tau)\right]_{0}^{L} d x d t .\label{eq:19} \end{align}\]


    This page titled 7.7: Green’s Function Solution of 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.

    • Was this article helpful?