Artificial Intelligence 🤖
Differential equations
Laplace's equation

Laplace's equation

If we start from the 1D heat equation and extend to 2D, we have the following PDE:

ut=α2(2ux2+2uy2),\frac{\partial u}{\partial t}=\alpha^{2}\left(\frac{\partial^{2} u}{\partial x^{2}}+\frac{\partial^{2} u}{\partial y^{2}}\right),

where u=u(x,y,t)u=u(x, y, t) is used to represent temperature. If we now consider 'steady state' as tt \rightarrow \infty, there is no change of uu with time, tt and Eq. (2.121) reduces to:

2ux2+2uy2=0\frac{\partial^{2} u}{\partial x^{2}}+\frac{\partial^{2} u}{\partial y^{2}}=0

Suppose the PDE is defined in a 'box' with 0xL0 \leq x \leq L and 0yH0 \leq y \leq H. We are looking for solutions that satisfy Laplace's equation given by Eq. (2.122). These are known as harmonic solutions defined as real functions with continuous second derivatives in xx and yy that satisfy (2.122). We first solve Laplace's equation in a disc followed by solving the PDE in the box defined above.

In a rectangle

We now return to Eq. (2.122) with 0xL0 \leq x \leq L and 0yH0 \leq y \leq H. Again, we need 4 boundary conditions to solve this problem and these are given by:

u(0,y)=g1(y),u(L,y)=g2(y),u(x,0)=f1(x),u(x,H)=f2(x).u(0, y)=g_{1}(y), u(L, y)=g_{2}(y), u(x, 0)=f_{1}(x), u(x, H)=f_{2}(x) .

As indicated in Section 2.4 we expect the solution to the PDE to be separable if the PDE is linear and homogeneous with homogeneous boundary conditions. The problem given by Eq. (2.122) is subject to inhomogeneous boundary conditions as given by (2.123) (see also a picture of the problem we wish to solve in Fig. 2.121 and it is referred to as the Dirichlet problem on a rectangle. We want to use the method of separation of variables and so we need homogeneous boundary conditions. The idea for the solution is to break the problem into simpler problems which have sufficient homogeneous boundary conditions and use superposition of solutions to obtain the final solution to Eq. (2.122) subject to Eqs. (2.123). This decomposition is shown in Fig. 2.7.

Problem 1

We start off with the leftmost box shown in Fig. 2.7 labelled Problem 1. The solution to the first problem (we denote this by u1u_{1} ), statisfies the following:

u1xx+u1yy=0,u1(0,y)=u1(L,y)=u1(x,H)=0 and u1(x,0)=f1(x).u_{1_{x x}}+u_{1_{y y}}=0, u_{1}(0, y)=u_{1}(L, y)=u_{1}(x, H)=0 \text { and } u_{1}(x, 0)=f_{1}(x) .

The separated solution takes the form:

u1(x,y)=X(x)Y(y).u_{1}(x, y)=\mathcal{X}(x) \mathcal{Y}(y) .

We use the homogeneous boundary conditions to solve for the eigenvalues, λ\lambda and eigenfunctions, Xn,Yn\mathcal{X}_{n}, \mathcal{Y}_{n} as previously outlined in these notes and finally, we match the solution to the last boundary condition given by u1(x,0)=f1(x)u_{1}(x, 0)=f_{1}(x). Upon substitution of the separated solution (2.125) in Eq. (2.122), we have:

XX=YY=λ\frac{\mathcal{X}^{\prime \prime}}{\mathcal{X}}=-\frac{\mathcal{Y}^{\prime \prime}}{\mathcal{Y}}=-\lambda

Figure 2.6: Inhomogeneous Dirichlet boundary conditions on a rectangular domain as given by PDE (2.122) subject to BCs (2.123)

Figure 2.7: Decomposition of the inhomogeneous Dirichlet boundary value problem into four simpler problems each having 3 boundaries subject to homogeneous conditions (i.e. u=0u=0 ) and one boundary that has inhomogeneous conditions.

which leads to:

X+λX=0,YλY=0\mathcal{X}^{\prime \prime}+\lambda \mathcal{X}=0, \mathcal{Y}^{\prime \prime}-\lambda \mathcal{Y}=0

Note that we could choose +λ+\lambda for the constant in Eq. (2.126) as we still obtain the same solutions from the two second order ODEs. We obtain the eigenvalues and the corresponding eigenfunctions from the X\mathcal{X} equation as:

λn=nπL,Xn=sin(nπxL),n=1,2,\lambda_{n}=\frac{n \pi}{L}, \mathcal{X}_{n}=\sin \left(\frac{n \pi x}{L}\right), n=1,2, \ldots

where we have used X(0)=X(L)=0\mathcal{X}(0)=\mathcal{X}(L)=0. Using the eigenvalues, λn\lambda_{n} and the boundary condition Y(H)=0\mathcal{Y}(H)=0, we obtain the Y\mathcal{Y} solutions as follows:

Yn=sinh(nπL(yH)).\mathcal{Y}_{n}=\sinh \left(\frac{n \pi}{L}(y-H)\right) .

Now, using the X\mathcal{X} and Y\mathcal{Y} solutions in Eq. (2.125), we have:

u1n(x,y)=Bnsin(nπxL)sinh(nπL(yH)),n=1,2,u_{1_{n}}(x, y)=B_{n} \sin \left(\frac{n \pi x}{L}\right) \sinh \left(\frac{n \pi}{L}(y-H)\right), \quad n=1,2, \ldots

where BnB_{n} is an arbitrary constant. The functions unu_{n} satisfy all homogeneous boundary conditions of Problem 1 . We match the last condition at y=0y=0, i.e. u(x,0)=f1(x)u(x, 0)=f_{1}(x) by superimposing all solutions

u1(x,y)=n=1Bnsin(nπxL)sinh(nπL(yH)),u_{1}(x, y)=\sum_{n=1}^{\infty} B_{n} \sin \left(\frac{n \pi x}{L}\right) \sinh \left(\frac{n \pi}{L}(y-H)\right),

evaluating Eq. (2.131) at y=0y=0 and equating to f1(x)f_{1}(x). Finally, the solution to Problem 1 is given as follows:

u1(x,y)=n=1Bnsin(nπxL)sinh(nπL(yH)),u_{1}(x, y)=\sum_{n=1}^{\infty} B_{n} \sin \left(\frac{n \pi x}{L}\right) \sinh \left(\frac{n \pi}{L}(y-H)\right),

where BnB_{n} is obtained from:

Bn=2Lsinh(nπHL)0Lf1(x)sin(nπxL).B_{n}=-\frac{2}{L \sinh \left(\frac{n \pi H}{L}\right)} \int_{0}^{L} f_{1}(x) \sin \left(\frac{n \pi x}{L}\right) .

We have outlined the solution steps for one of the four cases, namely the solution for u1u_{1}. Repeating the steps for the Problems 2, 3 and 4 shown in Fig. 2.7 allows us to find solutions for u2,u3u_{2}, u_{3} and u4u_{4}, respectively. As Laplace's equation is linear, we know that it will obey the superposition principle hence we can write the solution to Eq. (2.122) subject to the boundary conditions given by (2.123) as:

u(x,y)=u1+u2+u3+u4.u(x, y)=u_{1}+u_{2}+u_{3}+u_{4} .

In a disc

In what follows, we solve Eq. (2.122) using the method of separation of variables in a disc. We switch to polar coordinates using x=rcosθx=r \cos \theta and y=rsinθy=r \sin \theta; upon substitution in Eq. (2.122), we have:

1rr(rur)+1r22ur2=0,\frac{1}{r} \frac{\partial}{\partial r}\left(r \frac{\partial u}{\partial r}\right)+\frac{1}{r^{2}} \frac{\partial^{2} u}{\partial r^{2}}=0,

where u=u(r,θ)u=u(r, \theta), defined in the interval 0rr00 \leq r \leq r_{0} and πθπ-\pi \leq \theta \leq \pi. Note that the point ±π\pm \pi identifies in the disc and r0r_{0} is the radius of the disc.

We need four boundary conditions to solve this problem: two for rr and two for θ\theta (since we have second order derivatives in rr and θ\theta ):

  1. Shape of bounded region at r=r0r=r_{0}
u(r0,θ)=f(θ)u\left(r_{0}, \theta\right)=f(\theta)

where f(θ)f(\theta) specifies the temperature at the boundary of the disc.

  1. Periodic boundary conditions in θ\theta
u(r,π)=u(r,π) and uθ(r,π)=uθ(r,π);u(r,-\pi)=u(r, \pi) \text { and } \frac{\partial u}{\partial \theta}(r,-\pi)=\frac{\partial u}{\partial \theta}(r, \pi) ;

since at ±π\pm \pi, the two ends meet. These give the 2 boundary conditions we need for θ\theta.

  1. Boundedness condition

We need a final condition for rr. From the PDE (2.135), we see that as r0,1/rr \rightarrow 0,1 / r \rightarrow \infty which leads to Eq. (2.135) blowing up [2.135) is then said to be singular]. Mathematically, this implies that the temperature in the centre of the disc (i.e at r=0r=0 ) is infinite. However, physically, we know that the temperature in the centre takes a finite value. We therefore introduce the following boundedness condition:

u(0,θ)<.|u(0, \theta)|<\infty .

Equation (2.138) ensures a finite value for the temperature at the centre of the disc.

The PDE (2.135) together with the above boundary conditions constitutes the so-called Dirichlet problem on a disc. We seek solutions of the form,

u(r,θ)=R(r)Θ(θ).u(r, \theta)=R(r) \Theta(\theta) .

Following the algorithm given in Subsec. 2.4 we obtain the following two ODEs:

Θ+λΘ=0r2R+rRλR=0;\begin{aligned} \Theta^{\prime \prime}+\lambda \Theta & =0 \\ r^{2} R^{\prime \prime}+r R^{\prime}-\lambda R & =0 ; \end{aligned}

where R=R(r)R=R(r) and Θ=Θ(θ)\Theta=\Theta(\theta). We first solve Eq. (2.140) to determine the eigenvalues λ\lambda (note that from Subsec. 2.3.2, for an ODE of the form of (2.140) with periodic boundary conditions, there exist no strictly negative eigenvalues; i.e. in Eqs. (2.140) and (2.141), λ0\lambda \geq 0 ). Finally, note that Eq. (2.141) is a second order, linear ODE known as the Euler differential equation which can be solved using the ansatz R(r)=rpR(r)=r^{p}. The eigenvalues are calculated as λn=n2\lambda_{n}=n^{2} for n0n \geq 0 which give the eigenfunctions for Θ(θ)\Theta(\theta) as:

Θn(θ)=ancos(nθ)+bnsin(nθ).\Theta_{n}(\theta)=\overline{a_{n}} \cos (n \theta)+\overline{b_{n}} \sin (n \theta) .

Next, we need the solutions for R(r)R(r) so that we can form the PDE solution [given by (2.139) ] making use of Eq. (2.142). Now, using the ansatz R=rpR=r^{p} and the fact that we have found that λ=n2\lambda=n^{2}, we calculate the exponent pp as p=±n,n0p= \pm n, n \geq 0. We need to consider the two cases separately: n=0n=0 (in which case p=n=0p=n=0 is a repeated root) and n>0n>0. For the case where n=0n=0, the ODE (2.141) with λ=n2=0\lambda=n^{2}=0 becomes r2R+rR=0r^{2} R^{\prime \prime}+r R^{\prime}=0 whose general solution is

R(r)=c1lnr+c2.R(r)=c_{1} \ln r+c_{2} .

For the case where n>0n>0,

R(r)=c3rn+c4rn.R(r)=c_{3} r^{n}+c_{4} r^{-n} .

The boundedness condition (2.138) translates to R(0)<|R(0)|<\infty. To see this, apply (2.138) by setting r=0r=0 in Eq. (2.139). Now let us consider the behaviour of solutions (2.143) and (2.144) as r0r \rightarrow 0. In order for u(r,θ)u(r, \theta) to be finite, R(r)R(r) needs to be finite. So, since as r0,lnrr \rightarrow 0, \ln r \rightarrow-\infty and rnr^{-n} \rightarrow \infty, we need to set the arbitrary constants c1c_{1} and c4c_{4} to 0 such that contributions from lnr\ln r and rnr^{-n}, vanish. Taking the above into account, we write down the solution for R(r)R(r) as follows:

Rn(r)=cnrn,n0.R_{n}(r)=\overline{c_{n}} r^{n}, n \geq 0 .

Finally, substituting Eqs. (2.142) and (2.145) in (2.139), we have:

un(r,θ)=a02+n=1rn[ancos(nθ)+bnsin(nθ)],u_{n}(r, \theta)=\frac{a_{0}}{2}+\sum_{n=1}^{\infty} r^{n}\left[a_{n} \cos (n \theta)+b_{n} \sin (n \theta)\right],

where an=ancn(n0)a_{n}=\overline{a_{n} c_{n}}(n \geq 0) and bn=bncn(n1)b_{n}=\overline{b_{n}} \overline{c_{n}}(n \geq 1).

The solution to Laplace's equation on a disc is given by Eq. (2.146), represented by a full Fourier series where ana_{n} and bnb_{n} are the Fourier coefficients calculated the usual way (see Topic B1). To determine these, we need to use the final boundary condition given by Eq. (2.136). The specific form of the coefficients therefore is determined by the boundary function f(θ)f(\theta). For the unit disc, r0=1r_{0}=1, these are:

an=1πππf(θ)cos(nθ)dθ, and bn=1πππf(θ)sin(nθ)dθa_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\theta) \cos (n \theta) d \theta, \text { and } b_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\theta) \sin (n \theta) d \theta \text {. }

Poisson integral

While Eq. (2.146) represents the solution to Laplace's equation, it is given in the form of an infinite series. Generally, as we include more modes in the solution (i.e. high nn ) then we have a better approximation to the exact solution. It is possible however to transform solution (2.146) into a definite integral independent of a series by making use of the sum to infinity formula for an infinite series. This is done via the Poisson integral.

We start from Eq. (2.146) together with the formulae given by Eqs. (2.147). We express the Fourier coefficient formulae in terms of ϕ\phi, i.e.:

an=1πππf(ϕ)cos(nϕ)dϕ, and bn=1πππf(ϕ)sin(nϕ)dϕ.a_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi) \cos (n \phi) d \phi, \text { and } b_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi) \sin (n \phi) d \phi .

Upon substitution, we have:

un(r,θ)=12(1πππf(ϕ)dϕ)+n=1rn[(1πππf(ϕ)cos(nϕ)dϕ)cos(nθ)+(1πππf(ϕ)sin(nϕ)dϕ)sin(nθ)],\begin{aligned} u_{n}(r, \theta) & =\frac{1}{2}\left(\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi) d \phi\right)+\sum_{n=1}^{\infty} r^{n}\left[\left(\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi) \cos (n \phi) d \phi\right) \cos (n \theta)\right. \\ & \left.+\left(\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi) \sin (n \phi) d \phi\right) \sin (n \theta)\right], \end{aligned}

where the terms in blue are the Fourier coefficient formulae. Equation (2.149) simplifies to:

un(r,θ)=1πππf(ϕ)[12+n=1rncos[nα]]dϕu_{n}(r, \theta)=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi)\left[\frac{1}{2}+\sum_{n=1}^{\infty} r^{n} \cos [n \alpha]\right] d \phi

where we have made use of the sum-difference identity to obtain the cos(nα)\cos (n \alpha) term where α\alpha is defined as α=θϕ\alpha=\theta-\phi.

We continue by defining the complex variable zz as:

z=reiα=r(cosα+isinα)z=r e^{i \alpha}=r(\cos \alpha+i \sin \alpha)

and znz^{n} is:

zn=rneinα=r[cos(nα)+isin(nα)].z^{n}=r^{n} e^{i n \alpha}=r[\cos (n \alpha)+i \sin (n \alpha)] .

The real and imaginary parts of (2.152) are:

Re(zn)=rncos(nα), and Im(zn)=rnsin(nα).\operatorname{Re}\left(z^{n}\right)=r^{n} \cos (n \alpha) \text {, and } \operatorname{Im}\left(z^{n}\right)=r^{n} \sin (n \alpha) .

Using these definitions, Eq. (2.150) becomes:

un(r,θ)=1πππf(ϕ)[12+n=1Re(zn)]dϕu_{n}(r, \theta)=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi)\left[\frac{1}{2}+\sum_{n=1}^{\infty} \operatorname{Re}\left(z^{n}\right)\right] d \phi

where the term in the square brackets is known as the Poisson kernel. Now, provided that z<1|z|<1, we have the following result for the infinite series:

n=0zn=11z\sum_{n=0}^{\infty} z^{n}=\frac{1}{1-z}

note that the series starts from n=0n=0 while in Eq. (2.154), the series starts from n=1n=1. Our assumption z<1|z|<1 is obvious from Eq. (2.151), since we know that r<1|r|<1 (recall we chose the radius of the disc to be r0=1r_{0}=1 ). For the more general case, the rr term in Eq. (2.151) is replaced by r/r0r / r_{0} and the z<1|z|<1 assumption still holds. Next, we make use of Eq. (2.155) in Eq. (2.154) to determine the sum given by n=1Re(zn)\sum_{n=1}^{\infty} \operatorname{Re}\left(z^{n}\right). From Eq. (2.155), we expand the first term out of the series to get:

n=0zn=1+n=1zn=11z,\sum_{n=0}^{\infty} z^{n}=1+\sum_{n=1}^{\infty} z^{n}=\frac{1}{1-z},

which gives:

n=1zn=1+11z.\sum_{n=1}^{\infty} z^{n}=-1+\frac{1}{1-z} .

We express the term in the square brackets in Eq. (2.154) as:

12+n=1Re(zn)=12+Re(11z),=Re(1+zzzz21z2),\begin{aligned} \frac{1}{2}+\sum_{n=1}^{\infty} \operatorname{Re}\left(z^{n}\right) & =-\frac{1}{2}+\operatorname{Re}\left(\frac{1}{1-z}\right), \\ & =\operatorname{Re}\left(\frac{1+z-z^{*}-z z^{*}}{2|1-z|^{2}}\right), \end{aligned}

where zz^{*} is the complex conjugate. Note that we only want the real part of the expression given by Eq. (2.158). Let us look at the terms separately:

  1. zz=2z-z^{*}=2 ri sin(nα)\sin (n \alpha) \Rightarrow pure imaginary
  2. zz=r2z z^{*}=r^{2} \Rightarrow real
  3. 1z2=(1z)(1z)=12rcos(nα)+r2|1-z|^{2}=(1-z)\left(1-z^{*}\right)=1-2 r \cos (n \alpha)+r^{2} \Rightarrow real

The above imply that the term in Eq. (2.158) is:

Re(1+zzzz21z2)=1r22(12rcosα+r2).\operatorname{Re}\left(\frac{1+z-z^{*}-z z^{*}}{2|1-z|^{2}}\right)=\frac{1-r^{2}}{2\left(1-2 r \cos \alpha+r^{2}\right)} .

Finally, replacing the term in the square brackets in Eq. (2.154) with Eq. (2.159) and using α=θϕ\alpha=\theta-\phi yields:

u(r,θ)=1πππf(ϕ)[1r22(12rcos(θϕ)+r2)]dϕu(r, \theta)=\frac{1}{\pi} \int_{-\pi}^{\pi} f(\phi)\left[\frac{1-r^{2}}{2\left(1-2 r \cos (\theta-\phi)+r^{2}\right)}\right] d \phi

known as the Poisson integral. The advantage of Eq. (2.160) is that the solution to Laplace's equation on a disc is given by a definite integral instead of an infinite series as the solution given by Eq. (2.146).

Gauss' mean value theorem

As previously mentioned, solutions of the Laplace equation, say u(x,y)u(x, y) are called harmonic functions. The latter have the mean-value property which states that the average value of uu over any circle is equal to its value at the center. There is a 3D3 \mathrm{D} version of this result - there, the average is over a sphere rather than a circle. For the theorem to hold, uu must be harmonic in a region containing the circle (or sphere).

We show this using Eq. (2.160). Setting r=0r=0 in (2.160) yields,

u(0,θ)=12πππf(ϕ)dϕ.u(0, \theta)=\frac{1}{2 \pi} \int_{-\pi}^{\pi} f(\phi) d \phi .

Equation (2.161) implies that the temperature at the centre of the disc is equal to the average of the boundary function, f(ϕ)f(\phi).

Maximum principle

The maximum principle states that a non-constant harmonic function, uu cannot attain a maximum (or minimum) at an interior point of its domain. This result implies that the values of a harmonic function in a bounded domain are bounded by its maximum and minimum values on the boundary. Suppose we have a region D\mathcal{D} where 2u=0\nabla^{2} u=0. Then uu has no local maximum or minimum inside D\mathcal{D}. The maximum and minimum values of uu are attained on the boundary of D\mathcal{D}. At a point of maximum in D\mathcal{D}, say (x0,y0)\left(x_{0}, y_{0}\right) we know, from multivariable calculus and the second derivative test, that uxx((x0,y0))0u_{x x}\left(\left(x_{0}, y_{0}\right)\right) \leq 0 and uyy((x0,y0))0u_{y y}\left(\left(x_{0}, y_{0}\right)\right) \leq 0. This would mean that uxx((x0,y0))+uyy((x0,y0))0u_{x x}\left(\left(x_{0}, y_{0}\right)\right)+u_{y y}\left(\left(x_{0}, y_{0}\right)\right) \leq 0 which is a contradiction if the inequality is strict. The minimum principle states that the minimum value of uu in D\mathcal{D} is achieved on the boundary.

We can interpret the maximum principle physicaly as follows. Consider a harmonic function uu as the equilibrium state (steady state) in the heat equation. If there were a maximum temperature at an interior point of the domain D\mathcal{D}, there would be heat flux out of this point to points with lower temperature which would consequently decrease the temperature of this point thus rendering it unsteady.

A consequence of the maximum principle is that a solution to the Dirichlet problem (Laplace's equation subject to Dirichlet boundary conditions) in a domain D\mathcal{D} is unique. Suppose that u1u_{1} and u2u_{2} both solve the Dirichlet problem. This implies that both solutions satisfy the same function at the boundary of the domain (we denote this by D\partial \mathcal{D} ), i.e. u1=u2u_{1}=u_{2} on D\partial \mathcal{D}. Now, let u=u1u2u=u_{1}-u_{2} and define F=uu\boldsymbol{F}=u \nabla u. Then, the divergence of F\boldsymbol{F} is given by:

F=uu+u2u\nabla \cdot \boldsymbol{F}=\nabla u \cdot \nabla u+u \nabla^{2} u

which reduces to

F=uu,\nabla \cdot \boldsymbol{F}=\nabla u \cdot \nabla u,

since 2u=0\nabla^{2} u=0. By the divergence theorem, we have:

DFdxdy=DFnds.\int_{\mathcal{D}} \nabla \cdot \boldsymbol{F} d x d y=\oint_{\partial \mathcal{D}} \boldsymbol{F} \cdot \boldsymbol{n} d s .

Since u1=u2u_{1}=u_{2} on the boundary D\partial \mathcal{D} then uu and F\boldsymbol{F} are zero on the boundary. The surface integral therefore is zero. Substituting Eq. (2.163) in (2.164) and using DFnds=0\oint_{\partial \mathcal{D}} \boldsymbol{F} \cdot \boldsymbol{n} d s=0, we have:

Duudxdy=Du2dxdy=0.\int_{\mathcal{D}} \nabla u \cdot \nabla u d x d y=\int_{\mathcal{D}}|\nabla u|^{2} d x d y=0 .

Since u2|\nabla u|^{2} is non-negative, Eq. (2.165) holds true only if u=0\nabla u=0 which implies that u=u= constant. But, since u=0u=0 on the boundary, then the constant must be zero and therefore u=u1u2=0u1=u2u=u_{1}-u_{2}=0 \Rightarrow u_{1}=u_{2} and the solution is unique.