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)}}\;}$$

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.

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.

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.

Worked Examples

The examples below work through one problem of each type discussed above: non-homogeneous Dirichlet (A), non-homogeneous Dirichlet with an internal source (B), and Neumann / insulated ends (C). Click a header to expand the full solution.

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$.

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}.$$
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.

📝 Exam-Style Practice Problems

These are the boundary-condition problems most likely to appear on an exam. Each statement below gives the PDE, both boundary conditions and the initial condition — check that yours does too before you start solving. Click a problem to reveal the step-by-step solution.

Practice 1 (non-homogeneous Dirichlet): $u_t = 2u_{xx}$, $u(0,t)=10$, $u(3,t)=4$
Problem $$\begin{cases} u_t = 2\,u_{xx}, \quad 0 < x < 3,\; t > 0 \\[4pt] u(0,t) = 10,\quad u(3,t) = 4 \\[4pt] u(x,0) = 10 - 2x + 5\sin(\pi x)\end{cases}$$

Solution

Step 1: Find the steady state. $V'' = 0$ with $V(0) = 10$, $V(3) = 4$:

$$V(x) = T_1 + \frac{T_2 - T_1}{L}x = 10 + \frac{4-10}{3}x = 10 - 2x.$$

Check: $V(0) = 10$ ✓, $V(3) = 10 - 6 = 4$ ✓.

Step 2: Subtract it off to get the transient problem.

$$w(x,0) = u(x,0) - V(x) = \bigl(10 - 2x + 5\sin(\pi x)\bigr) - (10 - 2x) = 5\sin(\pi x),$$ $$w_t = 2w_{xx}, \qquad w(0,t) = w(3,t) = 0.$$

Step 3: Solve the transient problem by comparison. With $L = 3$ the eigenfunctions are $\sin(m\pi x/3)$. Matching $\dfrac{m\pi}{3} = \pi$ gives $m = 3$, so $C_3 = 5$ and every other $C_m = 0$. The decay rate is

$$K\left(\frac{3\pi}{3}\right)^2 = 2\pi^2.$$

Step 4: Recombine $u = V + w$.

$$\boxed{u(x,t) = 10 - 2x + 5\,e^{-2\pi^2 t}\sin(\pi x)}$$
Checks: $u(0,t) = 10$ and $u(3,t) = 4$ because $\sin(0) = \sin(3\pi) = 0$ ✓. At $t = 0$ we recover the initial data ✓. As $t \to \infty$, $u \to 10 - 2x$, the linear steady state ✓.
Practice 2 (Neumann): $u_t = 3u_{xx}$ on $0<x<2$, insulated ends, $f(x)=x$
Problem $$\begin{cases} u_t = 3\,u_{xx}, \quad 0 < x < 2,\; t > 0 \\[4pt] u_x(0,t) = 0,\quad u_x(2,t) = 0 \\[4pt] u(x,0) = x\end{cases}$$

Solution

Do not drop $\lambda = 0$! With Neumann BCs the case $\lambda = 0$ gives the non-trivial constant eigenfunction $P_0 = 1$. Forgetting it loses the entire steady average of the solution.

Step 1: General solution. $K = 3$, $L = 2$:

$$u(x,t) = \frac{C_0}{2} + \sum_{m=1}^{\infty} C_m\cos\!\left(\frac{m\pi x}{2}\right)e^{-3(m\pi/2)^2 t} = \frac{C_0}{2} + \sum_{m=1}^{\infty} C_m\cos\!\left(\frac{m\pi x}{2}\right)e^{-3m^2\pi^2 t/4}.$$

Step 2: The $m = 0$ coefficient (twice the average).

$$C_0 = \frac{2}{2}\int_0^2 x\,dx = \left[\frac{x^2}{2}\right]_0^2 = 2 \quad\Longrightarrow\quad \frac{C_0}{2} = 1.$$

Step 3: The cosine coefficients for $m \geq 1$.

$$C_m = \frac{2}{2}\int_0^2 x\cos\!\left(\frac{m\pi x}{2}\right)dx.$$

By parts with $u = x$, $dv = \cos(m\pi x/2)dx$, $v = \dfrac{2}{m\pi}\sin(m\pi x/2)$:

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

So $C_m = 0$ for even $m$, and $C_m = -\dfrac{8}{m^2\pi^2}$ for odd $m$.

Step 4: Assemble.

$$\boxed{u(x,t) = 1 - \frac{8}{\pi^2}\sum_{\substack{m=1\\ m\ \text{odd}}}^{\infty}\frac{1}{m^2}\cos\!\left(\frac{m\pi x}{2}\right)e^{-3m^2\pi^2 t/4}}$$
Physical check: As $t \to \infty$, $u \to 1$, which is exactly the average of $f(x) = x$ over $[0,2]$. No heat escapes through insulated ends, so the average temperature is conserved forever.
Practice 3 (mixed BCs): $u_t = u_{xx}$, $u(0,t)=0$, $u_x(1,t)=0$, $f(x)=3\sin(\pi x/2)$
Problem $$\begin{cases} u_t = u_{xx}, \quad 0 < x < 1,\; t > 0 \\[4pt] u(0,t) = 0 \quad\text{(fixed end)},\qquad u_x(1,t) = 0 \quad\text{(insulated end)} \\[4pt] u(x,0) = 3\sin\!\left(\dfrac{\pi x}{2}\right)\end{cases}$$

Solution

Step 1: Inherit the spatial BCs. With $u = P(x)Q(t)$, $u(0,t) = P(0)Q(t) = 0 \Rightarrow P(0) = 0$, and $u_x(1,t) = P'(1)Q(t) = 0 \Rightarrow P'(1) = 0$. The BVP is

$$P'' + \lambda P = 0, \qquad P(0) = 0,\; P'(1) = 0.$$

Step 2: Three-case analysis.

Case $\lambda < 0$ ($\lambda = -\alpha^2$): $P = A\cosh\alpha x + B\sinh\alpha x$; $P(0) = A = 0$, then $P'(1) = B\alpha\cosh\alpha = 0$ forces $B = 0$ since $\cosh\alpha \geq 1$. Trivial.

Case $\lambda = 0$: $P = C_1x + C_2$; $P(0) = C_2 = 0$ and $P'(1) = C_1 = 0$. Trivial.

Case $\lambda = \alpha^2 > 0$: $P = A\cos\alpha x + B\sin\alpha x$; $P(0) = A = 0$, so $P = B\sin\alpha x$ and $P'(1) = B\alpha\cos\alpha = 0$. Non-triviality requires $\cos\alpha = 0$, i.e.

$$\alpha_m = \frac{(2m-1)\pi}{2}, \qquad \lambda_m = \left[\frac{(2m-1)\pi}{2}\right]^2, \qquad P_m(x) = \sin\!\left(\frac{(2m-1)\pi x}{2}\right),\quad m \geq 1.$$

Step 3: General solution and comparison.

$$u(x,t) = \sum_{m=1}^{\infty} C_m \sin\!\left(\frac{(2m-1)\pi x}{2}\right)e^{-\left[(2m-1)\pi/2\right]^2 t}.$$

The initial condition $3\sin(\pi x/2)$ is exactly the $m = 1$ eigenfunction, so $C_1 = 3$ and all other $C_m = 0$, with $\lambda_1 = \pi^2/4$.

Final Solution:

$$\boxed{u(x,t) = 3\,e^{-\pi^2 t/4}\sin\!\left(\frac{\pi x}{2}\right)}$$
Checks: $u(0,t) = 0$ ✓. $u_x(x,t) = \tfrac{3\pi}{2}e^{-\pi^2t/4}\cos(\pi x/2)$, and $\cos(\pi/2) = 0$, so $u_x(1,t) = 0$ ✓. Also $u_t = -\tfrac{\pi^2}{4}u = u_{xx}$ ✓. Mixed BCs give half-integer modes — a quarter wavelength fits in $[0,L]$.

Practice Problems

Test your understanding with these multiple-choice questions. Click a choice to see if you're correct.

Q1: For $u_t = Ku_{xx}$ with $u(0,t) = T_1$ and $u(L,t) = T_2$, which problem does the steady state $V(x)$ solve?

Q2: With Neumann BCs $P'(0) = P'(L) = 0$, what happens in the case $\lambda = 0$?

Q3: Let $u_t = 3u_{xx}$ on $0 < x < 2$ with $u_x(0,t) = u_x(2,t) = 0$ and $u(x,0) = x$. What is $\displaystyle\lim_{t\to\infty} u(x,t)$?

Q4: For $u_t = 2u_{xx} + 4$ with $u(0,t) = u(1,t) = 0$, what is the steady state $V(x)$?

Q5: For the mixed BCs $P(0) = 0$, $P'(L) = 0$, what are the eigenvalues?

Q6: Why must non-homogeneous boundary conditions be removed before separating variables?