%%%%		-*- 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:      02/14/2025
%%%%
%%%% Purpose:   Solutions to the nonhomogeneous Wave Equation
%%%%

\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{The Nonhomogeneous Wave Equation}
\subtitle{\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:
\begin{itemize}
\item a decomposition approach to solving nonhomogeneous wave equations.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{General Nonhomogeneous Wave Equation}

Consider the following
initial boundary value problem:
\begin{align*}
u_{tt}
	&= c^{2} u_{xx} + F(x, t)
\mbox{ for $0 < x < L$ and $t > 0$}	\\
u(0, t)
	&= \phi(t)
\mbox{ and } u(L, t) = \psi(t)
\mbox{ for $t > 0$}	\\
u(x, 0)
	&= f(x)
\mbox{ and } u_{t}(x, 0) = g(x)
\mbox{ for $0 < x < L$.}
\end{align*}

The solution to the IBVP can be found by
solving two simpler initial boundary value problems
and using the Principle of
Superposition to reconstruct the full solution.

\end{frame}
%%

\begin{frame}\frametitle{Two Sub-Problems}

\begin{align*}
v_{tt}
	&= c^{2} v_{xx} + F(x, t)
\mbox{ for $0 < x < L$ and $t > 0$}	\\
v(0, t)
	&= v(L, t) = 0
\mbox{ for $t > 0$}	\\
v(x, 0)
	&= v_{t}(x, 0) = 0
\mbox{ for $0 < x < L$}
\end{align*}
The IBVP above contains the nonhomogeneous PDE.

\vspace*{0.10in}

\begin{align*}
w_{tt}
	&= c^{2} w_{xx}
\mbox{ for $0 < x < L$ and $t > 0$}	\\
w(0, t)
	&= \phi(t)
\mbox{ and } w(L, t)	= \psi(t)
\mbox{ for $t > 0$}	\\
w(x, 0)
	&= f(x)
\mbox{ and } w_{t}(x, 0) = g(x)
\mbox{ for $0 < x < L$.}
\end{align*}
The IBVP above contains the nonhomogeneous BCs.

\vspace*{0.10in}

If $v(x, t)$ and $w(x, t)$ solve their respective IBVPs, then $u(x, t)
= v(x, t) + w(x, t)$ solves the original IBVP.

\end{frame}
%%

\begin{frame}\frametitle{Homogeneous PDE with Nonhomogeneous BCs}

Consider the IBVP with nonhomogeneous BCs:
\begin{align*}
w_{tt}
	&= c^{2} w_{xx}
\mbox{ for $0 < x < L$ and $t > 0$}	\\
w(0, t)
	&= \phi(t)
\mbox{ for $t > 0$}	\\
w(L, t)
	&= \psi(t)
\mbox{ for $t > 0$}	\\
w(x, 0)
	&= f(x)
\mbox{ for $0 < x < L$}	\\
w_{t}(x, 0)
	&= g(x)
\mbox{ for $0 < x < L$.}
\end{align*}

Assume the solution can be written as $w(x, t) = y(x, t) + r(x, t)$
where $r(x, t)$ is a \textbf{reference function} satisfying the
nonhomogeneous BCs and $y(x, t)$ is an unknown
function, to be found later.

\end{frame}
%%

\begin{frame}\frametitle{Reference Function}

Find any function $r(x, t)$ which satisfies the nonhomogeneous BCs:
\begin{align*}
w(0, t)
	&= \phi(t)
\mbox{ for $t > 0$}	\\
w(L, t)
	&= \psi(t)
\mbox{ for $t > 0$.}
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
Many solutions are possible, but a straightforward one is
\[
r(x, t)
	= \frac{x}{L} \left[ \psi(t) - \phi(t) \right] + \phi(t)	.
\]

\vspace*{0.10in}

\uncover<3->{%
If $w(x, t) = y(x, t) + r(x, t)$ solves the IBVP given earlier with
nonhomogeneous BCs, find the IBVP which $y(x, t)$ solves.
}
}

\end{frame}
%%

\begin{frame}\frametitle{Related IBVP with Homogeneous BCs}

\begin{align*}
w_{tt}
	&= y_{tt} + \frac{x}{L} \left[ \psi''(t) - \phi''(t)
              \right] + \phi''(t)	\\
w_{xx}
	&= y_{xx}	\\
\uncover<2->{%
y_{tt}
	&= c^{2} y_{xx} - \frac{x}{L} \left[ \psi''(t) - \phi''(t)
              \right] - \phi''(t)
\mbox{ for $0 < x < L$, $t > 0$}	\\
y(0, t)
	&= y(L, t) = 0
\mbox{ for $t > 0$}	\\
y(x, 0)
	&= f(x) - \frac{x}{L} \left[ \psi(0) - \phi(0)
              \right] - \phi(0)
\mbox{ for $0 < x < L$}	\\
y_{t}(x, 0)
	&= g(x) - \frac{x}{L} \left[ \psi'(0) - \phi'(0)
              \right] - \phi'(0)
\mbox{ for $0 < x < L$.}
}
\end{align*}

\uncover<3->{%
\textbf{Remark}: the IBVP for $y(x, t)$ has homogeneous Dirichlet
boundary conditions, but a nonhomogeneous PDE.
We must decompose it into two additional sub-problems in order to
solve it.
}

\end{frame}
%%

\begin{frame}\frametitle{Two More Sub-Problems}

\textbf{Note}: the dependent variables are again named $v$ and $w$
though they are not the same functions as mentioned earlier.

\vspace*{0.10in}

\textbf{IBVP with homogeneous PDE}:
\begin{align*}
w_{tt}
	&= c^{2} w_{xx}
\mbox{ for $0 < x < L$, $t > 0$}	\\
w(0, t)
	&= w(L, t) = 0
\mbox{ for $t > 0$}	\\
w(x, 0)
	&= f(x) - \frac{x}{L} \left[ \psi(0) - \phi(0)
              \right] - \phi(0)
\mbox{ for $0 < x < L$}	\\
w_{t}(x, 0)
	&= g(x) - \frac{x}{L} \left[ \psi'(0) - \phi'(0)
              \right] - \phi'(0)
\mbox{ for $0 < x < L$.}
\end{align*}

\vspace*{0.10in}

\textbf{IBVP with nonhomogeneous PDE}:
\begin{align*}
v_{tt}
	&= c^{2} v_{xx} - \frac{x}{L} \left[ \psi''(t) - \phi''(t)
              \right] - \phi''(t)
\mbox{ for $0 < x < L$, $t > 0$}	\\
v(0, t)
	&= v(L, t) = 0
\mbox{ for $t > 0$}	\\
v(x, 0)
	&= 0
\mbox{ for $0 < x < L$}	\\
v_{t}(x, 0)
	&= 0
\mbox{ for $0 < x < L$.}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{IBVP With Homogeneous PDE}

\begin{align*}
w_{tt}
	&= c^{2} w_{xx}
\mbox{ for $0 < x < L$, $t > 0$}	\\
w(0, t)
	&= w(L, t) = 0
\mbox{ for $t > 0$}	\\
w(x, 0)
	&= f(x) - \frac{x}{L} \left[ \psi(0) - \phi(0)
              \right] - \phi(0)
\mbox{ for $0 < x < L$}	\\
w_{t}(x, 0)
	&= g(x) - \frac{x}{L} \left[ \psi'(0) - \phi'(0)
              \right] - \phi'(0)
\mbox{ for $0 < x < L$.}
\end{align*}

\vspace*{0.10in}

\textbf{Remark}: this IBVP has homogeneous Dirichlet BCs and thus we
can express the solution as a Fourier series:
\[
w(x, t)
	= \sum_{n=1}^{\infty} \left( a_{n} \cos \frac{c n \pi t}{L} +
  b_{n} \sin \frac{c n \pi t}{L} \right) \sin \frac{n \pi x}{L}	.
\]

\end{frame}
%%

\begin{frame}\frametitle{IBVP with nonhomogeneous PDE}

\begin{align*}
v_{tt}
	&= c^{2} v_{xx} - \frac{x}{L} \left[ \psi''(t) - \phi''(t)
              \right] - \phi''(t)
\mbox{ for $0 < x < L$, $t > 0$}	\\
v(0, t)
	&= v(L, t) = 0
\mbox{ for $t > 0$}	\\
v(x, 0)
	&= 0
\mbox{ for $0 < x < L$}	\\
v_{t}(x, 0)
	&= 0
\mbox{ for $0 < x < L$.}
\end{align*}

\vspace*{0.10in}

\textbf{Remark}: this IBVP has homogeneous Dirichlet BCs and ICs of
zero.
We will solve this nonhomogeneous PDE in more generality by assuming
the nonhomogeneity is a function $F(x, t)$.

\end{frame}
%%

\begin{frame}\frametitle{Finding the Solution to the Nonhomogeneous
    PDE}

\begin{align*}
u_{tt}
	&= c^{2} u_{xx} + F(x, t)
\mbox{ for $0 < x < L$, $t > 0$}	\\
u(0, t)
	&= u(L, t) = 0
\mbox{ for $t > 0$}	\\
u(x, 0)
	&= 0
\mbox{ for $0 < x < L$}	\\
u_{t}(x, 0)
	&= 0
\mbox{ for $0 < x < L$.}
\end{align*}

\vspace*{0.10in}

Assume the solution has the form
\[
u(x, t)
	= \sum_{n=1}^{\infty} T_{n}(t) \sin \frac{n \pi x}{L}	.
\]
Differentiate and substitute into the PDE.

\end{frame}
%%

\begin{frame}\frametitle{Differentiating the Solution}

\begin{align*}
u_{tt}
	&= c^{2} u_{xx} + F(x, t)	\\
\sum_{n=1}^{\infty} T_{n}''(t) \sin\frac{n \pi x}{L}
	&= -c^{2} \sum_{n=1}^{\infty}
\left( \frac{n \pi}{L} \right)^{2} T_{n}(t) \sin \frac{n \pi x}{L} +
F(x, t)
\end{align*}

Rearrange terms to isolate the nonhomogeneous term.
\[
\sum_{n=1}^{\infty} \left[
T_{n}''(t) + \left( \frac{n \pi c}{L} \right)^{2} T_{n}(t)
\right] \sin \frac{n \pi x}{L}
	= F(x, t)
\]
Multiply both sides by $\sin (m \pi x)/L$ and integrate from $x = 0$
to $x = L$.

\end{frame}
%%

\begin{frame}\frametitle{Orthogonality}

Since $\sin (n \pi x)/L$ and $\sin (m \pi x)/L$ are orthogonal when $n
\ne m$ then
\[
T_{m}''(t) + \left( \frac{m \pi c}{L} \right)^{2} T_{m}(t)
	= \frac{2}{L} \int_{0}^{L} F(x, t) \sin \frac{m \pi x}{L} \, dx
	= F_{m}(t)
\]
for $m \in \mathbb{N}$.

\vspace*{0.10in}

\uncover<2->{%
For $n = 1, 2, \ldots$ we must solve the initial value problems:
\begin{align*}
T_{n}''(t) + \left( \frac{n \pi c}{L} \right)^{2} T_{n}(t)
	&= F_{n}(t)	\\
T_{n}(0)
	&= 0	\\
T_{n}'(0)
	&= 0	.
\end{align*}
}

\end{frame}
%%

\begin{frame}\frametitle{Example}

Find the solution to the following IBVP:
\begin{align*}
u_{tt}
	&= u_{xx} + t \, \sin x
\mbox{ for $0 < x < \pi$ and $t > 0$}	\\
u(0, t)
	&= u(\pi, t) = 0
\mbox{ for $t > 0$}	\\
u(x, 0)
	&= \sin x
\mbox{ for $0 < x < \pi$}	\\
u_{t}(x, 0)
	&= \sin (3 x)
\mbox{ for $0 < x < \pi$.}
\end{align*}

\end{frame}
%%

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

Find the solution to the homogeneous IBVP:
\begin{align*}
w_{tt}
	&= w_{xx}
\mbox{ for $0 < x < \pi$ and $t > 0$}	\\
w(0, t)
	&= w(\pi, t) = 0
\mbox{ for $t > 0$}	\\
w(x, 0)
	&= \sin x
\mbox{ for $0 < x < \pi$}	\\
w_{t}(x, 0)
	&= \sin (3 x)
\mbox{ for $0 < x < \pi$.}
\end{align*}

\vspace*{0.10in}

This can be found readily in d'Alembertian form.

\end{frame}
%%

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

\begin{align*}
w(x, t)
	&= \frac{1}{2} \left( \sin (x - t) + \sin (x + t) \right)
	+ \frac{1}{2} \int_{x-t}^{x+t} \sin (3 s) \, ds	\\
	&= \frac{1}{2} \left( \sin (x - t) + \sin (x + t) \right) +
   \frac{1}{6} \left( \cos 3 (x - t) - \cos 3 (x + t) \right)	\\
	&= \sin x \cos t + \frac{1}{3} \sin (3 x) \sin (3 t)
\end{align*}

\end{frame}
%%

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

Now find the solution to the IBVP containing the nonhomogeneous PDE and
zero initial conditions.
\begin{align*}
v_{tt}
	&= v_{xx} + t \, \sin x
\mbox{ for $0 < x < \pi$ and $t > 0$}	\\
v(0, t)
	&= v(\pi, t) = 0
\mbox{ for $t > 0$}	\\
v(x, 0)
	&= 0
\mbox{ for $0 < x < \pi$}	\\
v_{t}(x, 0)
	&= 0
\mbox{ for $0 < x < \pi$.}
\end{align*}

\vspace*{0.10in}

Make the assumption that the solution can be expressed as
\[
v(x, t)
	= \sum_{n=1}^{\infty} T_{n}(t) \sin (n \, x)	.
\]

\end{frame}
%%

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

Differentiating $v(x, t)$ and substituting into the PDE produce:
\begin{align*}
\sum_{n=1}^{\infty} T_{n}''(t) \sin (n \, x)
	&= - \sum_{n=1}^{\infty} n^{2} T_{n}(t) \sin (n \, x) + t \, \sin x  \\
\sum_{n=1}^{\infty} \left( T_{n}''(t) + n^{2} T_{n}(t) \right) \sin (n
  \, x)
	&= t \, \sin x	.
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
Multiply both sides by $\sin (m \, x)$ and integrate over $[0, \pi]$.
}

\end{frame}
%%

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

\begin{align*}
T_{m}''(t) + m^{2} T_{m}(t)
	&= \frac{2}{\pi} \int_{0}^{\pi} t \, \sin x \sin (m \, x)
              \, dx	\\
	&= \left\{ \begin{array}{ll}
t	& \mbox{if $m = 1$}	\\
0	& \mbox{if $m = 2, 3, \ldots$}
\end{array} \right.
\end{align*}

\vspace*{0.10in}

\uncover<2->{%
Solve the initial value problems:
\begin{align*}
T_{1}''(t) + T_{1}(t)
	&= t	\\
T_{n}''(t) + n^{2} T_{n}(t)
	&= 0
\end{align*}
for $n = 2, 3, \ldots$ with zero initial conditions.
}

\end{frame}
%%

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

We can immediately check that $T_{n}(t) = 0$ for $n = 2, 3, \ldots$.

\vspace*{0.10in}

\[
T_{1}(t)
	= A_{1} \cos t + B_{1} \sin t + t
\]

\vspace*{0.10in}

Making use of the initial conditions ($T_{1}(0) = T_{1}'(0) = 0$)
reveals,
\[
T_{1}(t)
	= t - \sin t	.
\]

\vspace*{0.10in}

This implies,
\[
v(x, t)
	= T_{1}(t) \sin x = (t - \sin t) \sin x	.
\]

\end{frame}
%%

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

\begin{align*}
u(x, t)
	&= w(x, t) + v(x, t)	\\
	&= \sin x \cos t + \frac{1}{3} \sin (3 x) \sin (3 t) + (t - \sin t) \sin x	.
\end{align*}

\begin{center}
\resizebox{0.75\textwidth}{!}{\includegraphics{example01}}
\end{center}

\end{frame}
%%

%\begin{frame}\frametitle{Homework}

%\begin{itemize}
%\item Read Sections $5.4$
%\item Exercises: 18--20
%\end{itemize}

%\end{frame}
%%

%%%
\end{document}

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