Solving Basic PDEs

4 minute read ·

Published:

A partial differential equation (PDE) is a relation involving one or more functions of several variables, and their partial derivatives. The order of a partial differential equation is the order of the highest partial derivative that appears in the equation.

There are three classical partial differential equations of order two which are very common in physical applications. They are known as the heat equation (1), the wave equation (2), and the Laplace equation (3).

ut=α22ux22ut2=c2u2x22ux2+2uy2=0\begin{align} &\frac{\partial u}{\partial t} = \alpha^2\frac{\partial^2u}{\partial x^2}\\ &\frac{\partial^2 u}{\partial t^2}=c^2\frac{\partial u^2}{\partial x^2}\\ &\frac{\partial ^2u}{\partial x^2}+\frac{\partial ^2u}{\partial y^2}=0 \end{align}

Heat Equation

Consider the boundary-value problem

ut=α22ux2;u(x,0)=f(x),0<x<l;u(0,t)=u(l,t)=0\begin{align*} \frac{\partial u}{\partial t} = \alpha^2\frac{\partial^2u}{\partial x^2}; &&u\left(x,0\right)=f\left(x\right), 0<x<l;&& u\left(0,t\right)=u\left(l,t\right)=0 \end{align*}

First, it’s easy to see that the equation is linear, which means any linear combination of solutions u1(x,t),,un(x,t)u_1\left(x,t\right),\dots,u_n\left(x,t\right) is again a solution. This suggests the following “plan” for solving this boundary-value problem.

  1. Find as many solutions ui(x,t)u_i\left(x,t\right) as we can that satisfies the boundary condition u(0,t)=u(l,t)=0u\left(0,t\right)=u\left(l,t\right)=0.
  1. Find a proper linear combination of uiu_i to satisfies the initial condition u(x,0)=f(x)u\left(x,0\right)=f\left(x\right).

An important method to solve partial differential equations is separation of variables, which means we first assume u(x,t)=X(x)T(t)u\left(x,t\right)=X\left(x\right)T\left(t\right). Then

ut=XT,2ux2=XT\begin{align*} \frac{\partial u}{\partial t}=XT', && \frac{\partial^2u}{\partial x^2}=X''T \end{align*}

Plug this in the original equation and get

XT=α2XTXT'=\alpha^2X''T

divide both side by α2XT\alpha^2XT gives

XX=Tα2T\frac{X''}{X}=\frac{T'}{\alpha^2T}

Notice that the left-hand side only depend on xx, while the right-hand side only depend on tt. The only way that they can equal for any xx and tt is that both of them are constant. Thus,

XX=λ,Tα2T=λ\begin{align*} \frac{X''}{X}=-\lambda, && \frac{T'}{\alpha^2T}=-\lambda \end{align*}

By separation of variable, we have transformed a PDE into two solvable ODEs,

X+λX=0,T+α2λT=0\begin{align*} X''+\lambda X=0, && T'+\alpha^2\lambda T=0 \end{align*}

Now, plug in the boundary condition.

0=u(0,t)=X(0)T(t),0=u(l,t)=X(l)T(t)\begin{align*} 0=u\left(0,t\right)=X\left(0\right)T\left(t\right), && 0=u\left(l,t\right)=X\left(l\right)T\left(t\right) \end{align*}

Since T(t)0T\left(t\right)\ne 0 (not identically zero, otherwise uu would be identically zero, and we have a trivial solution), we have X(0)=X(l)=0X\left(0\right)=X\left(l\right)=0.

Now, we only need to solve

X+λX=0;X(0)=0,X(l)=0\begin{align*} X''+\lambda X = 0; && X\left(0\right)=0, X\left(l\right)=0 \end{align*}

and

T+λα2T=0T'+\lambda\alpha^2T=0

The first one is a second-order, linear, constant coefficient ODE, which we can directly write out the solution. There are three different cases:

  • λ=0\lambda = 0: The general solution is X(x)=c1x+c2X\left(x\right)=c_1x+c_2 for some constant c1,c2c_1, c_2. Plug in the boundary condition, we have c1=c2=0c_1=c_2=0. Thus, there are no non-trivial solution for λ=0\lambda = 0.
  • λ<0\lambda<0: The general solution is X(x)=c1eλx+c1eλxX\left(x\right)=c_1e^{\sqrt{-\lambda}x}+c_1e^{\sqrt{-\lambda}x} for some constant c1,c2c_1,c_2. The boundary condition implies
c1+c2=0,c1eλl+c2eλl=0\begin{align*} c_1+c_2=0, && c_1e^{\sqrt{-\lambda}l}+c_2e^{-\sqrt{-\lambda}l}=0 \end{align*}

This linear system of equation has non-trivial solution c1,c2c_1, c_2 if and only if

det(11eλleλl)=eλleλl=0\det\left(\begin{matrix}1 &1\\ e^{\sqrt{-\lambda}l}&e^{-\sqrt{-\lambda}l}\end{matrix}\right)=e^{-\sqrt{-\lambda}l}-e^{\sqrt{-\lambda}l}=0

This implies e2λl=1e^{2\sqrt{-\lambda}l}=1, which is impossible since 2λl>02\sqrt{-\lambda}l>0. Therefore, there are also no non-trivial solution for λ<0\lambda < 0.

  • λ>0\lambda > 0: The general solution is X(x)=c1cosλx+c2sinλxX\left(x\right)=c_1\cos\sqrt{\lambda}x+c_2\sin\sqrt{\lambda}x for some constant c1,c2c_1,c_2 The boundary condition implies
c1=0,c2sinλl=0\begin{align*} c_1=0, && c_2\sin\sqrt{\lambda}l=0 \end{align*}

For c20c_2\ne0, we need to have λl=nπ\sqrt{\lambda}l=n\pi for positive integer nn, or λn=n2π2l2\displaystyle \lambda_n=\frac{n^2\pi^2}{l^2}. Then the equation has non-trivial solutions

X(x)=Xn(x)=sinnπxlX\left(x\right)=X_n\left(x\right)=\sin\frac{n\pi x}{l}

Then, we have the second equation,

T+n2π2α2l2T=0T'+\frac{n^2\pi^2\alpha^2}{l^2}T=0

which has solution

T(t)=Tn(t)=eα2n2π2t/l2T\left(t\right)=T_n\left(t\right)=e^{-\alpha^2n^2\pi^2t/l^2}

Hence, we have

un(x,t)=Xn(x)Tn(t)=sinnπxleα2n2π2t/l2u_n\left(x,t\right)=X_n\left(x\right)T_n\left(t\right)=\sin\frac{n\pi x}{l}e^{-\alpha^2n^2\pi^2t/l^2}

Finally, we need to use the initial condition to find a proper linear combination of unu_n’s, i.e., find coefficients cnc_n’s such that

u(x,t)=n=0cnsinnπxleα2n2π2t/l2u\left(x,t\right)=\sum_{n=0}^{\infty}c_n\sin\frac{n\pi x}{l}e^{-\alpha^2n^2\pi^2t/l^2}

satisfies u(x,0)=f(x)u\left(x,0\right)=f\left(x\right). This means that

f(x)=n=0cnsinnπxlf\left(x\right)=\sum_{n=0}^{\infty}c_n\sin\frac{n\pi x}{l}

It’s easily seen that cnc_n’s should be the Fourier coefficient of the pure sine expansion, which is

cn=2l0lf(x)sinnπxldxc_n=\frac{2}{l}\int_{0}^{l}f\left(x\right)\sin\frac{n\pi x}{l}\mathrm{d}x

Finally,

u(x,t)=2ln=0[0lf(x)sinnπxldx]sinnπxleα2n2π2t/l2u\left(x,t\right)=\frac{2}{l}\sum_{n=0}^{\infty}\left[\int_{0}^{l}f\left(x\right)\sin\frac{n\pi x}{l}\mathrm{d}x\right]\sin\frac{n\pi x}{l}e^{-\alpha^2n^2\pi^2t/l^2}

is the desired solution.

Wave Equation

Consider the boundary-value problem

2ut2=c22ux2;u(x,0)=f(x),ut(x,0)=g(x);u(0,t)=u(l,t)=0\begin{align*} \frac{\partial^2u}{\partial t^2}=c^2\frac{\partial^2 u}{\partial x^2}; && u\left(x,0\right)=f\left(x\right), u_t\left(x,0\right)=g\left(x\right); &&u\left(0,t\right)=u\left(l,t\right)=0 \end{align*}

This problem can also be solved by separation of variable. Let u(x,t)=X(x)T(t)u\left(x,t\right)=X\left(x\right)T\left(t\right), then

2ut2=XT,2ux2=XT\begin{align*} \frac{\partial^2u}{\partial t^2}=XT'', && \frac{\partial^2u}{\partial x^2}=X''T \end{align*}

Plug into the original equation, we have

TcT=XX=λ\frac{T''}{c^T}=\frac{X''}{X}=-\lambda

or two ODEs,

X+λX=0;X(0)=X(l)=0\begin{align*} X''+\lambda X=0; && X\left(0\right)=X\left(l\right)=0 \end{align*}

and

T+λc2T=0T''+\lambda c^2T=0

We’ve seen in the previous problem that the first equation has solutions

X(x)=Xn(x)=sinnπxlX\left(x\right)=X_n\left(x\right)=\sin\frac{n\pi x}{l}

For the second equation, it becomes

T+n2π2c2l2T=0T''+\frac{n^2\pi^2c^2}{l^2}T=0

The solutions are

T(t)=Tn(t)=ancosnπctl+bnsinnπctlT\left(t\right)=T_n\left(t\right)=a_n\cos\frac{n\pi ct}{l}+b_n\sin\frac{n\pi ct}{l}

Thus,

un(x,t)=sinnπxl[ancosnπctl+bnsinnπctl]u_n\left(x,t\right)=\sin\frac{n\pi x}{l}\left[a_n\cos\frac{n\pi ct}{l}+b_n\sin\frac{n\pi ct}{l}\right]

is a non-trivial solution of the BVP for every positive integer nn, and every suitable constants an,bna_n, b_n. The linear combination

u(x,t)=n=1sinnπxl[ancosnπctl+bnsinnπctl]u\left(x,t\right)=\sum_{n=1}^{\infty}\sin\frac{n\pi x}{l}\left[a_n\cos\frac{n\pi ct}{l}+b_n\sin\frac{n\pi ct}{l}\right]

satisfies

u(x,0)=n=1ansinnπxl,ut(x,0)=n=1nπclbnsinnπxl\begin{align*} u\left(x,0\right)=\sum_{n=1}^{\infty}a_n\sin\frac{n\pi x}{l}, && u_t\left(x,0\right)=\sum_{n=1}^{\infty}\frac{n\pi c}{l}b_n\sin\frac{n\pi x}{l} \end{align*}

To satisfy the initial condition, we only need to have

f(x)=n=1ansinnπxl,g(x)=n=1nπclbnsinnπxl\begin{align*} f\left(x\right)=\sum_{n=1}^{\infty}a_n\sin\frac{n\pi x}{l}, && g\left(x\right)=\sum_{n=1}^{\infty}\frac{n\pi c}{l}b_n\sin\frac{n\pi x}{l} \end{align*}

By Fourier sine expansion, we have

an=2l0lf(x)sinnπxldx,bn=2nπc0lg(x)sinnπxldx\begin{align*} a_n=\frac{2}{l}\int_{0}^{l}f\left(x\right)\sin\frac{n\pi x}{l}\mathrm{d}x, && b_n=\frac{2}{n\pi c}\int_0^{l}g\left(x\right)\sin\frac{n\pi x}{l}\mathrm{d}x \end{align*}

Categories: Mathematics