$\renewcommand{\Re}{\operatorname{Re}}$ $\renewcommand{\Im}{\operatorname{Im}}$ $\newcommand{\erf}{\operatorname{erf}}$ $\newcommand{\dag}{\dagger}$ $\newcommand{\const}{\mathrm{const}}$ $\newcommand{\arcsinh}{\operatorname{arcsinh}}$
Consider wave equation in domain $\{x>0, t>0\}$ and initial conditions \begin{align} &u_{tt}-c^2 u_{xx}=0 \qquad &&x>0,\ t>0\label{eq-2.6.1}\\ &u|_{t=0}=g(x) && x>0,\label{eq-2.6.2}\\ &u_t|_{t=0}=h(x) && x>0.\label{eq-2.6.3} \end{align} Here we take $f(x,t)=0$ for simplicity. Then according to the previous section solution $u(x,t)$ is defined uniquely in the domain $\{t>0, x \ge ct\}$:
where it is given by D'Alembert formula \begin{equation} u(x,t)= \frac{1}{2}\bigl[ g(x+ct)+g(x-ct)\bigr]+\frac{1}{2c}\int_{x-ct}^{x+ct} h(x')\,dx'. \label{eq-2.6.4} \end{equation} What about domain $\{0 < x < ct\} $? We claim that we need one boundary condition at $x=0, t>0$. Indeed, recall that the general solution of (\ref{eq-2.6.1}) is \begin{equation} u(x,t)= \phi (x+ct)+\psi (x-ct) \label{eq-2.6.5} \end{equation} where initial conditions (\ref{eq-2.6.2})-(\ref{eq-2.6.3}) imply that \begin{align*} &\phi(x)+\psi(x)= g(x),\\ &\phi (x)-\psi(x)=\frac{1}{c}\int^x_0 h(x')\,dx' \end{align*} for $x>0$ (where we integrated the second equation) and then \begin{align} &\phi(x)= \frac{1}{2}g(x)+\frac{1}{2c}\int^x _0 h(x')\,dx',\qquad &&x>0,\label{eq-2.6.6}\\ &\psi(x)=\frac{1}{2}g(x)-\frac{1}{2c}\int^x _0 h(x')\,dx' \qquad&&x>0. \label{eq-2.6.7} \end{align} Therefore, $\phi(x+ct)$ and $\psi(x-ct)$ are defined respectively as $x+ct>0$ (which is automatic as $x>0,t>0$) and $x-ct>0$ (which is fulfilled only as $x>ct$).
To define $\psi(x-ct)$ as $0< x < ct$ we need to define $\psi(x)$ as $x<0$ and we need a boundary condition as $x=0,t>0$.
Example 1. Consider Dirichlet boundary condition \begin{equation} u|_{x=0}= p(t), \qquad t>0. \label{eq-2.6.8} \end{equation} Plugging (\ref{eq-2.6.5}) we see that $\phi(ct)+\psi(-ct)=p(t)$ as $t>0$ or equivalently $\phi(-x)+\psi(x)=p(-x/c)$ for $x<0$ (and $-x>0$) where we plugged $t:=-x/c$. Plugging (\ref{eq-2.6.6}) we have \begin{multline} \psi(x)=p(-x/c)-\phi(-x)=\\ p(-x/c)-\frac{1}{2}g(-x) -\frac{1}{2c}\int_0^{-x} h(x')\,dx'. \qquad \label{eq-2.6.9} \end{multline} Then plugging $x:=x+ct$ into (\ref{eq-2.6.6}) and $x:=x-ct$ into (\ref{eq-2.6.9}) and adding we get from (\ref{eq-2.6.4}) that \begin{align} u(x,t)= &\underbracket{\frac{1}{2}g(x+ct)+ \frac{1}{2c}\int_0^{x+ct}h(x')\,dx'}_{=\phi(x+ct)}\notag \\ +&\underbracket{p(t-x/c)-\frac{1}{2}g(ct-x) -\frac{1}{2c}\int_0^{ct-x} h(x')\,dx'}_{=\psi(x-ct)}. \qquad \label{eq-2.6.10} \end{align} This formula defines $u(x,t)$ for $0< x< ct$. Recall that for $x>ct$ solution is given by (\ref{eq-2.6.4}).
Example 2. Alternatively, consider Neumann boundary condition \begin{equation} u_x|_{x=0}= q(t), \qquad t>0. \label{eq-2.6.13} \end{equation}
Plugging (\ref{eq-2.6.5}) we see that $\phi'(ct)+\psi'(-ct)=q(t)$ as $t>0$ or equivalently $\phi(-x)-\psi(x)=c\int_0^{-x/c}q(t')\,dt'$ for $x< 0$ (and $-x>0$), where we integrated first and then plugged $t:=-x/c$. (see also Remark 1).
Plugging (\ref{eq-2.6.6}) we have \begin{multline} \psi(x)=-c\int_0^{-x/c}q(t')\,dt'+\phi(x)=\\ -c\int_0^{-x/c}q(t')\,dt'+\frac{1}{2}g(-x) + \frac{1}{2c}\int_0^{-x} h(x')\,dx'. \qquad \label{eq-2.6.14} \end{multline} Then plugging $x:=x+ct$ into (\ref{eq-2.6.6}) and $x:=x-ct$ into (\ref{eq-2.6.14}) and adding we get from (\ref{eq-2.6.4}) that \begin{align} u(x,t)&= \underbracket{\frac{1}{2}g(x+ct)+ \frac{1}{2c}\int_0^{x+ct}h(x')\,dx'}_{=\phi(x+ct)}\notag \\ &\underbracket{-c\int _0^{t-x/c}q(t')\,dt'+\frac{1}{2}g(ct-x) +\frac{1}{2c}\int_0^{ct-x} h(x')\,dx'}_{=\psi(x-ct)}. \qquad\label{eq-2.6.15} \end{align} This formula defines $u(x,t)$ as $0< x< ct$. Recall that for $x> ct$ solution is given by (\ref{eq-2.6.4}).
In particular
Remark 1. One can ask in Example 2, why we took $C=0$ in $\phi(-x)-\psi(x)=c\int_0^{-x/c}q(t')\,dt'+C$. The short answer is that this choice provides continuity of the solution $u(x,t)$ in $(0,0)$. But then why we care about this here but not in Example 1? Again the short answer is that now without this extra restriction we do not have uniqueness of the solution.
The proper answer is more complicated: the discontinuous solutions could be properly understood only in the framework of weak solutions (see Section 11.4); then, if there are several solutions but only one of them is continuous, it is the only correct one. The same reasoning applies in Example 3 and Example 4 below.
Example 3. Alternatively, consider boundary condition \begin{equation} (\alpha u_x+\beta u_t)|_{x=0}= q(t), \qquad t>0. \label{eq-2.6.18} \end{equation} Again we get equation to $\psi(-ct)$: $(\alpha -c \beta)\psi'(-ct)+ (\alpha +c \beta) \phi' (ct)=q(t) $ and everything works well as long as $\alpha\ne c\beta $.
Exercise. Explain why we need $\alpha\ne c\beta $.
Example 4. Alternatively, consider Robin boundary condition \begin{equation} (u_x+\sigma u)|_{x=0}= q(t), \qquad t>0. \label{eq-2.6.19} \end{equation} and we get $ \psi'(-ct)+\sigma \psi (-ct) + \phi'(ct)+\sigma \phi (ct)=q(t)$ or, equivalently, \begin{equation} \psi'(x)+\sigma \psi (x)=q(-x/c)- \phi'(-x)+\sigma \phi (-x) \label{eq-2.6.20} \end{equation} where the right-hand expression is known.
In this case we define $\psi(x)$ at $x<0$ solving ODE (\ref{eq-2.6.20}) as we know $\psi(0)=\frac{1}{2}g(0)$ from (\ref{eq-2.6.7}).
Example 5. Consider two wave equations \begin{align*} &u_{tt}-c_1^2u_{xx}=0 && \text{as } x>0,\\[3pt] &u_{tt}-c_2^2u_{xx}=0 && \text{as } x<0, \end{align*} intertwined through boundary conditions \begin{align*} u|_{x=0^+}&=u|_{x=0^-}\\[3pt] u_x|_{x=0^+}&=k u_x|_{x=0^-} \end{align*} with $k>0$. Again we are looking for continuous $u(x,t)$.
Assume that $u(x,0)=0$ for $x<0$. In this case
with $\psi(t) =-\beta \phi(t)$, $\chi(t)=\alpha \phi(t)$, $\alpha = 2c_2(kc_1+c_2)^{-1}$, $\beta=(kc_1-c_2)(kc_1+c_2)^{-1}$.
Then we have two outgoing waves: reflected wave $\psi (t-c_1^{-1} x)$ and refracted wave $\chi(t+c_2^{-1} x)$.
Example 6. Find continuous solution to \begin{align} &u_{tt}-9u_{xx}=0, && -\infty< t<\infty,\ x>-t,\label{eq-2.6.21}\\ &u|_{t=0}= 4\cos (x), && x>0,\label{eq-2.6.22}\\ &u_t|_{t=0}=18\sin(x), && x>0,\label{eq-2.6.23}\\ &u_x|_{x=-t}= 0, &&-\infty <t <\infty.\label{eq-2.6.24} \end{align}
Solution The general solution to (\ref{eq-2.6.21}) is \begin{equation} u(x,t) = \phi (x+3t) + \psi (x-3t). \label{eq-2.6.25} \end{equation}
Plugging into (\ref{eq-2.6.22}) and (\ref{eq-2.6.23}) we get \begin{align*} &\phi (x)+\psi(x)= 4\cos(x)&& x>0,\\ &\phi(x)-\psi(x)=- 6\cos(x) \end{align*} (the second equation after division by $3$ and integration). Therefore \begin{align} &\phi (x)= - \cos(x)&& \psi(x)= 5\cos(x), && x>0, \label{eq-2.6.26} \end{align} which defines solution \begin{gather*} u= -\cos(x+3t) +5\cos (x-3t) \end{gather*} in the zone ${(x,t)\colon x> 3|t|}$.
Plugging (\ref{eq-2.6.25}) into (\ref{eq-2.6.24}) we get \begin{equation} \phi '(2t) +\psi '(-4t) =0, \label{eq-2.6.-27} \end{equation} which for $t>0$ (we know $\phi$) becomes \begin{multline*} \sin(2t) + \psi'(-4t) =0\implies \psi'(x) = -\sin (-x/2)=\sin (x/2) \implies\\ \psi(x) = -2\cos(x/2)+C \end{multline*} and since $\psi$ must be continuous at $0$ we get $C=7$, $\psi(x) = -2\cos(x/2) +7$ and we get solution \begin{gather*} u= -\cos(x+3t) - 2\cos ((x-3t)/2) +7 \end{gather*} in the zone ${(x,t)\colon t>0, -t<x<3t}$.
For $ t<0$ we know $\psi$ and (\ref{eq-2.6.-27}) becomes \begin{multline*} \phi'(2t) -5 \sin(-4t) =0\implies \phi'(x) = 5\sin (-2x)=-5\sin(x) \implies \\ \phi(x) = \frac{5}{2}\cos(2x)+D \end{multline*} and since $\phi$ must be continuous at $0$ we get $D=-\frac{7}{2}$, $\phi(x) = \frac{5}{2}\cos(2x+6t)-\frac{7}{2}$ and we get solution \begin{gather*} u= \frac{5}{2}\cos(2x)-\frac{7}{2} + 5\cos(x-3t) \end{gather*} in the zone ${(x,t)\colon t<0, -t<x<-3t}$.
Example 7.
Find continuous solution to \begin{align} &9u_{tt}-u_{xx}=0, && -\infty< t<\infty,\ x>-t,\label{eq-2.6.x}\\ &u|_{t=0}= 4\sin (3x), && x>0,\label{eq-2.6.y}\\ &u_t|_{t=0}=-2\cos(3x), && x>0,\label{eq-2.6.z}\\ &u|_{x=-t}=u_x|_{x=-t}=0,&&0<t <\infty.\label{eq-2.6.w} \end{align}
Solution. The general solution to (\ref{eq-2.6.x}) is \begin{equation} u(x,t) = \phi (x+\frac{t}{3}) + \psi (x-\frac{t}{3}). \label{eq-2.6.a} \end{equation}
Plugging into (\ref{eq-2.6.y}) and (\ref{eq-2.6.z}) we get \begin{align*} &\phi (x)+\psi(x)= 4\sin(3x)&& x>0,\\ &\phi(x)-\psi(x)=- 2\sin(3x) \end{align*} (the second equation after division by $\frac{1}{3}$ and integration). Therefore \begin{align} &\phi (x)= \sin(3x),&& \psi(x)= 3\sin(3x), && x>0, \label{eq-2.6.b} \end{align} which defines solution \begin{gather*} u=\sin(3x+t) +3\sin (3x-t) \end{gather*} in the zone $\{(x,t)\colon x> \frac{|t|}{3}\}$.
Plugging (\ref{eq-2.6.a}) into (\ref{eq-2.6.w}) we get \begin{equation} \phi(-\frac{2}{3}t)+ \psi(-\frac{4}{3}t) =0,\qquad \phi'(-\frac{2}{3}t)+ \psi'(-\frac{4}{3}t) =0, \qquad t>0; \label{eq-2.6.-c} \end{equation}
Integrating the last equation we get $2\phi(-\frac{2}{3}t)+ \psi(-\frac{4}{3}t) =C$ for $t>0$, then $\phi (x) =C$, $\psi (x) =-C$ for $x<0$ and since $\phi$ and $\psi$ must be continuous at $0$ we get $C=0$, and we get solution
\begin{gather*} u(x,t)= \left\{ \begin{aligned} &0 && x < -\frac{t}{3},\ t >0,\\ &\sin(3x+t) &&-\frac{t}{3}<x<\frac{t}{3},\ t >0. \end{aligned}\right. \end{gather*}
Example 8. Find continuous solution to \begin{align} &u_{tt}-4u_{xx}=0, && -\infty< t<\infty,\ x> 0,\label{B-3-1}\\ &u|_{t=0}= 4\cos (x), && x>0,\label{B-3-2}\\ &u_t|_{t=0}=16\sin(x), && x>0,\label{B-3-3}\\ &(u_x+u)|_{x=0}= 0, &&-\infty <t <\infty.\label{B-3-4} \end{align}
Solution. The general solution to (\ref{B-3-1}) is \begin{equation} u(x,t) = \phi (x+2t) + \psi (x-2t). \label{B-3-5} \end{equation}
Plugging into (\ref{B-3-2}) and (\ref{B-3-3}) we get \begin{align*} &\phi (x)+\psi(x)= 4\cos(x)&& x>0,\\ &\phi(x)-\psi(x)=-8 \cos(x) \end{align*} (the second equation after division by $2$ and integration). Therefore \begin{align} &\phi (x)= -2\cos(x),&& \psi(x)= 6\cos(x), && x>0, \label{B-3-6} \end{align} which defines solution $u= -2\cos(x+2t) +6\cos(x-2t)$ in the zone $\{(x,t)\colon x> 2|t|\}$.
Plugging (\ref{B-3-5}) into (\ref{B-3-4}) we get \begin{equation} 3\phi'(2t) -\psi'(-2t)=0, \label{B-3-7} \end{equation} which for $t>0$ (we know $\phi$) becomes \begin{gather*} \psi'(-2t)=-6 \sin(2t)\implies \psi'(x)= 6\sin(x) \implies \psi(x)= - 6\cos(x) +C \end{gather*} and since $\psi$ must be continuous at $0$ we get $C=4$, $\psi(x) = -6\cos(x)+4$ and we get solution $u= -2\cos(x+2t)-6\cos(x-2t)+4$ in the zone $\{(x,t)\colon t>0, 0<x<2t\}$.
For $ t<0$ we know $\psi$ and (\ref{B-3-7}) becomes \begin{gather*} \phi'(2t) = -2\sin(2t) \implies \phi'(x) = -2\sin(x)\implies \phi(x)=2\cos(x)+D \end{gather*} and since $\phi$ must be continuous at $0$ we get $D=-4$, $\phi(x) = 2\cos(x)-4$ and we get solution $u= 2 \cos(x+2t)+6\cos(x-2t)-4$ in the zone $\{(x,t)\colon t<0, 0<x<-2t\}$.
Consider wave equation in domain $\{a< x< b, t>0\}$ and initial conditions \begin{align} &u_{tt}-c^2 u_{xx}=0 \qquad &&a<x<b,\ t>0\label{eqn-2.6.21}\\ &u|_{t=0}=g(x) && a< x< b, \label{eqn-2.6.22}\\ &u_t|_{t=0}=h(x) && a< x< b.\label{eqn-2.6.23} \end{align} Here we take $f(x,t)=0$ for simplicity. Then according to the previous section solution $u(x,t)$ is defined uniquely in the characteristic triangle $ABC$.
Consider wave equation in domain $\{x>0, t>0\}$, initial conditions, and Dirichlet boundary condition \begin{align} &u_{tt}-c^2 u_{xx}=f(x,t) \qquad &&x>0, \label{eqn-2.6.24}\\ &u|_{t=0}=g(x) && x>0,\label{eqn-2.6.25}\\ &u_t|_{t=0}=h(x) && x>0,\label{eqn-2.6.26} \\ &u|_{x=0}=0. \label{eqn-2.6.27} \end{align} Alternatively, instead of (\ref{eqn-2.6.27}) we consider Neumann boundary condition \begin{align} & u_x |_{x=0}=0.\qquad&&\qquad\quad \tag*{$(48)'$}\label{eqn-2.6.27-'} \end{align}
Remark 1. It is crucial that we consider either Dirichlet or Neumann homogeneous boundary conditions.
To deal with this problem consider first IVP on the whole line: \begin{align} &U_{tt}-c^2 U_{xx}=F(x,t) \qquad &&x>0,\label{eqn-2.6.28}\\ &U|_{t=0}=G(x) && x>0,\label{eqn-2.6.29}\\ &U_t|_{t=0}=H(x) && x>0,\label{eqn-2.6.30} \end{align} and consider $V(x,t)= \varsigma U(-x,t)$ with $\varsigma =\pm 1$.
Proposition 1. If $U$ satisfies (\ref{eqn-2.6.28})-(\ref{eqn-2.6.30}) then $V$ satisfies similar problem albeit with right-hand expression $\varsigma F(-x,t)$, and initial functions $\varsigma G(-x)$ and $\varsigma H(-x)$.
Proof. Plugging $V$ into equation we use the fact that $V_t(x,t)=\varsigma U_t (-x,t)$, $V_x(x,t)=-\varsigma U_x (-x,t)$, $V_{tt}(x,t)=\varsigma U_{tt} (-x,t)$, $V_{tx}(x,t)=-\varsigma U_{tx} (-x,t)$, $V_{xx}(x,t)=\varsigma U_{xx} (-x,t)$ etc and exploit the fact that wave equation contains only even-order derivatives with respect to $x$.
Note that if $F,G,H$ are even functions with respect to $x$, and $\varsigma=1$ then $V(x,t)$ satisfies the same IVP as $U(x,t)$. Similarly, if $F,G,H$ are odd functions with respect to $x$, and $\varsigma=-1$ then $V(x,t)$ satisfies the same IVP as $U(x,t)$.
However we know that solution of (\ref{eqn-2.6.28})-(\ref{eqn-2.6.30}) is unique and therefore $U(x,t)=V(x,t)=\varsigma U(-x,t)$.
Therefore
Corollary 1.
However we know that
and we arrive to
Corollary 2.
Therefore
Corollary 3.
So far we have not used much that we have exactly wave equation (similar arguments with minor modification work for heat equation as well etc). Now we apply D'Alembert formula (2.5.4): \begin{multline*} u(x,t)= \frac{1}{2}\bigl( G(x+ct)+G(x-ct) \bigr) + \frac{1}{2c}\int_{x-ct} ^{x+ct} H(x')\,dx' +\\ \frac{1}{2c} \int_0^t \int _{x-c(t-t')} ^{x+c(t-t')} F(x',t')\, dx' dt' \end{multline*} and we need to take $0< x< ct$, resulting for $f=0\implies F=0$ \begin{equation} u(x,t)= \frac{1}{2}\bigl( g(ct+x)- g(ct-x) \bigr) + \frac{1}{2c}\int_{ct-x} ^{ct+x} h(x')\,dx' ,\qquad \label{eqn-2.6.31} \end{equation} and \begin{multline} u(x,t)= \frac{1}{2}\bigl( g(ct+x)+ g(ct-x) \bigr) +\\ \frac{1}{2c}\int_0 ^{ct-x} h(x')\,dx' + \frac{1}{2c}\int_0 ^{ct+x} h(x')\,dx'\qquad \tag*{(55)'}\label{eqn-2.6.31-'} \end{multline} for boundary condition (\ref{eqn-2.6.27}) and \ref{eqn-2.6.27-'} respectively.
Example 9. Consider wave equation with $c=1$ and let $f=0$,
Consider the same problem albeit on interval $0< x< l$ with either Dirichlet or Neumann condition on each end. Then we need to take odd continuation through "Dirichlet end" and even continuation through "Neumann end". On figures below we have respectively Dirichlet conditions on each end (indicated by red), Neumann conditions on each end (indicated by green), and Dirichlet condition on one end (indicated by red) and Neumann conditions on another end (indicated by green). Resulting continuations are $2l$, $2l$ and $4l$ periodic respectively.
Example 10. Consider $u(x,t)$ a solution of \begin{align*} &u_{tt}-9u_{xx}=0,\\ &u|_{t=0}=\sin (\pi x),\\ &u_{t}|_{t=0}=0 \end{align*} on $(0,1)$. In the cases of boundary conditions
Solution Let $G(x)$ be a corresponding continuation of $g(x)=\sin(\pi x)$. Then $u(x,t)= \frac{1}{2}\Bigl[G(x-3t)+G(x+3t)\Bigr]$ and we have \begin{align*} &u(.5,17.3)=\frac{1}{2}\Bigl[G (-51.4)+G(52.4)\Bigr]=\frac{1}{2}\Bigl[G (.6)+G(.4)\Bigr]. \end{align*}
2.6.A. Physical examples of boundary conditions