= Solution
The transformed endpoint values are $u(0,t)=0$ and $u(\pi,t)=3$. Apply <boundary lifting> with $u=3x/\pi+w$. The lifted profile is linear, so $w_t=w_{xx}$ with homogeneous <Dirichlet boundary conditions> and
$$
w(x,0)=\frac{\sin2x}{\pi}.
$$
For <separation of variables>, put $w=X(x)T(t)$. Then $X''/X=T'/T=-\lambda$. The endpoint conditions give nonzero spatial modes only for $\lambda=n^2$, $n=1,2,\ldots$, with $X_n=\sin nx$ and $T_n=e^{-n^2t}$. Hence
$$
w(x,t)=\sum_{n=1}^{\infty}b_ne^{-n^2t}\sin nx,\qquad
b_n=\frac2\pi\int_0^\pi\frac{\sin2x}{\pi}\sin nx\,dx=\frac{\delta_{n2}}\pi,
$$
by <orthogonality> of the sine modes. Only the $n=2$ mode is present. Undoing both substitutions gives
$$
\boxed{v(x,t)=\frac{(t+1)^2}{\pi}\left(3x+e^{-4t}\sin2x\right).}
$$
At $t=0$ this has the prescribed initial profile, and at $x=\pi$ it is $3(t+1)^2$. Differentiating also verifies the original evolution equation directly.
Back to article page