6.1. Separation of variables for heat equation

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

# Chapter 6. Separation of variables

In this Chapter we continue study separation of variables which we started in Chapter 4 but interrupted to explore Fourier series and Fourier transform.

## 6.1. Separation of variables for heat equation

### Dirichlet boundary conditions

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

### Corollaries

1. Formula (\ref{eq-6.1.6}) shows that the problem is really ill-posed for $t<0$.
2. Formula (\ref{eq-6.1.7}) shows that as $t\to +\infty$ $$u=O(e^{-k\lambda_1 t}); \label{eq-6.1.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-6.1.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-6.1.12}\\[3pt] & u|_{x=0}=\phi,\qquad u|_{x=l}=\psi,\label{eq-6.1.13}\\[3pt] & u|_{t=0}=g(x).\label{eq-6.1.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-6.1.15}\\[3pt] & v(0)=\phi,\qquad v(l)=\psi.\label{eq-6.1.16} \end{align} Then (\ref{eq-6.1.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 Calculus I) $$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-6.1.18}$$ with Green's function 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-6.1.19} Returning to the original problem we note that $u-v$ satisfies (\ref{eq-6.1.1})--(\ref{eq-6.1.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-6.1.20}$$ In other words, solution stabilizes to the stationary solution. For more detailed analysis of BVP for ODEs see Section 6.A.

### Other boundary conditions

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

a. Dirichlet on one end and and Neumann on the other end $u|_{x=0}=u_x|_{x=l}=0$; b. Neumann on both ends $u_x|_{x=0}=u_x|_{x=l}=0$; c. Periodic $u|_{x=l}=u|_{x=0}$, $u_x|_{x=l}=u_x|_{x=0}$; d. Dirichlet on one end and and Robin on the other end $u|_{x=0}=(u_x+\beta u)|_{x=l}=0$; e. Robin on both ends $(u_x-\alpha u)|_{x=0}=(u_x+\beta u)|_{x=l}=0$

but in (4), (5) we cannot find eigenvalues explicitly.

### 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-6.1.21}$$ because in (b) and (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-6.1.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-6.1.23}$$ in the case of periodic boundary conditions.

To cover the case when (\ref{eq-6.1.22}) or (\ref{eq-6.1.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-6.1.24}$$ and in the general case $$u = pt +A_1 +O(e^{-k\lambda_2 t}). \label{eq-6.1.25}$$