Artificial Intelligence 🤖
Differential equations
The 1D wave equation: d'Alembert's solution

The 1D wave equation: d'Alembert's solution

We now look at the 1D1 \mathrm{D} wave equation,

2yt2=c22yx2\frac{\partial^{2} y}{\partial t^{2}}=c^{2} \frac{\partial^{2} y}{\partial x^{2}}

the wave equation (2.166) is the simplest equation which is second order in both independent variables and it represents a combination of Newton's second law (F=ma)(F=m a) and Hooke's law (F=kΔx)(F=k \Delta x) where kk is some constant representing elasticity. The constant c2c^{2} gives a ratio of mass density and elasticity. The equation may be solved using the method of separation of variables discussed in the previous sections. Here, we choose to solve this by introducing a change of variable.

As a motivation to the method, let us define the following operator for the 1D wave equation,

=1c22yt22yx2\square=\frac{1}{c^{2}} \frac{\partial^{2} y}{\partial t^{2}}-\frac{\partial^{2} y}{\partial x^{2}}

this is known as the d'Alembert operator2 In this case the operator acts on the function y(x,t)y(x, t). Now, observe that, while cc is constant, the d'Alembert operator can be factored:

=(tcx)(t+cx);\square=\left(\frac{\partial}{\partial t}-c \frac{\partial}{\partial x}\right)\left(\frac{\partial}{\partial t}+c \frac{\partial}{\partial x}\right) ;

when this acts on yy, it gives us the 1D wave equation as given in Eq. (2.166). This factorisation implies that we can look for solutions that satisfy the individual first order equations:

ytcyx=0 and yt+cyx=0.y_{t}-c y_{x}=0 \text { and } y_{t}+c y_{x}=0 .

Note that we have seen this type of first order PDE in Subsec. 2.2.1. Using the method of characteristics, we showed that the general solution to the PDE takes the form,

y(x,t)=f(x±ct).y(x, t)=f(x \pm c t) .

The general solution to Eq. (2.166) can therefore be constructed by forming linear combinations of the two solutions, namely:

y(x,t)=f(x+ct)+g(xct).y(x, t)=f(x+c t)+g(x-c t) .

Let us now derive this using the change of variables technique. Suppose we have:

X=xct and Y=x+ct,X=x-c t \text { and } Y=x+c t,

motivated by what we discussed above. In terms of these new variables, we have:

x=XxX+YxY=X+Yt=XtX+YtY=cX+cY\begin{aligned} \frac{\partial}{\partial x} & =\frac{\partial X}{\partial x} \frac{\partial}{\partial X}+\frac{\partial Y}{\partial x} \frac{\partial}{\partial Y}=\frac{\partial}{\partial X}+\frac{\partial}{\partial Y} \\ \frac{\partial}{\partial t} & =\frac{\partial X}{\partial t} \frac{\partial}{\partial X}+\frac{\partial Y}{\partial t} \frac{\partial}{\partial Y}=-c \frac{\partial}{\partial X}+c \frac{\partial}{\partial Y} \end{aligned}

We compute the following to substitute back in Eq. (2.166):

2yx2=(X+Y)(yX+yY)=2yX2+22yXY+2yY22yt2=(cX+cY)(cyX+cyY)=c22yX22c22yXY+c22yY2\begin{gathered} \frac{\partial^{2} y}{\partial x^{2}}=\left(\frac{\partial}{\partial X}+\frac{\partial}{\partial Y}\right)\left(\frac{\partial y}{\partial X}+\frac{\partial y}{\partial Y}\right)=\frac{\partial^{2} y}{\partial X^{2}}+2 \frac{\partial^{2} y}{\partial X \partial Y}+\frac{\partial^{2} y}{\partial Y^{2}} \\ \frac{\partial^{2} y}{\partial t^{2}}=\left(-c \frac{\partial}{\partial X}+c \frac{\partial}{\partial Y}\right)\left(-c \frac{\partial y}{\partial X}+c \frac{\partial y}{\partial Y}\right)=c^{2} \frac{\partial^{2} y}{\partial X^{2}}-2 c^{2} \frac{\partial^{2} y}{\partial X \partial Y}+c^{2} \frac{\partial^{2} y}{\partial Y^{2}} \end{gathered}

2{ }^{2} it really is represented by a box. Then, upon substitution of Eqs. (2.175) and (2.176), yields:

4c22yXY=04 c^{2} \frac{\partial^{2} y}{\partial X \partial Y}=0

which, upon dividing through by 4c24 c^{2}, we can express as:

X(yY)=0\frac{\partial}{\partial X}\left(\frac{\partial y}{\partial Y}\right)=0

This tells us that the term y/Y\partial y / \partial Y is independent of XX and can therefore be written as:

yY=f(Y)\frac{\partial y}{\partial Y}=f(Y)

where f(Y)f(Y) is an arbitary function of YY only. Integrating Eq. (2.179) with respect to YY yields,

y(X,Y)=F(Y)+G(X),y(X, Y)=F(Y)+G(X),

where F(Y)=f(Y)dYF(Y)=\int f(Y) d Y and G(X)G(X) is an arbitrary function of the variable we have kept constant in the integration (i.e. XX ). Writing the solution in terms of the original variables gives:

y(x,t)=F(x+ct)+G(xct).y(x, t)=F(x+c t)+G(x-c t) .

The solution to the wave equation is a superposition of two travelling waves, one travelling from right to left [given by F(x+ct)F(x+c t) ] and the second travelling from left to right [given by G(xct)G(x-c t). The two wave profiles FF and GG are determined by the initial conditions. The initial conditions are defined for yy and yty_{t} for all values of xx in the spatial domain we are interested to solve the PDE\mathrm{PDE} and at an initial time, say t=0t=0. Suppose these are given as

y(x,0)=p(x) and yt(x,0)=q(x).y(x, 0)=p(x) \text { and } y_{t}(x, 0)=q(x) .

Using the solution (2.181), we write:

p(x)=F(x)+G(x) and q(x)=cF(x)cG(x).p(x)=F(x)+G(x) \text { and } q(x)=c F^{\prime}(x)-c G^{\prime}(x) .

Differentiating p(x)p(x) once, we get the following pair of equations:

p(x)=F(x)+G(x) and q(x)=cF(x)cG(x).p^{\prime}(x)=F^{\prime}(x)+G^{\prime}(x) \text { and } q(x)=c F^{\prime}(x)-c G^{\prime}(x) .

We can solve Eqs. (2.184) for FF^{\prime} and GG^{\prime} as follows:

F(x)=12[p(x)+1cq(x)] and G(x)=12[p(x)1cq(x)],F^{\prime}(x)=\frac{1}{2}\left[p^{\prime}(x)+\frac{1}{c} q(x)\right] \text { and } G^{\prime}(x)=\frac{1}{2}\left[p^{\prime}(x)-\frac{1}{c} q(x)\right],

which, upon integrating yield:

F(x)=12[p(x)+1cxq(s)ds] and G(x)=12[p(x)1cxq(s)ds].F(x)=\frac{1}{2}\left[p(x)+\frac{1}{c} \int^{x} q(s) d s\right] \text { and } G(x)=\frac{1}{2}\left[p(x)-\frac{1}{c} \int^{x} q(s) d s\right] .

These give the solution in the final form:

y(x,t)=12[p(x+ct)p(xct)]+1cxctx+ctq(s)ds.y(x, t)=\frac{1}{2}[p(x+c t)-p(x-c t)]+\frac{1}{c} \int_{x-c t}^{x+c t} q(s) d s .

A nice feature of the solution given by Eq. (2.187) is that if pp and qq are discontinuous functions the solution is still valid and makes sense considering it from a distributional perspective. Note also that when we have boundary conditions representing the value of the function yy or its spatial derivative yxy_{x} at particular points in the xx domain (say at x=x0x=x_{0} and x=x1x=x_{1} ) it is usually best to use the method of separation of variables to solve Eq. (2.166).