← Back

The Heat Equation with Non-Homogenous Boundary Conditions

\[ u_t = \alpha^2 u_{xx} \]

The PDE is the same as before, but now we consider non-homogenous Dirichlet boundary conditions. That is, boundary conditions may be nonzero constants or functions of time. For simplicity, we take a one-dimensional rod of length 1.

Examples:

\[ u(t,0)=5,\;\; u(t,1)=2 \]
\[ u(t,0)=3t,\;\; u(t,1)=t^2 \]

We assume the solution splits into steady-state and transient parts:

\[ u(x,t) = S(x,t) + U(x,t), \]

where \(S(x,t)\) satisfies the boundary conditions (“homogenizer”), and \(U(x,t)\) is the transient part.

Constant (Non-Zero) Boundary Conditions

Suppose \(u(0,t)=C_1\), \(u(1,t)=C_2\). As \(t\to\infty\), the rod tends to a linear steady state between \(C_1\) and \(C_2\).

For example, with \(u(0,t)=1\), \(u(1,t)=5\), choose

\[ S(x,t) = A x + B. \]

Enforcing boundary values:

\[ S(0,t)=B=1 \implies B=1, \]
\[ S(1,t)=A+1=5 \implies A=4. \]

So \(S(x,t)=4x+1\). Substituting \(u=S+U\) into the PDE:

\[ u_t = S_t + U_t,\qquad u_{xx}=S_{xx}+U_{xx}. \]

Since \(S_t=0,\; S_{xx}=0\), we obtain

\[ U_t = \alpha^2 U_{xx}. \]

The boundary conditions for \(U\) become homogeneous:

\[ U(0,t)=0,\qquad U(1,t)=0. \]

Thus \(U\) satisfies the standard heat equation with homogeneous BCs. Its solution is

\[ U(x,t)=\sum_{n=1}^\infty A_n e^{-(n\pi\alpha)^2 t}\sin(n\pi x), \]
\[ A_n=2\int_0^1 \phi(x)\sin(n\pi x)\,dx, \]

where \(\phi(x)\) is the initial condition.

Therefore the full solution is

\[ u(x,t)=4x+1+\sum_{n=1}^\infty A_n e^{-(n\pi\alpha)^2 t}\sin(n\pi x). \]

Time-Varying Boundary Conditions

For time-dependent BCs, use a linear-in-\(x\) interpolant:

\[ S(x,t) = A(t)\Big(1-\frac{x}{L}\Big) + B(t)\frac{x}{L},\quad L=1. \]

Example: \(u(t,0)=3t,\; u(t,1)=1/t.\) Then

\[ S(0,t)=A(t)=3t,\qquad S(1,t)=B(t)=\tfrac{1}{t}. \]

So

\[ S(x,t)=3t(1-x)+\frac{x}{t}. \]

Substitute into the PDE. With \(u=S+U\):

\[ u_t=S_t+U_t,\qquad u_{xx}=S_{xx}+U_{xx}. \]

Since \(S_{xx}=0,\; S_t=3-3x-\tfrac{1}{t^2}x\) (for this particular example), the PDE becomes

\[ U_t = \alpha^2 U_{xx} + \bigl(3-3x-\tfrac{x}{t^2}\bigr). \]

Thus \(U\) has homogeneous boundary conditions but satisfies a non-homogenous heat equation. This cannot be solved by simple separation of variables; instead, one uses eigenfunction expansion (covered in the next section).