Laplace's equation is an equation that models many physical phenomena including heat diffusion, electromagnetism, vibrations, and fluid flow. Laplace's equation gives the null space of Poisson's equation. It is the partial differential equation2ψ = 0 (where ∇2 denotes the Laplacian operator). Solving Laplace's equation can be difficult to impossible depending on the given initial and/or boundary conditions. There are two main types of boundary conditions (though more do exist and boundary conditions may be a combination of the two) for a boundary value problem:

Dirichlet condition: the function is defined at all boundaries, in 2 dimensions, ψ(x,0), ψ(x,L), ψ(0,y), ψ(L,y) are all specified.

Neumann condition: the directional derivative is defined at the boundaries, ∇ψ∙n is defined which generally can be expressed as by specifying ψx(x,0), ψx(x,L), ψy(0,y), and ψy(L,y) in 2 dimensions.

Laplace's equation can generally be solved by using the method of separation. For example:

Consider a thin square plate of side length π. Let us define a function ψ(x,y) which will give the temperature at a point (x,y) and let's suppose that three sides of this plate are kept at 0 degrees and the top side has a heat distribution given by some function f(x).

This diffusion problem is governed by Laplace's equation, ∇2ψ = 0, with boundary conditions ψ(0,y) = ψ(L1,y) = ψ(x,0) = 0 and ψ(x,L2) = f(x), where L1 = L2 = π.

Let ψ = P(x)Q(y) so Laplace's equation can be rewritten as P''(x)Q(y)+P(x)Q''(y) = 0 rearranging and dividing the whole equation by P(x)Q(y) we get:

P''/P = -Q''/Q and since the left side is dependent only on x and the right only on y, the two can only be equivalent if they are equal to some constant λ.

Taking each equation separately we obtain the second order ODE P'' = λP. Now solving for λ can be done by taking 3 cases (λ>0, λ=0, λ less than 0), solving the ODE and checking the solution at the boundary conditions, or we can recognize this as an eigenvalue equation and recognize that the operator d2/dx2 is hermitian if P(0) = P(L) = 0 (where L is in this case π). Either way the solution is the same, in order to obtain a non-trivial solution, λ = -n2π2/L2 which in our example is simply -n2. And we obtain a whole bunch of solutions, Pn(x) = Ansinnx.

Moving on to the second equation, -Q''/Q = -n2 => Q'' = n2Q, Qn(y) = Bncoshny + Cnsinhny considering the boundary condition ψ(x,0) = P(x)Q(0) = 0 we can state that Bn = 0 so Qn(y) = Cnsinhny.

So finally, ψn(x,y) = Pn(x)Qn(y) = Dnsinhnysinnx. Now consider our last boundary condition ψ(x,π) = f(x), it should be pretty obvious that ψn(x,y) will not satisfy this condition for pretty much any function except for the sine function, but remember that we essentially have an infinite number of solutions to Laplace's equation by now, and since the differential operator is linear, we can sum these solutions to obtain:

ψ(x,y) = ∑Dnsinhnysinnx (with summation from 1 to infinity)

So at the last boundary, ψ(x,π) = ∑Dnsinhnπsinnx = f(x). Expanding f(x) in terms of a fourier sine series we can satisfy this boundary condition if:

Dnsinnπ = (2/π)∫f(ν)sinnνdν (with integration from 0 to π)

This method works for both types of boundary conditions. In general, the Dirichlet boundary condition gives a general solution ψ(x,y) = ∑Dnsinhnysinnx whereas the Neumann condition leads to a general solution in term of cosines: ψ(x,y) = D0/2 + ∑Dncoshnycosnx where D0 = (2/π)∫f(ν)dν