Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Shift a nonhomogeneous boundary value problem to a homogeneous one

Use when: the heat equation's boundary values are fixed constants that aren't both zero, such as u(0,t)=T_1, u(L,t)=T_2

Goal: a complete u(x,t), built from a linear reference profile plus the usual zero-boundary sine series

Taught in Nonhomogeneous boundary data: shifting to homogeneous

  1. 1

    Look at the right side of each boundary condition. Only a right side of exactly 0 lets separation apply directly.

    • both boundary values are 0 — separate directly, no shift needed.
    • at least one boundary value is a nonzero constant — a reference solution has to be subtracted off first.

    Why: a nonzero constant on the boundary can never be written as X(0)T(t) for every t. Separation fails structurally here, not just computationally.

  2. 2

    Solve \psi''=0 subject to the two given boundary values; \psi(x)=A+Bx, with A,B fixed by matching each endpoint.

    Example

    For \psi(0)=20, \psi(4)=8: A=20 and B=(8-20)/4=-3, so \psi(x)=20-3x.

    Why: \psi is the one piece of the problem, depending on x alone, that can carry the mismatched boundary values. It isn't required to vanish there.

  3. 3

    Write v_t=kv_{xx}, v(0,t)=0, v(L,t)=0, v(x,0)=f(x)-\psi(x). Here \psi_{xx}=0 cancels \psi from the PDE, and matching endpoints cancels it from the boundary data.

    Example

    With f(x)=20 and \psi(x)=20-3x: v(x,0)=20-(20-3x)=3x, already zero at both ends.

    Why: subtracting a function that already carries the nonzero data leaves exactly the zero-boundary problem the earlier sine-series method already solves.

  4. 4

    Apply the earlier Dirichlet heat equation recipe to v. Use f-\psi as the initial data, to get its coefficients b_n and v(x,t).

    Example

    b_n=\frac24\int_0^4 3x\sin(n\pi x/4)\,dx=\frac{24(-1)^{n+1}}{n\pi}, so b_1\approx7.639, b_2\approx-3.820, b_3\approx2.546.

    Why: v's problem is literally the earlier Dirichlet case, with a different initial function. So the same machinery applies unmodified.

  5. 5

    Set u(x,t)=\psi(x)+v(x,t). Then check that as t\to\infty the series decays and u approaches \psi(x), not zero.

    Example

    u(x,t)=(20-3x)+\sum_{n=1}^\infty\frac{24(-1)^{n+1}}{n\pi}\sin\!\left(\frac{n\pi x}4\right)e^{-0.5(n\pi/4)^2t}; as t\to\infty, u(x,t)\to20-3x.

    Why: \psi was only subtracted temporarily, to make the problem separable. The physical solution needs it added back, to recover the actual steady state.

Common mistakes

  • Trying to separate u=X(x)T(t) directly when a boundary value is a nonzero constant, instead of shifting first.
  • Computing the sine coefficients from the original f(x) instead of from f(x)-\psi(x).
  • Assuming the rod settles to zero as t\to\infty, instead of to \psi(x).
  • Swapping which endpoint's value goes into A versus B when building \psi(x)=A+Bx.