$\renewcommand{\Re}{\operatorname{Re}}$ $\newcommand{\erf}{\operatorname{erf}}$ $\newcommand{\dag}{\dagger}$ $\newcommand{\const}{\mathrm{const}}$

## Separation of variables for heat equation

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.

#### Dirichlet boundary conditions

Consider problem \begin{align} & u_t= ku_{xx},&& t>0,\ 0<x<l,\label{eq-1}\\[3pt] & u|_{x=0}=u|_{x=l}=0.\label{eq-2}\\[3pt] & u|_{t=0}=g(x).\label{eq-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$, $$T'=-k\lambda T \label{eq-4}$$ (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{eq-4}) for $T$, which results in $$T_n=A_ne^{-k\lambda_n t} \label{eq-5}$$ and therefore a simple solution is $$u_n=A_ne^{-k\lambda_n t}\sin (\frac{\pi n x}{l}) \label{eq-6}$$ and we look for a general solution in the form $$u=\sum_{n=1}^\infty A_ne^{-k\lambda_n t}\sin (\frac{\pi n x}{l}). \label{eq-7}$$ Again, taking in account initial condition (\ref{eq-3}) we see that $$u=\sum_{n=1}^\infty A_n\sin (\frac{\pi n x}{l}). \label{eq-8}$$ and therefore $$A_n=\frac{2}{l}\int_0^l g(x)\sin (\frac{\pi n x}{l})\,dx. \label{eq-9}$$

#### Corollaries

1. Formula (\ref{eq-6}) shows that the problem is really ill-posed for $t<0$.
2. Formula (\ref{eq-9}) shows that as $t\to +\infty$ $$u=O(e^{-k\lambda_1 t}); \label{eq-10}$$
3. Moreover we have as $t\to +\infty$ $$u=A_1 e^{-k\lambda_1t}X_1(x)e^{-k\lambda_1 t}+ O(e^{-k\lambda_2 t}). \label{eq-11}$$

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{eq-12}\\[3pt] & u|_{x=0}=\phi,\qquad u|_{x=l}=\psi,\label{eq-13}\\[3pt] & u|_{t=0}=g(x).\label{eq-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{eq-15}\\[3pt] & v(0)=\phi,\qquad v(l)=\psi.\label{eq-16} \end{align} Then (\ref{eq-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) $$I_n(x)= \frac{1}{(n-1)!}\int_a^x (x-x')^{n-1}f(x')\,dx'\qquad n=1,2,\ldots$$ 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 $$v(x) \int_0^x G(x,x') f(x')\,dx'+\phi (1-\frac{x}{l})+\psi \frac{x}{l} \label{eq-18}$$ with 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{eq-19} Returning to the original problem we note that $u-v$ satisfies (\ref{eq-1})--(\ref{eq-3}) with $g(x)$ replaced by $g(x)-v(x)$ and therefore $u-v=O(e^{-k\lambda_1t})$. So $$u=v+O(e^{-k\lambda_1t}). \label{eq-20}$$ In other words, solution stabilizes to the stationary solution.

#### Other boundary conditions

Similar approach works in the cases of boundary conditions we considered before:

1. Dirichlet on one and and Neumann on the other $u|_{x=0}=u_x|_{x=l}=0$;
2. Neumann on both ends $u_x|_{x=0}=u_x|_{x=l}=0$;
3. Periodic $u|_{x=l}=u|_{x=0}$, $u_x|_{x=l}=u_x|_{x=0}$;
4. Dirichlet on one and and Robin on the other $u|_{x=0}=(u_x+\beta u)|_{x=l}=0$;
5. Robin on both ends $(u_x-\alpha u)|_{x=0}=(u_x+\beta u)|_{x=l}=0$

but in (d), (e) we cannot find eigenvalues explicitely (see Home Assignment 4).

#### Corollaries

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 $$u=A_1 +O(e^{-k\lambda_2 t}) \label{eq-21}$$ because in (b) an (c) $X_1(x)=1$.

Second, solution of stationary problem exists only conditionally: iff $$\frac{1}{k}\int_0^l f(x)\,dx-\phi+\psi =0 \label{eq-22}$$ in the case of Neumann b.c. on both ends $u_x|_{x=0}=\phi$, $u_x|_{x=l}=\psi$ and $$\frac{1}{k}\int_0^l f(x)\,dx =0 \label{eq-23}$$ in the case of periodic b.c.

To cover the case when (\ref{eq-22}) or (\ref{eq-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 $$p=\frac{1}{l} \int_0^l f(x)\,dx \label{eq-24}$$ and in the general case $$u = pt +A_1 +O(e^{-k\lambda_2 t}). \label{eq-25}$$