$$ \usepackage{derivative} \newcommand{\odif}[1]{\mathrm{d}#1} \newcommand{\odv}[2]{\frac{ \mathrm{d}#1}{\mathrm{d}#2}} \newcommand{\pdv}[2]{\frac{ \partial#1}{\partial#2}} \newcommand{\th}{\theta} \newcommand{\p}{\partial} \newcommand{\var}[1]{\text{Var}\left(#1\right)} \newcommand{\sd}[1]{\sigma\left(#1\right)} \newcommand{\cov}[1]{\text{Cov}\left(#1\right)} \newcommand{\cexpec}[2]{\mathbb{E}\left[#1 \vert#2 \right]} $$
4 Partial Differential Equations
We now move on to our next topic: partial differential equations. First a definition, which you may recall from a few weeks ago: Any equation involving functions of two or more variables and some of its derivatives is a partial differential equation.
Partial differential equations are both very important, and very difficult to solve. In this chapter, we’ll talk about a handful of useful techniques that will help us to solve equations in a bunch of special cases. These will get us quite a long way, but certainly not as far as we can get with ordinary differential equations; trying to find solutions to a broader class of PDEs is difficult enough to be a whole career for many, many mathematicians.
In a lot of cases, “solving” a partial differential equation means “guessing what the solution looks like and then proving that we’re right”. This is a perfectly valid approach to the world, and is called “applied mathematics”.
Before getting into how to solve them, let’s first look at a few examples:
4.1 Some important partial differential equations
These are a few examples of differential equations that we would want to solve.
Thinking about the wave equation is a good opportunity to revisit the idea of the gradient operator. In Chapter 3, we thought about \[\begin{aligned} \boldsymbol{\nabla} = \boldsymbol{i} \pdv{}{x} + \boldsymbol{j} \pdv{}{y}, \end{aligned}\] and said that when we calculate \(\boldsymbol{\nabla}f\) we can “multiply through” to put the \(f\) inside the vector.
Let’s boldly take the dot product of \(\boldsymbol{\nabla}\) with itself2. \[\begin{aligned} \nabla^2 &= \boldsymbol{\nabla} \cdot \boldsymbol{\nabla} \\ & = \left( \boldsymbol{i} \pdv{}{x} + \boldsymbol{j} \pdv{}{y} \right) \cdot \left( \boldsymbol{i} \pdv{}{x} + \boldsymbol{j} \pdv{}{y} \right) \\ & = \pdv{^2 }{x^2} + \pdv{^2 }{y^2}. \end{aligned}\]
This differential operator is called the Laplacian. In three (spatial) dimensions, we have \[\begin{aligned} \nabla^2 = \pdv{^2 }{x^2} + \pdv{^2 }{y^2} + \pdv{^2 }{z^2}; \end{aligned}\] as we go higher, we get more and more terms.
Using the Laplacian, we can write \[\begin{aligned} \nabla^2 u = \frac{1}{c^2} \pdv{^2 }{t^2} u. \end{aligned}\]
Note that the Laplacian only involves derivatives with respect to spatial variables - so the Laplacian of \(u(t,x,y)\) is \[\nabla^2 u = \pdv{^2 u}{x^2} + \pdv{^2 u}{y^2},\] and we don’t include the second partial derivative corresponding to time.
A common factor in these examples is that they are linear: the variable in question, \(u\), appears at most linearly in the problem. This is not a coincidence: they’re all deliberately chosen to be examples that we can solve. Solving nonlinear PDEs is much harder, and in general there is no very simple way to do it.
4.2 Partial differential equations: dealing with special cases
In this section, we’ll start to develop some tips and tricks for solving PDEs. We’ll start with a couple of simpler techniques, and build up to more powerful ones. The first couple come under the category of “educated guessing”.
Technique 1: Just spot the solution
Sometimes, the PDE is simple enough that we can just spot its solution. For example, if all the derivatives are with respect to the same variable, we can treat the PDE “like an ODE”, as long as we remember that “constants of integration” now means “functions that don’t depend on (e.g.) \(x\)”.
Technique 2: Direct integration
In some cases, we can just integrate the right-hand side of the PDE. This is really an extension of Technique 1, applied to slightly less straightforward examples. The key thing to remember here is that instead of constants of integration, we always get functions of the “other” variables.
Technique 3: When all the derivatives are in only one variable
If all the derivatives in the PDE are taken with respect to the same variable (say, \(x\)), then we can treat it “as though it were an ODE” in \(x\).
In some cases, we can use a substitution such as \(p(x,y) = \pdv{u}{x}\) to turn a PDE into an ODE; then, once we’ve solved the ODE for \(p\), we just integrate it to find \(u\).
Essentially there are not many rules except that the standard techniques for ODEs work, until the moment that they don’t. Usually if there are no \(y\) derivatives they will work.
Technique 4: Using a change of coordinates
Sometimes a change of coordinates can turn a PDE that looks difficult into one that looks much simpler. You can usually spot these when your equation looks like \[\begin{aligned} \pdv{u}{x} = c \pdv{u}{t}. \end{aligned}\] This will also work if you’ve got higher-order partial derivatives, as long as they’re not mixed, for example, \[\begin{aligned} \pdv{^3 u}{x^3} = c \pdv{^3 u}{t^3}. \end{aligned}\]
The idea here is to try writing \[\begin{aligned} u(x,t) = f(x + \alpha t). \end{aligned}\]
If you like, you can think of this as the composition of \(f\) with \(s(x,t) = x+\alpha t\). Then the chain rule tells us that \[\begin{aligned} \pdv{u}{x} &= \odv{f}{s} \pdv{s}{x} = f'(x+\alpha t) \\ \pdv{u}{t} &= \odv{f}{s} \pdv{s}{t} = \alpha f'(x+\alpha t). \end{aligned}\] When we look into the conditions we’d need to impose on \(f\) to make the equation work, we usually only find one or two (usually, we can work out the value \(\alpha\) needs to take, and we need \(f\) to be differentiable).
4.3 Separation of variables: solving more general linear PDEs
The final technique we will learn is the method of separation of variables, which can be used to solve a more general class of linear PDEs. The basic idea is to convert the PDE into an ODE, which we can figure out how to solve.
The big idea here is to ask ourselves: if we can write \(u(x,t)\) as a product of a function depending only on \(x\), with a function depending only on \(t\), will that make this equation easier to solve?. The answer, in many cases, is yes.
To explain the method of separation of variables, we use our old friend the wave equation3.
ODE recap
Let’s remind ourselves how to solve \[X_{xx}(x)-pX(x)=0,\] where \(X=X(x)\) and \(p\) is a real number. The general solution depends on \(p\).
If \(p=0\), we integrate as usual to find \[X=Ax+B\] where \(A,B\) are constant.
If \(p=\alpha^{2}>0\), i.e. \(p\) is positive, the equation is linear. So we have the auxiliary equation \[\lambda^2 - p = 0,\] and we find that \(\lambda=\pm\alpha\). The general solution is \[X=Ae^{\alpha x}+Be^{-\alpha x}\] where \(A,B\) are constant.
If \(p=-k^{2}<0\), i.e. \(p\) is negative, again we can form the auxiliary equation, which is the same as above, except that now we find \(\lambda=\pm ik\). So the general solution is \[X=Ce^{ikx}+De^{-ikx}\] where \(C,D\) are constant. Alternatively we can write \[X=A\sin(kx)+B\cos(kx). \tag{4.1}\]
Note the difference in character between the case where \(p\) is positive and negative; in one case we get oscillatory solutions and in the other case we get exponentially growing and falling solutions.
Let’s go back to the wave equation.
Another example of a PDE where the method of separation of variables can help us is the diffusion equation.