Separation of Variables in Laplace's Equation
~7 min read · Tier toggle changes depth (T1 plain · T2 standard · T3 rigour)
You should be comfortable with vector calculus operators (\(\nabla\), \(\nabla^2\)) and basic trigonometric identities. Familiarity with the method of images is helpful but not strictly required, as this lecture focuses on solving the differential equation directly.
Why this matters
Separation of variables is the primary analytical tool for solving electrostatic boundary value problems where symmetry is insufficient.
While the method of images provides elegant solutions for specific geometries like point charges near planes or spheres, it fails for most realistic configurations. Separation of variables allows us to solve Laplace's equation in complex geometries such as rectangular boxes, cylinders, and spheres by breaking the problem into simpler, one-dimensional parts. This technique is fundamental not only in electrostatics but also in heat conduction, fluid dynamics, and quantum mechanics, making it a cornerstone of mathematical physics.
The Core Idea
Imagine you have a rectangular metal box with no charge inside. The potential \(\varphi\) inside must satisfy Laplace's equation, \(\nabla^2\varphi=0\), and must match the voltages applied to the walls. Solving this directly seems difficult because the potential depends on \(x\), \(y\), and \(z\) simultaneously. Separation of variables proposes a clever trick: assume the solution is a product of three separate functions, one for each coordinate. That is, we guess \(\varphi(x,y,z) = X(x)Y(y)Z(z)\). When we substitute this product into Laplace's equation and divide by the product itself, the equation splits into three independent parts, one for each variable. Each part must equal a constant. This transforms a complex three-dimensional partial differential equation into three simple one-dimensional ordinary differential equations. We solve these simpler equations, apply the boundary conditions to determine the constants, and then sum up the valid solutions to build the final answer.
Separation in Cartesian Coordinates
Consider a region where the potential satisfies Laplace's equation: \[ \frac{\partial^2 \varphi}{\partial x^2} + \frac{\partial^2 \varphi}{\partial y^2} + \frac{\partial^2 \varphi}{\partial z^2} = 0 \] We assume a separable solution of the form \(\varphi(x,y,z) = X(x)Y(y)Z(z)\). Substituting this into the equation and dividing by \(XYZ\) gives: \[ \frac{1}{X}\frac{d^2X}{dx^2} + \frac{1}{Y}\frac{d^2Y}{dy^2} + \frac{1}{Z}\frac{d^2Z}{dz^2} = 0 \] Since \(x\), \(y\), and \(z\) are independent variables, the only way this sum can be zero for all values is if each term is equal to a constant. Let us assign constants \(-k_x^2\), \(-k_y^2\), and \(k_z^2\) such that their sum is zero. This leads to three ordinary differential equations: \[ \frac{d^2X}{dx^2} + k_x^2 X = 0, \quad \frac{d^2Y}{dy^2} + k_y^2 Y = 0, \quad \frac{d^2Z}{dz^2} - k_z^2 Z = 0 \] The solutions to these are sines, cosines, and exponentials. The specific form depends on the boundary conditions. For example, if the potential is zero at \(x=0\) and \(x=L\), the solution for \(X(x)\) must be a sine function, \(X(x) = A \sin(k_x x)\), with \(k_x = n\pi/L\) for integer \(n\). This quantization of the separation constants is a direct consequence of the boundary conditions.
Application to a Rectangular Box
Let us consider a rectangular box with sides of length \(L_x\), \(L_y\), and \(L_z\). Suppose the potential is zero on five faces, but the face at \(z=L_z\) has a specified potential \(V_0(x,y)\). We seek a solution that vanishes at \(x=0, L_x\), \(y=0, L_y\), and \(z=0\). Based on the previous section, the general solution is a sum of terms: \[ \varphi(x,y,z) = \sum_{m=1}^{\infty} \sum_{n=1}^{\infty} A_{mn} \sin\left(\frac{m\pi x}{L_x}\right) \sin\left(\frac{n\pi y}{L_y}\right) \sinh\left(\sqrt{\left(\frac{m\pi}{L_x}\right)^2 + \left(\frac{n\pi}{L_y}\right)^2} z\right) \] The hyperbolic sine function \(\sinh\) is chosen because it satisfies the condition \(\varphi=0\) at \(z=0\). The coefficients \(A_{mn}\) are determined by matching the boundary condition at \(z=L_z\): \[ V_0(x,y) = \sum_{m=1}^{\infty} \sum_{n=1}^{\infty} A_{mn} \sin\left(\frac{m\pi x}{L_x}\right) \sin\left(\frac{n\pi y}{L_y}\right) \sinh\left(\sqrt{\left(\frac{m\pi}{L_x}\right)^2 + \left(\frac{n\pi}{L_y}\right)^2} L_z\right) \] This is a double Fourier sine series. By using the orthogonality of sine functions, we can isolate each coefficient \(A_{mn}\) by integrating over the area of the top face. This demonstrates the power of separation of variables: it reduces a complex boundary value problem to a series expansion problem.
Uniqueness and Superposition
A crucial aspect of solving Laplace's equation is the uniqueness theorem. If two solutions satisfy the same boundary conditions, their difference must be zero everywhere. This guarantees that the solution we find using separation of variables is the only possible solution. This property allows us to use the principle of superposition. If we have a complex boundary condition that can be broken down into simpler parts, we can solve for each part separately and add the results. For instance, if the potential on the top face is a sum of two functions, we can find the solution for each function and add them. This linearity is a direct consequence of Laplace's equation being a linear differential equation. It simplifies the calculation significantly, as we do not need to solve the entire complex boundary condition at once.
The derivation
Scalar Potential, Poisson and Laplace Equations
Because the electrostatic field is irrotational, \(\nabla\times\mathbf{E}=\mathbf{0}\), it can be written as the gradient of a scalar potential, \(\mathbf{E}=-\nabla\varphi\). Substituting this into the differential form of Gauss's law, \(\nabla\cdot\mathbf{E}=\rho/\varepsilon_0\), yields Poisson's equation \(\nabla^2\varphi=-\rho/\varepsilon_0\), whose source-free limit \(\rho=0\) is Laplace's equation \(\nabla^2\varphi=0\).
When separating in cylindrical or spherical coordinates, regularity fixes the separation constants. In spherical coordinates the angular equation gives Legendre polynomials \(P_\ell(\cos\theta)\) only when the constant is \(\ell(\ell+1)\) with \(\ell\) a non-negative integer; other values blow up on the polar axis. The radial solutions \(r^\ell\) and \(r^{-(\ell+1)}\) must then be chosen so the potential stays finite at the origin (keep \(r^\ell\)) or at infinity (keep \(r^{-(\ell+1)}\)). Always check the behaviour of your solutions at the singular points of the coordinate system. C
Worked example
Problem. A rectangular box has dimensions \(L_x = 2\ \mathrm{m}\), \(L_y = 1\ \mathrm{m}\), and \(L_z = 1\ \mathrm{m}\). The potential is zero on all faces except the top face at \(z=1\ \mathrm{m}\), where the potential is given by \(V_0(x,y) = 10 \sin\left(\frac{\pi x}{2}\right) \sin(\pi y)\ \mathrm{V}\). Find the potential \(\varphi(x,y,z)\) inside the box.
- Identify the boundary conditions: \(\varphi=0\) at \(x=0, 2\), \(y=0, 1\), and \(z=0\). At \(z=1\), \(\varphi = 10 \sin\left(\frac{\pi x}{2}\right) \sin(\pi y)\).
- Recognize that the boundary condition at \(z=1\) matches the \(m=1, n=1\) term of the double sine series. Therefore, only the \(A_{11}\) coefficient is non-zero.
- The general solution for the \(m=1, n=1\) term is: \[ \varphi(x,y,z) = A_{11} \sin\left(\frac{\pi x}{2}\right) \sin(\pi y) \sinh\left(\sqrt{\left(\frac{\pi}{2}\right)^2 + (\pi)^2} z\right) \] Calculate the argument of the sinh function: \[ k = \sqrt{\frac{\pi^2}{4} + \pi^2} = \sqrt{\frac{5\pi^2}{4}} = \frac{\pi\sqrt{5}}{2} \] So, \[ \varphi(x,y,z) = A_{11} \sin\left(\frac{\pi x}{2}\right) \sin(\pi y) \sinh\left(\frac{\pi\sqrt{5}}{2} z\right) \]
- Apply the boundary condition at \(z=1\): \[ 10 \sin\left(\frac{\pi x}{2}\right) \sin(\pi y) = A_{11} \sin\left(\frac{\pi x}{2}\right) \sin(\pi y) \sinh\left(\frac{\pi\sqrt{5}}{2}\right) \] Cancel the sine terms: \[ 10 = A_{11} \sinh\left(\frac{\pi\sqrt{5}}{2}\right) \] Solve for \(A_{11}\): \[ A_{11} = \frac{10}{\sinh\left(\frac{\pi\sqrt{5}}{2}\right)} \]
- Substitute \(A_{11}\) back into the expression for \(\varphi\): \[ \varphi(x,y,z) = \frac{10 \sin\left(\frac{\pi x}{2}\right) \sin(\pi y) \sinh\left(\frac{\pi\sqrt{5}}{2} z\right)}{\sinh\left(\frac{\pi\sqrt{5}}{2}\right)} \]
Units check. The argument of the sine and hyperbolic sine functions is dimensionless (length divided by length). The prefactor is in Volts. The final result is in Volts, which is correct for electric potential.
Three quick tests
- Why must the separation constants in Cartesian coordinates sum to zero?
Answer
Because the sum of the three separated terms must equal zero to satisfy Laplace's equation, and each term depends on a different variable. - If the boundary condition on the top face of a box is \(V_0(x,y) = \sin(2\pi x/L_x)\), which term in the series solution is non-zero?
Answer
Only \(m=2\) appears in \(x\). Because this \(V_0\) does not vary with \(y\), it must itself be expanded in \(\sin(n\pi y/L_y)\), and every odd \(n\) contributes (\(n=1,3,5,\dots\)). If instead \(V_0 = \sin(2\pi x/L_x)\sin(\pi y/L_y)\), only the single term \(m=2,\ n=1\) survives. - What happens to the potential inside the box if the boundary condition on the top face is zero?
Answer
The potential is zero everywhere inside the box, as the only solution to Laplace's equation with zero boundary conditions is the trivial solution \(\varphi=0\).
Problem set for PU-102 →
Each derivation in this unit ends with five graded problems with full solutions.
Lecture notes drafted with a local model and checked line by line by the editor; every number in the worked example was recomputed.