Section 6.3

Three Types of Boundary Conditions

Dirichlet (homogeneous & non-homogeneous) • Neumann • Complete case analysis for each

Overview: Why BCs Matter

In Section 6.2 we solved the heat equation with homogeneous Dirichlet boundary conditions $u(0,t)=u(L,t)=0$. But real physical problems come with many different boundary situations. On this page we tackle three important cases:

Central Theme

For every boundary-condition type, we follow the same strategy: reduce the problem to one with homogeneous Dirichlet BCs, which we already know how to solve, or adapt the three-case analysis to the new boundary conditions. The three cases $\lambda < 0$, $\lambda = 0$, $\lambda > 0$ must be checked afresh whenever the BCs change.

Case A: Non-Homogeneous Dirichlet Boundary Conditions

Problem Setup $$\begin{cases} u_t = K\,u_{xx}, \qquad 0 < x < L,\; t > 0 \\[4pt] u(0,t) = T_1,\quad u(L,t) = T_2 \\[4pt] u(x,0) = f(x) \end{cases}$$

where $T_1, T_2$ are constants (not both zero).

Why Can't We Use Separation Directly?

If we try $u(x,t) = P(x)Q(t)$, the boundary condition $u(0,t) = T_1$ becomes $P(0)Q(t) = T_1$. For this to hold at every $t$, $Q(t)$ would have to be constant — which is incompatible with the temporal ODE $Q' + K\lambda Q = 0$ (except trivially). Separation only works for homogeneous BCs.

The Decomposition Strategy

Key Idea: Split the Solution

Write the solution as the sum of a steady-state piece and a transient piece:

$$u(x,t) = V(x) + w(x,t)$$

where $V(x)$ is chosen to satisfy the non-homogeneous BCs on its own, leaving $w(x,t)$ to satisfy a problem with homogeneous BCs.

Finding the Steady-State $V(x)$

As $t \to \infty$, the transient should die out: $w \to 0$. So $u(x,t) \to V(x)$. The limiting profile satisfies the steady-state equation (no time derivative):

$$0 = K\,V''(x) \implies V''(x) = 0$$

with the non-homogeneous BCs $V(0) = T_1$, $V(L) = T_2$.

Integrating twice: $V(x) = A x + B$. Apply BCs:

Steady-State Solution $$\boxed{\;V(x) = T_1 + \frac{T_2 - T_1}{L}\,x\;}$$

This is the straight line connecting $(0, T_1)$ to $(L, T_2)$ — the temperature profile once all transient behaviour has died out.

The Transient Problem for $w$

Substitute $u = V + w$ into the PDE:

$$\underbrace{V_t}_{=0} + w_t = K(\underbrace{V_{xx}}_{=0} + w_{xx}) \implies w_t = K\,w_{xx}.$$

Check the BCs for $w$:

And the initial condition for $w$:

$$w(x,0) = u(x,0) - V(x) = f(x) - V(x).$$
Reduced Problem (Homogeneous BCs!) $$\begin{cases} w_t = K\,w_{xx} \\[4pt] w(0,t) = w(L,t) = 0 \\[4pt] w(x,0) = f(x) - V(x) \end{cases}$$

This is exactly the problem we solved in Section 6.2. The three-case analysis gives $\lambda_m = (m\pi/L)^2$ and $P_m(x) = \sin(m\pi x/L)$, and

$$w(x,t) = \sum_{m=1}^{\infty} C_m\,\sin\!\left(\frac{m\pi x}{L}\right)\,e^{-K(m\pi/L)^2 t},$$

with

$$C_m = \frac{2}{L}\int_0^L \bigl[f(x) - V(x)\bigr]\,\sin\!\left(\frac{m\pi x}{L}\right)dx.$$
Full Non-Homogeneous Dirichlet Solution $$\boxed{\;u(x,t) = \underbrace{T_1 + \frac{T_2 - T_1}{L}\,x}_{\text{steady state}} + \underbrace{\sum_{m=1}^{\infty} C_m\,\sin\!\left(\frac{m\pi x}{L}\right)\,e^{-K(m\pi/L)^2 t}}_{\text{transient (decays to 0)}}\;}$$
Example A1: $K=4$, $L=4$, $T_1=3$, $T_2=7$, $f(x)=2x+2$
Problem $$\begin{cases} u_t = 4\,u_{xx},\quad 0 < x < 4 \\[4pt] u(0,t) = 3,\quad u(4,t) = 7 \\[4pt] u(x,0) = 2x + 2 \end{cases}$$

Step 1 — Steady state.

$$V(x) = 3 + \frac{7 - 3}{4}\,x = x + 3.$$

Check: $V(0) = 3\checkmark$, $V(4) = 7\checkmark$.

Step 2 — Transient initial condition.

$$w(x,0) = f(x) - V(x) = (2x+2) - (x+3) = x - 1.$$

Exactly the Example 3 from Section 6.2.

Step 3 — Transient solution. From that example,

$$C_m = -\frac{2}{m\pi}\bigl[1 + 3(-1)^m\bigr].$$

Also $K(m\pi/L)^2 = 4(m\pi/4)^2 = (m\pi)^2/4$.

Final Answer $$u(x,t) = (x + 3) + \sum_{m=1}^{\infty} -\frac{2}{m\pi}\bigl[1 + 3(-1)^m\bigr]\,\sin\!\left(\frac{m\pi x}{4}\right)\,e^{-(m\pi)^2 t / 4}.$$

Physical check: As $t \to \infty$, the exponentials vanish and $u \to x + 3$ — the linear temperature profile matching the fixed endpoint temperatures. At $t = 0$, direct substitution recovers $u(x,0) = 2x + 2$.

Case B: Non-Homogeneous Dirichlet with Source Term

Problem Setup (PDE with Source) $$\begin{cases} u_t = K\,u_{xx} + p(x),\qquad 0 < x < L \\[4pt] u(0,t) = T_1,\quad u(L,t) = T_2 \\[4pt] u(x,0) = f(x) \end{cases}$$

where $p(x)$ is a prescribed internal source (time-independent heat generation per unit length).

Modified Steady-State Equation

Again let $u = V(x) + w(x,t)$ with $w \to 0$ as $t \to \infty$. Substituting:

$$V_t + w_t = K(V_{xx} + w_{xx}) + p(x).$$

For the steady-state part (time-independent), $V_t = 0$, so

Steady-State ODE (Modified) $$K\,V''(x) + p(x) = 0, \qquad V(0) = T_1,\; V(L) = T_2.$$

This is a two-point BVP for $V$. Solve by integrating twice and fitting the boundary data.

Residual Equation for $w$

Subtracting the steady-state equation from the full PDE leaves

$$w_t = K\,w_{xx}, \qquad w(0,t) = w(L,t) = 0, \qquad w(x,0) = f(x) - V(x).$$

Same homogeneous problem as before.

Example B1: Source $p(x) = x$, $K=4$, $T_1=3$, $T_2=7$, $L=4$
Problem $$\begin{cases} u_t = 4\,u_{xx} + x \\[4pt] u(0,t) = 3,\; u(4,t) = 7 \\[4pt] u(x,0) = -\dfrac{x^3}{24} + \dfrac{8x}{3} + 2 \end{cases}$$

Step 1 — Solve for $V(x)$. The steady-state ODE is

$$4\,V''(x) + x = 0 \implies V''(x) = -\frac{x}{4}.$$

Integrate once:

$$V'(x) = -\frac{x^2}{8} + A.$$

Integrate again:

$$V(x) = -\frac{x^3}{24} + A x + B.$$

Apply $V(0) = 3$: $B = 3$. Apply $V(4) = 7$:

$$-\frac{64}{24} + 4A + 3 = 7 \implies -\frac{8}{3} + 4A = 4 \implies 4A = \frac{20}{3} \implies A = \frac{5}{3}.$$ $$\boxed{\;V(x) = -\frac{x^3}{24} + \frac{5x}{3} + 3\;}$$

Step 2 — Transient IC.

$$w(x,0) = \left(-\frac{x^3}{24} + \frac{8x}{3} + 2\right) - \left(-\frac{x^3}{24} + \frac{5x}{3} + 3\right) = x - 1.$$

Again the $x - 1$ profile from Example 3 of Section 6.2.

Step 3 — Transient solution. Same $C_m$ as before:

$$C_m = -\frac{2}{m\pi}\bigl[1 + 3(-1)^m\bigr], \qquad K(m\pi/L)^2 = (m\pi)^2/4.$$
Final Answer $$u(x,t) = -\frac{x^3}{24} + \frac{5x}{3} + 3 + \sum_{m=1}^{\infty} -\frac{2}{m\pi}\bigl[1 + 3(-1)^m\bigr]\,\sin\!\left(\frac{m\pi x}{4}\right)\,e^{-(m\pi)^2 t/4}.$$
Example B2: $K=1/6$, $L=1$, source $p(x)=x$, $T_1=1$, $T_2=2$
Problem $$\begin{cases} u_t = \tfrac{1}{6}\,u_{xx} + x \\[4pt] u(0,t) = 1,\quad u(1,t) = 2 \\[4pt] u(x,0) = 1 - x^3 \end{cases}$$

Step 1 — Solve for $V$. $\tfrac{1}{6}V''(x) + x = 0 \implies V''(x) = -6x$.

Integrate: $V'(x) = -3x^2 + A$. Integrate again: $V(x) = -x^3 + Ax + B$.

$V(0) = 1 \implies B = 1$. $V(1) = -1 + A + 1 = 2 \implies A = 2$.

$$V(x) = -x^3 + 2x + 1.$$

Step 2 — Transient IC.

$$w(x,0) = (1 - x^3) - (-x^3 + 2x + 1) = -2x.$$

Step 3 — Compute $C_m$. With $L = 1$:

$$C_m = \frac{2}{1}\int_0^1 (-2x)\sin(m\pi x)\,dx = -4\int_0^1 x\sin(m\pi x)\,dx.$$

By parts ($u = x$, $dv = \sin(m\pi x)dx$):

$$\int_0^1 x\sin(m\pi x)\,dx = \left[-\frac{x\cos(m\pi x)}{m\pi}\right]_0^1 + \frac{1}{m\pi}\int_0^1 \cos(m\pi x)\,dx = -\frac{(-1)^m}{m\pi} + 0.$$

Therefore $C_m = -4\cdot\dfrac{-(-1)^m}{m\pi} = \dfrac{4(-1)^m}{m\pi}$.

Final Answer $$u(x,t) = (-x^3 + 2x + 1) + \sum_{m=1}^{\infty}\frac{4(-1)^m}{m\pi}\,\sin(m\pi x)\,e^{-m^2\pi^2 t/6}.$$

Case C: Neumann Boundary Conditions (Insulated Ends)

Problem Setup (Neumann) $$\begin{cases} u_t = K\,u_{xx},\qquad 0 < x < L,\; t > 0 \\[4pt] u_x(0,t) = 0,\quad u_x(L,t) = 0 \\[4pt] u(x,0) = f(x) \end{cases}$$

Both ends are insulated: no heat flux in or out.

Separation and Inherited BCs

Same start as before: $u = P(x)Q(t)$ gives the same two ODEs. The difference is in the spatial boundary conditions. Since $u_x = P'(x)Q(t)$,

$$u_x(0,t) = P'(0)\,Q(t) = 0 \implies P'(0) = 0,$$ $$u_x(L,t) = P'(L)\,Q(t) = 0 \implies P'(L) = 0.$$

So now the spatial BVP is

$$P''(x) + \lambda P(x) = 0, \qquad P'(0) = P'(L) = 0.$$

Three-Case Analysis — Watch Case II!

We repeat the three-case analysis, but with derivative boundary conditions. The outcome for $\lambda = 0$ changes dramatically.

Case I: $\lambda < 0$, let $\lambda = -\alpha^2$ ($\alpha > 0$)

General solution: $P(x) = A\cosh(\alpha x) + B\sinh(\alpha x)$.

Derivative: $P'(x) = A\alpha\sinh(\alpha x) + B\alpha\cosh(\alpha x)$.

Apply $P'(0) = 0$: $P'(0) = A\alpha\cdot 0 + B\alpha\cdot 1 = B\alpha$. Since $\alpha \neq 0$, we get $B = 0$.

Apply $P'(L) = 0$: $P'(L) = A\alpha\sinh(\alpha L)$. Since $\alpha > 0$ and $\sinh(\alpha L) > 0$, we need $A = 0$.

Case I gives only the trivial solution.
Case II: $\lambda = 0$ — NOW NON-TRIVIAL!

General solution: $P(x) = C_1 x + C_2$.

Derivative: $P'(x) = C_1$.

Apply $P'(0) = 0$: $C_1 = 0$.

Apply $P'(L) = 0$: $C_1 = 0$ — already satisfied, no new constraint.

So $P(x) = C_2$ — any non-zero constant is a valid eigenfunction. We conventionally set the zeroth eigenvalue and eigenfunction as

$$\boxed{\;\lambda_0 = 0, \qquad P_0(x) = 1.\;}$$

The corresponding temporal ODE $Q_0' + K\cdot 0\cdot Q_0 = 0$ gives $Q_0 = $ constant. The $m = 0$ mode is a steady, non-decaying average.

New result: With Neumann BCs, Case II ($\lambda = 0$) yields a non-trivial constant eigenfunction. This is the DC component of the solution.
Case III: $\lambda > 0$, let $\lambda = \alpha^2$ ($\alpha > 0$)

General solution: $P(x) = A\cos(\alpha x) + B\sin(\alpha x)$.

Derivative: $P'(x) = -A\alpha\sin(\alpha x) + B\alpha\cos(\alpha x)$.

Apply $P'(0) = 0$: $P'(0) = 0 + B\alpha = B\alpha$. Since $\alpha \neq 0$, we get $B = 0$.

So $P(x) = A\cos(\alpha x)$ and $P'(x) = -A\alpha\sin(\alpha x)$.

Apply $P'(L) = 0$: $-A\alpha\sin(\alpha L) = 0$. Non-triviality demands $A \neq 0$, so

$$\sin(\alpha L) = 0 \implies \alpha L = m\pi \implies \alpha_m = \frac{m\pi}{L}, \quad m = 1, 2, 3, \ldots$$

Eigenvalues and eigenfunctions:

$$\boxed{\;\lambda_m = \left(\frac{m\pi}{L}\right)^2, \qquad P_m(x) = \cos\!\left(\frac{m\pi x}{L}\right),\; m = 1, 2, 3, \ldots\;}$$
Complete Neumann Spectrum

Combining both non-trivial cases:

  • $m = 0$: $\lambda_0 = 0$, $P_0 = 1$ (constant mode, does not decay)
  • $m = 1, 2, 3, \ldots$: $\lambda_m = (m\pi/L)^2$, $P_m = \cos(m\pi x/L)$ (decaying cosine modes)

General Solution with Neumann BCs

General Solution — Neumann (Insulated) Heat Equation $$\boxed{\;u(x,t) = \frac{C_0}{2} + \sum_{m=1}^{\infty} C_m\,\cos\!\left(\frac{m\pi x}{L}\right)\,e^{-K(m\pi/L)^2 t}\;}$$

(The factor of $1/2$ on $C_0$ is the standard convention of the Fourier cosine series.)

The coefficients come from the Fourier cosine series of $f(x)$:

$$C_m = \frac{2}{L}\int_0^L f(x)\,\cos\!\left(\frac{m\pi x}{L}\right)dx, \qquad m = 0, 1, 2, \ldots$$
Physical Interpretation

The $m = 0$ term $C_0/2 = \dfrac{1}{L}\int_0^L f(x)\,dx$ is the spatial average of the initial temperature. Since no heat escapes through the insulated ends, this average is conserved forever. All the higher modes decay, but the average persists. As $t \to \infty$, the temperature approaches the initial average everywhere.

Example C1: Neumann, $K=2$, $L=\pi$, $f(x) = 5 + 3\cos(2x)$
Problem $$\begin{cases} u_t = 2\,u_{xx},\quad 0 < x < \pi \\[4pt] u_x(0,t) = u_x(\pi,t) = 0 \\[4pt] u(x,0) = 5 + 3\cos(2x) \end{cases}$$

General solution: With $L = \pi$, the cosine modes are $\cos(mx)$:

$$u(x,t) = \frac{C_0}{2} + \sum_{m=1}^{\infty} C_m\,\cos(mx)\,e^{-2 m^2 t}.$$

Apply IC by comparison.

$$\frac{C_0}{2} + \sum_{m=1}^{\infty} C_m\,\cos(mx) = 5 + 3\cos(2x).$$

Matching: $C_0/2 = 5 \Rightarrow C_0 = 10$, $C_2 = 3$, all others zero.

Final Answer $$u(x,t) = 5 + 3\,e^{-8t}\,\cos(2x).$$

Physical check: As $t \to \infty$, $u \to 5$ — the spatial average of the initial data, conserved because of the insulated boundary.

Example C2: Neumann with general IC $f(x) = x$, $K=1$, $L=\pi$
Problem $$\begin{cases} u_t = u_{xx},\; 0 < x < \pi \\[4pt] u_x(0,t) = u_x(\pi,t) = 0 \\[4pt] u(x,0) = x \end{cases}$$

Compute $C_0$ (the average):

$$C_0 = \frac{2}{\pi}\int_0^\pi x\,dx = \frac{2}{\pi}\cdot\frac{\pi^2}{2} = \pi.$$

So the constant term is $C_0/2 = \pi/2$ — precisely the average of $x$ on $[0,\pi]$.

Compute $C_m$ for $m \geq 1$:

$$C_m = \frac{2}{\pi}\int_0^\pi x\,\cos(mx)\,dx.$$

Integration by parts ($u = x$, $dv = \cos(mx)dx$):

$$\int_0^\pi x\,\cos(mx)\,dx = \left[\frac{x\sin(mx)}{m}\right]_0^\pi - \frac{1}{m}\int_0^\pi \sin(mx)\,dx = 0 - \frac{1}{m}\left[-\frac{\cos(mx)}{m}\right]_0^\pi.$$ $$= \frac{1}{m^2}\bigl[\cos(m\pi) - 1\bigr] = \frac{(-1)^m - 1}{m^2}.$$

For even $m$: $(-1)^m = 1$, so $C_m = 0$. For odd $m$: $(-1)^m - 1 = -2$, so $C_m = \dfrac{2}{\pi}\cdot\dfrac{-2}{m^2} = -\dfrac{4}{\pi m^2}$.

Final Answer $$u(x,t) = \frac{\pi}{2} - \frac{4}{\pi}\sum_{\substack{m=1\\m\,\text{odd}}}^{\infty}\frac{1}{m^2}\,\cos(mx)\,e^{-m^2 t}.$$

As $t \to \infty$, all cosine terms die and $u \to \pi/2$ — the average of the initial linear temperature.

Summary: How the Three Cases Play Out for Each BC Type

BCs$\lambda < 0$$\lambda = 0$$\lambda > 0$Eigenfunctions
Dirichlet
$P(0)=P(L)=0$
Trivial Trivial $\alpha = m\pi/L$ $\sin(m\pi x/L)$, $m\geq 1$
Neumann
$P'(0)=P'(L)=0$
Trivial Constant! $\alpha = m\pi/L$ $1$ and $\cos(m\pi x/L)$, $m\geq 1$
Mixed
$P(0)=0,\,P'(L)=0$
Trivial Trivial $\alpha = (2m-1)\pi/(2L)$ $\sin((2m-1)\pi x/(2L))$, $m\geq 1$
How to Remember

Value-type BCs ($P=0$) select sines — sines vanish at $x=0$.

Derivative-type BCs ($P'=0$) select cosines — cosines have zero slope at $x=0$.

Mixing the two (value at one end, derivative at the other) gives half-integer modes.