Detailed Solved Example – Laplace Equation in Two Dimensions
Detailed Solved Example for Laplace Equation in Two Dimensions (with Full Steps)
Problem (Standard University Level)
Solve the Laplace equation
\[ \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0 \quad (0 < x < a,\ 0 < y < b) \]subject to the boundary conditions:
\[ u(0,y) = 0, \quad u(a,y) = 0, \quad u(x,0) = 0, \quad u(x,b) = f(x) \]Specific Example (Most Frequently Asked in Exams)
Let \( a = \pi \), \( b = \pi \), and
\[ u(x,\pi) = f(x) = x(\pi - x) \]Step 1: Method – Separation of Variables
Assume
\[ u(x,y) = X(x) Y(y) \]Plug into Laplace equation:
\[ X'' Y + X Y'' = 0 \implies \frac{X''}{X} = -\frac{Y''}{Y} = -k^2 \](we choose \(-k^2\) because BCs at \(x=0\) and \(x=a\) are zero).
So we get two ODEs:
\[ X'' + k^2 X = 0 \] \[ Y'' - k^2 Y = 0 \]Step 2: Apply homogeneous boundary conditions in x-direction
\[ X(0) = 0, \quad X(a) = 0 \]Solution of X-equation:
\[ X(x) = A \cos(kx) + B \sin(kx) \] \[ X(0)=0 \implies A = 0 \] \[ X(a)=0 \implies B \sin(ka) = 0 \implies ka = n\pi \quad (n=1,2,3,\dots) \] \[ k_n = \frac{n\pi}{a}, \quad X_n(x) = \sin\left(\frac{n\pi x}{a}\right) \]Step 3: Solve Y-equation
\[ Y'' - \left(\frac{n\pi}{a}\right)^2 Y = 0 \]General solution:
\[ Y_n(y) = A_n \cosh\left(\frac{n\pi y}{a}\right) + B_n \sinh\left(\frac{n\pi y}{a}\right) \]Step 4: Apply boundary condition at y=0
\[ u(x,0) = 0 \implies Y_n(0) = 0 \implies A_n = 0 \]Thus
\[ Y_n(y) = B_n \sinh\left(\frac{n\pi y}{a}\right) \]Step 5: Superposition (General Solution)
\[ u(x,y) = \sum_{n=1}^{\infty} C_n \sinh\left(\frac{n\pi y}{a}\right) \sin\left(\frac{n\pi x}{a}\right) \] (where \( C_n = B_n \))Step 6: Apply non-homogeneous BC at y = b
\[ f(x) = \sum_{n=1}^{\infty} C_n \sinh\left(\frac{n\pi b}{a}\right) \sin\left(\frac{n\pi x}{a}\right) \]Fourier sine series coefficient:
\[ C_n = \frac{2}{a \sinh\left(\frac{n\pi b}{a}\right)} \int_0^a f(x) \sin\left(\frac{n\pi x}{a}\right) \, dx \]Step 7: Compute the integral for f(x) = x(π − x), a = π, b = π
\[ I_n = \int_0^\pi x(\pi - x) \sin(nx) \, dx \]Standard result (after integration by parts twice):
\[ I_n = \begin{cases} \dfrac{8\pi}{n^3} & n \text{ odd} \\ 0 & n \text{ even} \end{cases} \]Final Coefficients (a = π, b = π)
\[ C_n \sinh(n\pi) = \frac{2}{\pi} I_n \] \[ C_n = \frac{2}{\pi \sinh(n\pi)} \times \begin{cases} \dfrac{8\pi}{n^3} & n\text{ odd} \\ 0 & n\text{ even} \end{cases} \] \[ \therefore \quad C_n = \begin{cases} \dfrac{16}{n^3 \sinh(n\pi)} & n \text{ odd} \\ 0 & n \text{ even} \end{cases} \]Final Solution
\[ u(x,y) = \sum_{n=1,3,5,\dots}^{\infty} \frac{16}{n^3 \sinh(n\pi)} \sinh(n y) \sin(n x) \]or equivalently (letting n = 2m−1):
\[ u(x,y) = \sum_{m=1}^{\infty} \frac{16}{(2m-1)^3 \sinh((2m-1)\pi)} \sinh((2m-1) y) \sin((2m-1) x) \]Another Quick Standard Example (Single Sine Term – Very Common)
If the top boundary is simply
\[ f(x) = \sin\left(\frac{\pi x}{a}\right) \]then only the n=1 term is non-zero, and the solution becomes:
\[ u(x,y) = \frac{\sinh\left(\frac{\pi y}{a}\right)}{\sinh\left(\frac{\pi b}{a}\right)} \sin\left(\frac{\pi x}{a}\right) \]This form appears in almost every university examination.
Practice Tip: Master these two types —
1. Polynomial boundary → full Fourier series + odd/even simplification
2. Single sine term → direct closed form
—and you will be able to solve 95% of all Laplace equation problems asked in university exams.