$\renewcommand{\Re}{\operatorname{Re}}$ $\newcommand{\erf}{\operatorname{erf}}$ $\newcommand{\dag}{\dagger}$ $\newcommand{\const}{\mathrm{const}}$
In the previous Lecture 17 and Lecture 18 we introduced Fourier transform and Inverse Fourier transform and established some of its properties; we also calculated some Fourier transforms. Now we going to apply to PDEs.
Consider problem \begin{align} & u_t= ku_{xx},&& t>0,\ 0<x<l,\label{equ-20.1}\\[3pt] & u|_{x=0}=u|_{x=l}=0.\label{equ-20.2}\\[3pt] & u|_{t=0}=g(x). \label{equ-20.3} \end{align} Let us consider a simple solution $u(x,t)=X(x)T(t)$; then separating variables we arrive to $\frac{T'}{T}=k\frac{X''}{X}$ which implies $X''+\lambda X=0$, \begin{equation} T'=-k\lambda T \label{equ-20.4} \end{equation} (explain, how). We also get boundary conditions $X(0)=X(l)=0$ (explain, how).
So, we have eigenvalues $\lambda_n=(\frac{\pi n}{l})^2$ and eigenfunctions $X_n=\sin (\frac{\pi n x}{l})$ ($n=1,2,\ldots$) and equation (\ref{equ-20.4}) for $T$, which results in \begin{equation} T_n=A_ne^{-k\lambda_n t} \label{equ-20.5} \end{equation} and therefore a simple solution is \begin{equation} u_n=A_ne^{-k\lambda_n t}\sin (\frac{\pi n x}{l}) \label{equ-20.6} \end{equation} and we look for a general solution in the form \begin{equation} u=\sum_{n=1}^\infty A_ne^{-k\lambda_n t}\sin (\frac{\pi n x}{l}). \label{equ-20.7} \end{equation} Again, taking in account initial condition (\ref{equ-20.3}) we see that \begin{equation} u=\sum_{n=1}^\infty A_n\sin (\frac{\pi n x}{l}). \label{equ-20.8} \end{equation} and therefore \begin{equation} A_n=\frac{2}{l}\int_0^l g(x)\sin (\frac{\pi n x}{l})\,dx. \label{equ-20.9} \end{equation}
Consider now inhomogeneous problem with the right-hand expression and boundary conditions independent on $t$: \begin{align} & u_t= ku_{xx}+f(x),&& t>0,\ 0<x<l,\label{equ-20.12}\\[3pt] & u|_{x=0}=\phi,\qquad u|_{x=l}=\psi,\label{equ-20.13}\\[3pt] & u|_{t=0}=g(x).\label{equ-20.14} \end{align} Let us discard initial condition and find a stationary solution $u=v(x)$: \begin{align} & v''=-\frac{1}{k}f(x),&& 0<x<l,\label{equ-20.15}\\[3pt] & v(0)=\phi,\qquad v(l)=\psi.\label{equ-20.16} \end{align} Then (\ref{equ-20.15}) implies \begin{equation*} v(x)=-\frac{1}{k}\int_0^x\int_0^{x'} f(x'')\,dx''dx'+A+Bx= \int_0^x (x-x')f(x')\,dx'+A+Bx \end{equation*} where we used formula of $n$-th integral (you must know it from the 1st year calculus) \begin{equation} I_n(x)= \frac{1}{(n-1)!}\int_a^x (x-x')^{n-1}f(x')\,dx'\qquad n=1,2,\ldots \end{equation} for $I_n:=\int_a^x I_{n-1}(x')\,dx'$, $I_0(x):=f(x)$.
Then satisfying b.c. $A=\phi$ and $B=\frac{1}{l}(\psi-\phi+\frac{1}{k}\int_0^l (l-x') f(x')\,dx')$ and \begin{equation} v(x) =\int_0^x G(x,x') f(x')\,dx'+\phi (1-\frac{x}{l})+\psi \frac{x}{l} \label{equ-20.18} \end{equation} with \begin{equation} G(x,x') =\frac{1}{k}\left\{ \begin{aligned} & x'(1-\frac{x}{l})&& 0<x'<x,\\[3pt] & x(1-\frac{x'}{l}) && x<x'<l. \end{aligned}\right. \label{equ-20.19} \end{equation} Returning to the original problem we note that $u-v$ satisfies (\ref{equ-20.1})--(\ref{equ-20.3}) with $g(x)$ replaced by $g(x)-v(x)$ and therefore $u-v=O(e^{-k\lambda_1t})$. So \begin{equation} u=v+O(e^{-k\lambda_1t}). \label{equ-20.20} \end{equation} In other words, solution stabilizes to the stationary solution.
Similar approach works in the cases of boundary conditions we considered before:
but in (d), (e) we cannot find eigenvalues explicitely (see Home Assignment 4).
All corollaries remain valid as long as $\lambda_1>0$ which happens in cases (a), (d) with $\beta\ge 0$, (e) with $\alpha \ge 0,\beta\ge 0$ except $\alpha=\beta=0$.
Let us consider what happens when $\lambda_1=0$ (cases (b) and (c)).
First, solution of the problem with r.h.e. and b.c. equal to $0$ does not decay as $t\to +\infty$, instead \begin{equation} u=A_1 +O(e^{-k\lambda_2 t}) \label{equ-20.21} \end{equation} because in (b) and (c) $X_1(x)=1$.
Second, solution of stationary problem exists only conditionally: iff \begin{equation} \frac{1}{k}\int_0^l f(x)\,dx-\phi+\psi =0 \label{equ-20.22} \end{equation} in the case of Neumann b.c. on both ends $u_x|_{x=0}=\phi$, $u_x|_{x=l}=\psi$ and \begin{equation} \frac{1}{k}\int_0^l f(x)\,dx =0 \label{equ-20.23} \end{equation} in the case of periodic b.c.
To cover the case when (\ref{equ-20.22}) or (\ref{equ-20.23}) fails (i.e. total heat flow is not $0$ so there is no balance) it is sufficient to consider the case $f=p$, $\phi=\psi=0$; then $u=pt$ with \begin{equation} p=\frac{1}{l} \int_0^l f(x)\,dx \label{equ-20.24} \end{equation} and in the general case \begin{equation} u = pt +A_1 +O(e^{-k\lambda_2 t}). \label{equ-20.25} \end{equation}