%%%%		-*- Mode: LaTeX -*-
%%%% Author:    J. Robert Buchanan
%%%% Address:   Department of Mathematics
%%%%		Millersville University
%%%%            P.O. Box 1002
%%%%            Millersville, PA 17551-0302
%%%% Phone:     717-871-7305
%%%% FAX:	717-871-7948
%%%% Email:     Robert.Buchanan@millersville.edu
%%%%
%%%% Date:      06/30/2022
%%%%
%%%% Purpose:   Separation of Variables
%%%%

\documentclass[10pt]{beamer}

\mode<presentation>
{
  %\usetheme{Warsaw}
  \usetheme{default}
  %\usetheme{CambridgeUS}
  % or ...

  %\setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}


\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.


\title{Separation of Variables}
\subtitle{MATH 467 \textit{Partial Differential Equations}} % (optional)


\author % (optional, use only with lots of authors)
{J~Robert~Buchanan}
% - Use the \inst{?} command only if the authors have different
%   affiliation.

\institute[Millersville University of Pennsylvania]
% (optional, but mostly needed)
{
  Department of Mathematics
}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date{ % (optional)
Fall
%Spring
%Summer
\the\year}

\subject{Talks}
% This is only inserted into the PDF information catalog. Can be left
% out. 



% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}



% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}
%  \frametitle{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}


% Since this a solution template for a generic talk, very little can
% be said about how it should be structured. However, the talk length
% of between 15min and 45min and the theme suggest that you stick to
% the following rules:  

% - Exactly two or three sections (other than the summary).
% - At *most* three subsections per section.
% - Talk about 30s to 2min per frame. So there should be between about
%   15 and 30 frames, all told.

%\section{Introduction}

\begin{frame}\frametitle{Objectives}

In this lesson we will learn the approach of a fundamental technique
for solving many PDEs, namely \textbf{separation of variables}.

\vspace*{0.10in}

This technique reduces the problem of finding the unknown dependent
variable of the PDE $u$, which depends on $n$ independent variables,
to the problem of solving $n$ ordinary differential equations each
depending on a single independent variable.

\vspace*{0.10in}

We will assume the dependent variable is a \textbf{product solution}.
\[
u(x,y,t) = X(x) Y(y) T(t)
\]

\end{frame}
%%

\begin{frame}\frametitle{Example}

Apply the method of separation of variables to the equation
\[
x^{2} u_{xx} - 2 y \, u_{y} = 0
\]
and find a corresponding set of ordinary differential equations.

\end{frame}
%%

\begin{frame}\frametitle{Solution (1 of 2)}

\begin{itemize}
\item Assume $u(x,y) = X(x) Y(y)$ then
\begin{align*}
u_{xx} &= X''(x) Y(y)	\\
u_{y} &= X(x) Y'(y)	.
\end{align*}
\item<2-> Substitute into the PDE.
\begin{align*}
x^{2} u_{xx} - 2 y \, u_{y} &= 0	\\
\uncover<3->{%
x^{2} X''(x) Y(y) - 2 y X(x) Y'(y) &= 0
}
\end{align*}
\item<4-> Divide both sides by $u(x,y) = X(x) Y(y)$.
\begin{align*}
\frac{x^{2} X''(x) Y(y)}{X(x) Y(y)} - \frac{2 y X(x) Y'(y)}{X(x) Y(y)} &= 0	\\
\uncover<5->{%
x^{2} \frac{X''(x)}{X(x)} &= 2 y \, \frac{Y'(y)}{Y(y)}
}
\end{align*}
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Solution (2 of 2)}

\[
x^{2} \frac{X''(x)}{X(x)} = 2 y \, \frac{Y'(y)}{Y(y)}
\]
\textbf{Key observation}: the left-hand side is a function of $x$
while the right-hand side is a function of $y$.
Since they are equal they must be constant.
\uncover<2->{%
\[
x^{2} \frac{X''(x)}{X(x)} = c = 2 y \, \frac{Y'(y)}{Y(y)}
\]
This implies
\[
\begin{array}{rcl}
x^{2} \frac{X''(x)}{X(x)} & = & c	\\
2 y \, \frac{Y'(y)}{Y(y)} & = & c
\end{array}
\uncover<3->{%
\iff
\begin{array}{rcl}
x^{2} X''(x) - c \, X(x) & = & 0	\\
2 y \, Y'(y) - c \, Y(y) & = & 0
\end{array}
}
\]
}

\end{frame}
%%

\begin{frame}\frametitle{Example}

Apply the method of separation of variables to the following equation and
determine the corresponding set of ordinary differential equations.
\[
u_{xx} + u_{x} + 2 u_{y} - u \sin x = 0
\]

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (1 of 2)}
\fontsize{9pt}{10.8}\selectfont

\begin{itemize}
\item Assume $u(x,y) = X(x) Y(y)$ then
\begin{align*}
u_{x} &= X'(x) Y(y)	\\
u_{xx} &= X''(x) Y(y)	\\
u_{y} &= X(x) Y'(y)	.
\end{align*}
\item<2-> Substitute into the PDE.
\begin{align*}
u_{xx} + u_{x} + 2 u_{y}  - u \sin x &= 0	\\
\uncover<3->{%
X''(x) Y(y) + X'(x) Y(y) + 2 X(x) Y'(y) - X(x) Y(y) \sin x &= 0
}
\end{align*}
\item<4-> Divide both sides by $u(x,y) = X(x) Y(y)$.
\begin{align*}
\frac{X''(x) Y(y)}{X(x) Y(y)} + \frac{X'(x) Y(y)}{X(x) Y(y)} +
  \frac{2 X(x) Y'(y)}{X(x) Y(y)} - \frac{X(x) Y(y) \sin x}{X(x) Y(y)} &= 0	\\
\uncover<5->{%
\frac{X''(x)}{X(x)} + \frac{X'(x)}{X(x)} - \sin x &= -2 \, \frac{Y'(y)}{Y(y)}
}
\end{align*}
\end{itemize}

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (2 of 2)}
\fontsize{9pt}{10.8}\selectfont

\[
\frac{X''(x)}{X(x)} + \frac{X'(x)}{X(x)} - \sin x = -2 \, \frac{Y'(y)}{Y(y)}
\]
Since the left-hand side is a function of $x$
while the right-hand side is a function of $y$.
Since they are equal they must be constant.
\uncover<2->{%
\[
\frac{X''(x)}{X(x)} + \frac{X'(x)}{X(x)} - \sin x = c = -2 \, \frac{Y'(y)}{Y(y)}
\]
This implies
\[
\begin{array}{rcl}
\frac{X''(x)}{X(x)} + \frac{X'(x)}{X(x)} - \sin x & = & c	\\
-2 \, \frac{Y'(y)}{Y(y)} & = & c
\end{array}
\uncover<3->{%
\iff
\begin{array}{rcl}
X''(x) + X'(x) - X(x) \sin x & = & c \, X(x)	\\
2 \, Y'(y) + c \, Y(y) & = & 0
\end{array}
}
\]
}

\end{frame}
%%

\begin{frame}\frametitle{Example}

Determine if the method of separation of variables can be applied to
the following partial differential equation.
If so, determine the resulting ordinary differential equations.
\[
u_{x} + (x+y) u_{y} = 0.
\]

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution}

\begin{itemize}
\item Assume $u(x,y) = X(x) Y(y)$ then
\begin{align*}
u_{x} &= X'(x) Y(y)	\\
u_{y} &= X(x) Y'(y)	.
\end{align*}
\item<2-> Substitute into the PDE.
\begin{align*}
u_{x} + (x+y) u_{y} &= 0	\\
\uncover<3->{%
X'(x) Y(y) + (x+y) X(x) Y'(y) &= 0
}
\end{align*}
\item<4-> Divide both sides by $u(x,y) = X(x) Y(y)$.
\begin{align*}
\frac{X'(x) Y(y)}{X(x) Y(y)} + \frac{(x+y) X(x) Y'(y)}{X(x) Y(y)} &= 0	\\
\frac{X'(x)}{X(x)} + \frac{(x+y) Y'(y)}{Y(y)} &= 0
\end{align*}
\end{itemize}
\uncover<5->{%
It is not possible to separate the variables in this example.
}

\end{frame}
%%

\begin{frame}\frametitle{Example}

Determine if the method of separation of variables can be applied to
the partial differential equation below.
If so, determine the ordinary differential equations in each variable
which result.
\[
u_{rr} + \frac{1}{r} u_{r} + \frac{1}{r^{2}} u_{\theta\theta} = 0
\quad\mbox{(for $r > 0$)}
\]
The dependent variable is bounded as $r \to 0$ and is $2 \pi$-periodic
in $\theta$.

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (1 of 4)}

\begin{itemize}
\item Let $u(r, \theta) = R(r) T(\theta)$, then
\begin{align*}
u_{r} &= R'(r) T(\theta)	\\
u_{rr} &= R''(r) T(\theta)	\\
u_{\theta\theta} &= R(r) T''(\theta)	.
\end{align*}
\item Substitute into the PDE.
\begin{align*}
u_{rr} + \frac{1}{r} u_{r} + \frac{1}{r^{2}} u_{\theta\theta} &= 0
  \\
R''(r) T(\theta) + \frac{1}{r} R'(r) T(\theta) + \frac{1}{r^{2}} R(r)
  T''(\theta) &= 0
\end{align*}
\item Multiply both sides of the equation by $r^{2}/(R(r) T(\theta))$.
\[
r^{2} \frac{R''(r)}{R(r)} + r \, \frac{R'(r)}{R(r)} +
\frac{T''(\theta)}{T(\theta)} = 0
\]
\item Separate the variables.
\end{itemize}

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (2 of 4)}

\[
r^{2} \frac{R''(r)}{R(r)} + r \, \frac{R'(r)}{R(r)} =
-\frac{T''(\theta)}{T(\theta)}
\uncover<2->{= c}
\]
\uncover<2->{%
where $c$ is a constant.

\vspace*{0.10in}

The ordinary differential equations for $r$ and $\theta$ are thus
\begin{align*}
r^{2} R''(r) + r \, R'(r) - c \, R(r) &= 0	\\
T''(\theta) + c \, T(\theta) &= 0	.
\end{align*}

\vspace*{0.10in}

\uncover<3->{%
The equation in $\theta$ is a second-order linear, constant
coefficient, linear, homogeneous ODE.
}
}

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (3 of 4)}

If $c \ge 0$ then the ODE
\[
T''(\theta) + c \, T(\theta) = 0
\]
has solutions
\[
T(\theta) = A \cos (\sqrt{c} \, \theta) + B \sin (\sqrt{c} \, \theta)	.
\]
\uncover<2->{%
The solution $u(r, \theta)$ should be $2 \pi$-periodic in $\theta$,
thus
\[
\frac{2 \pi}{\sqrt{c}} = \frac{2 \pi}{n}
\iff c = n^{2}
\]
where $n \in \mathbb{N}$ or $c = 0$.

\vspace*{0.10in}

\uncover<3->{%
Thus the solutions for $T(\theta)$ can be summarized as
\[
T_{n}(\theta) = A_{n} \cos (n \theta) + B_{n} \sin (n \theta)
\]
for $n = 0, 1, 2, \ldots$.
}
}

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution (4 of 4)}

Since $c = n^{2}$ for $n = 0, 1, 2, \ldots$ then the ODE for $r$ can
be written as
\[
r^{2} R''(r) + r \, R'(r) - n^{2} R(r) = 0
\]
which is Euler's equation.
The solutions are
\begin{align*}
R_{0}(r) &= C_{0} + D_{0} \ln r
\quad\mbox{(for $n=0$)}	\\
R_{n}(r) &= C_{n} r^{n} + D_{n} r^{-n}
\quad\mbox{(for $n=1, 2, \ldots$)}
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
The solutions are supposed to be bounded as $r \to 0$ and thus $D_{0}
= D_{n} = 0$ for $n = 1, 2, \ldots$.
Consequently
\[
u_{n}(r, \theta) = r^{n} \left[ A_{n} \cos (n \theta) + B_{n} \sin (n
  \theta) \right]
\]
for $n = 0, 1, 2, \ldots$.
}

\end{frame}
%%

\begin{frame}\frametitle{Example: The Heat Equation}

Consider the one-dimensional, homogeneous heat equation with Dirichlet
boundary conditions and an initial condition as below.
\begin{align*}
u_{t} &= k \, u_{xx},
\quad 0 < x < L	,	\quad t > 0	\\
u(0,t) &= 0	,
\quad t > 0	\\
u(L,t) &= 0	,
\quad t > 0	\\
u(x,0) &= f(x)	,
\quad 0 \le x \le L
\end{align*}
Apply the method of separation of variables to this initial boundary
value problem and determine the product solutions which satisfy the
homogeneous boundary conditions.

\end{frame}
%%

\begin{frame}\frametitle{Solution (1 of 8)}

\begin{itemize}
\item Assume the product solution $u(x,t) = X(x) T(t)$.
\item Differentiating and substituting into the heat equation yields
\begin{align*}
u_{t} &= k \, u_{xx}	\\
X(x) T'(t) &= k \, X''(x) T(t)	\\
\frac{1}{k} \, \frac{T'(t)}{T(t)} &= \frac{X''(x)}{X(x)} = -c
\end{align*}
where $c$ is a constant and the minus sign is introduced for
convenience.
\item The resulting ODEs for $x$ and $t$ are
\begin{align*}
X''(x) + c \, X(x) &= 0	\\
T'(t) + c \, k \, T(t) &= 0	.
\end{align*}
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Solution (2 of 8)}

Consider the ODE for $x$ and the boundary conditions.
\begin{align*}
X''(x) + c \, X(x) &= 0	\\
u(0,t) = X(0) T(t) &= 0
\iff X(0) = 0	\\
u(L,t) = X(L) T(t) &= 0
\iff X(L) = 0
\end{align*}
Find solutions to the ODE which satisfy the boundary conditions.
Consider the three cases:
\begin{itemize}
\item $c = 0$,
\item $c < 0$,
\item $c > 0$.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Solution (3 of 8)}

\textbf{Case}: $c = 0$.
\begin{align*}
X''(x) + c \, X(x) = X''(x) &= 0	\\
X(x) &= A x + B
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
When $x = 0$ we have $0 = X(0) = B$.

\vspace*{0.10in}

\uncover<3->{%
When $x = L$ we have $0 = X(L) = A \, L$ which implies $A = 0$.
Thus when $c = 0$ we have only the trivial solution $X(x) = 0$.
}
}

\end{frame}
%%

\begin{frame}\frametitle{Solution (4 of 8)}

\textbf{Case}: $c < 0$.
Let $c = -\lambda^{2}$ where $\lambda > 0$.
\begin{align*}
X''(x) + c \, X(x) = X''(x) - \lambda^{2} X(x) &= 0	\\
X(x) &= A \cosh (\lambda x) + B \sinh (\lambda x)
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
When $x = 0$ we have $0 = X(0) = A$.

\vspace*{0.10in}

\uncover<3->{%
When $x = L$ we have $0 = X(L) = B \sinh (\lambda L)$ which implies $B = 0$.
Thus when $c < 0$ we have only the trivial solution $X(x) = 0$.
}
}

\end{frame}
%%

\begin{frame}\frametitle{Solution (5 of 8)}

\textbf{Case}: $c > 0$.
Let $c = \lambda^{2}$ where $\lambda > 0$.
\begin{align*}
X''(x) + c \, X(x) = X''(x) + \lambda^{2} X(x) &= 0	\\
X(x) &= A \cos (\lambda x) + B \sin (\lambda x)
\end{align*}
\uncover<2->{%
When $x = 0$ we have $0 = X(0) = A$.

\vspace*{0.10in}

\uncover<3->{%
When $x = L$ we have $0 = X(L) = B \sin (\lambda L)$ which implies
\begin{align*}
\lambda L &= n \pi	\\
\lambda \equiv \lambda_{n} &= \frac{n \pi}{L}
\end{align*}
for $n \in \mathbb{N}$.
Thus when $c = n^{2} \pi^{2}/L^{2}$ for $n \in \mathbb{N}$ we have the
nontrivial solutions
\[
X_{n}(x) = \sin \frac{n \pi x}{L}	.
\]
Function $X_{n}(x)$ is called an \textbf{eigenfunction} corresponding
to \textbf{eigenvalue} $n^{2} \pi^{2}/L^{2}$.
}
}

\end{frame}
%%

\begin{frame}\frametitle{Solution (6 of 8)}

Using the known eigenvalue in the ODE for $t$ yields
\begin{align*}
T'(t) + \frac{n^{2} \pi^{2} k}{L^{2}} T(t) &= 0	\\
T(t) \equiv T_{n}(t) &= C_{n} e^{-n^{2} \pi^{2} k \, t/L^{2}}
\end{align*}
for $n \in \mathbb{N}$.

\vspace*{0.10in}

\uncover<2->{%
The product  solutions which satisfy the boundary conditions have the
form
\[
u_{n}(x,t) = X_{n}(x) T_{n}(t) =
B_{n} e^{-n^{2} \pi^{2} k \, t/L^{2}} \sin \left( \frac{n \pi x}{L} \right)	.
\]
These are called \textbf{fundamental solutions}.
}

\end{frame}
%%

\begin{frame}\frametitle{Solution (7 of 8)}

Using the Principle of Superposition, a finite linear combination of
fundamental solutions will likewise solve the PDE and satisfy the BCs.
\[
u(x,t) = \sum_{n=1}^{N}
B_{n} e^{-n^{2} \pi^{2} k \, t/L^{2}} \sin \left( \frac{n \pi x}{L} \right)
\]

\vspace*{0.10in}

\uncover<2->{%
Now consider the initial condition:
\begin{align*}
u(x,0) &= f(x)	\\
\sum_{n=1}^{N} B_{n} \sin \left( \frac{n \pi x}{L} \right) &= f(x)
\end{align*}
As long as $f(x)$ contains a finite sum of sine functions of the
appropriate periods we can equate coefficients and solve for the $B_{n}$'s.
}

\end{frame}
%%

\begin{frame}\frametitle{Solution (8 of 8)}

Take the case in which
\[
f(x) = -2 \sin \frac{4 \pi \, x}{L} + 5 \sin \frac{10 \pi \, x}{L}	.
\]
Then $B_{4} = -2$, $B_{10} = 5$ and all other coefficients are 0.
\[
u(x,t) = -2 e^{-16 \pi^{2} k \, t/L^{2}} \sin \frac{4 \pi \, x}{L} +
5 e^{-100 \pi^{2} k \, t/L^{2}} \sin \frac{10 \pi \, x}{L}	.
\]

\end{frame}
%%

\begin{frame}\frametitle{Illustration}

\[
u(x,t) = -2 e^{-16 \pi^{2} k \, t/L^{2}} \sin \frac{4 \pi \, x}{L} +
5 e^{-100 \pi^{2} k \, t/L^{2}} \sin \frac{10 \pi \, x}{L}	.
\]
\begin{center}
\resizebox{0.80\textwidth}{!}{\includegraphics{heat}}
\end{center}

\end{frame}
%%

\begin{frame}\frametitle{Homework}

\begin{itemize}
\item Read Section $1.6$
\item Exercises: 14, 18, 20
\end{itemize}

\end{frame}
%%

%%%
\end{document}

%%%%
%%%% EOF
%%%%
