UPSC MainsMathematics (Optional)Science and TechnologyPractice question

Solving Laplace's Equation in Rectangular Domain

Solve Laplace's equation ∂²u/∂x² + ∂²u/∂y² = 0 subject to the conditions u(0,y) = u(l,y) = u(x,0) = 0 and u(x,a) = sin(nπx/l).

Solve~250 words3 min readmedium
Attempt it first, timed · optional

Write the answer on paper, as in the exam. Start the timer, keep to the word target.

00:00/ 11 min · 250 words

Done writing? Photograph the sheet and see how it scores against this model answer, with feedback on what to fix.

Upload your answer sheet

How to approach

Apply the method of separation of variables to reduce the partial differential equation into two ordinary differential equations. Choose a negative separation constant to yield non-trivial sinusoidal solutions satisfying the homogeneous boundary conditions along the x-direction and hyperbolic functions in the y-direction. Formulate the general superposition solution and evaluate the undetermined coefficient by matching the single-mode sinusoidal condition at y = a.

Model answer

443 words

Introduction

Laplace's equation in two dimensions, ∇²u = ∂²u/∂x² + ∂²u/∂y² = 0, describes steady-state physical phenomena such as electrostatic potential and steady heat distribution. When defined over a rectangular domain with prescribed Dirichlet boundary conditions, the boundary value problem can be solved analytically using the separation of variables technique.

1. Separation of Variables

Assume a separable solution of the form:

$$u(x, y) = X(x)Y(y)$$

Differentiating and substituting into the governing PDE ∂²u/∂x² + ∂²u/∂y² = 0 yields:

$$X''(x)Y(y) + X(x)Y''(y) = 0 \implies \frac{X''(x)}{X(x)} = -\frac{Y''(y)}{Y(y)}$$

Since the left-hand side depends solely on $x$ and the right-hand side solely on $y$, both must equal a common constant. To satisfy the homogeneous Dirichlet conditions $u(0, y) = u(l, y) = 0$, choose a negative separation constant $-p^2$ (where $p > 0$):

$$\frac{X''}{X} = -p^2 \quad \implies \quad X''(x) + p^2 X(x) = 0$$

$$\frac{Y''}{Y} = p^2 \quad \implies \quad Y''(y) - p^2 Y(y) = 0$$

2. Solving the Spatial ODEs and Applying Boundary Conditions

The general solutions to these ordinary differential equations are:

  • Solution for X(x): $X(x) = C_1 \cos(px) + C_2 \sin(px)$
  • Solution for Y(y): $Y(y) = C_3 \cosh(py) + C_4 \sinh(py)$

Apply the homogeneous boundary conditions sequentially:

  • Condition 1: $u(0, y) = 0 \implies X(0)Y(y) = 0 \implies X(0) = 0$.
    Substituting $x = 0$: $C_1 \cos(0) + C_2 \sin(0) = 0 \implies C_1 = 0$.
  • Condition 2: $u(l, y) = 0 \implies X(l) = 0$.
    With $C_1 = 0$, $C_2 \sin(pl) = 0$. For non-trivial solutions ($C_2 \neq 0$), $\sin(pl) = 0 \implies pl = k\pi$, leading to the eigenvalues:
    $$p_k = \frac{k\pi}{l}, \quad k = 1, 2, 3, \dots$$
  • Condition 3: $u(x, 0) = 0 \implies Y(0) = 0$.
    Substituting $y = 0$: $C_3 \cosh(0) + C_4 \sinh(0) = 0 \implies C_3 = 0$.

3. Superposition and Non-Homogeneous Condition

Combining the valid solutions for each mode $k$, the general solution by linear superposition is:

$$u(x, y) = \sum_{k=1}^{\infty} B_k \sin\left(\frac{k\pi x}{l}\right) \sinh\left(\frac{k\pi y}{l}\right)$$

Applying the fourth boundary condition at $y = a$:

$$u(x, a) = \sum_{k=1}^{\infty} B_k \sinh\left(\frac{k\pi a}{l}\right) \sin\left(\frac{k\pi x}{l}\right) = \sin\left(\frac{n\pi x}{l}\right)$$

4. Evaluation of the Mode Coefficient

Comparing both sides by the orthogonality of sinusoidal functions on the interval $[0, l]$:

  • For $k \neq n$, $B_k = 0$.
  • For $k = n$, $B_n \sinh\left(\frac{n\pi a}{l}\right) = 1 \implies B_n = \frac{1}{\sinh\left(\frac{n\pi a}{l}\right)}$.

Thus, the infinite series collapses into a single unique closed-form harmonic solution:

$$u(x, y) = \frac{\sin\left(\frac{n\pi x}{l}\right) \sinh\left(\frac{n\pi y}{l}\right)}{\sinh\left(\frac{n\pi a}{l}\right)}$$

Conclusion

The resulting closed-form solution satisfies both Laplace's equation and all four prescribed boundary conditions. Because the non-homogeneous boundary condition comprises a single pure spatial mode, the superposition collapses without requiring a full Fourier series expansion.

Key facts to remember

definition
Method of Separation of Variables

A technique for solving linear partial differential equations by assuming the multi-variable function factors as a product of single-variable functions, transforming the PDE into an equivalent system of ODEs.

definition
Dirichlet Boundary Condition

A boundary condition that specifies the exact values that a dependent variable must attain on the boundary of the domain.

example
Single Harmonic Collapse

When the non-homogeneous boundary condition matches an orthogonal basis eigenfunction directly (sin(nπx/l)), all other Fourier coefficients evaluate to zero, obviating the need to evaluate Fourier integral expressions.

Frequently asked questions

Why is a negative separation constant (-p²) chosen for X(x)?

A negative constant ensures trigonometric (oscillatory) solutions in x, which are necessary to satisfy the two homogeneous boundary conditions u(0, y) = 0 and u(l, y) = 0 with non-trivial coefficients. A positive constant would lead to exponential or hyperbolic functions, which cannot vanish at two distinct points unless the solution is identically zero.