Here we consider the following boundary value problem: Let $K$ and $L$ be positive real numbers. Let $f_1$ and $f_2$ be real functions defined on $[0,K]$ and let $g_1$ and $g_2$ be real functions defined on $[0,L]$. Find the real function $u$ defined on the rectangle \[ [0, K] \times [0, L] = \Bigl\{(x,y) \in \mathbb{R}^2 : 0 \leq x \leq K \ \ \text{and} \ \ 0 \leq y \leq L \Bigr\} \] such that $u$ satisfies the Laplace PDE \begin{equation} \label{eqBVPR} \frac{\partial^2 u}{\partial x^2}(x,y) + \frac{\partial^2 u}{\partial y^2}(x,y) = 0, \quad (x,y) \in [0, K] \times [0, L], \end{equation} and the boundary conditions \begin{alignat}{2} \label{eqBVPR1} u(x,0) & = f_1(x), & \quad u(x,L) & = f_2(x) \quad \text{for all} \quad x \in [0, K], \\ \label{eqBVPR2} u(0,y) & = g_1(y), & \quad u(K,y) & = g_2(y) \quad \text{for all} \quad y \in [0,L]. \\ \end{alignat}
Here we consider the following boundary value problem: Find the real function $u(x,y)$ defined on the rectangle \[ [0, 3] \times [0,2] = \Bigl\{(x,y) \in \mathbb{R}^2 : \ \ x \in [0,3] \ \ \text{and} \ \ y \in [0, 2] \Bigr\} \] such that $u$ satisfies the Laplace PDE \begin{equation} \label{eqBVPRe} \frac{\partial^2 u}{\partial x^2}(x,y) + \frac{\partial^2 u}{\partial y^2}(x,y) = 0 \end{equation} and the boundary conditions \begin{alignat}{3} \label{eqBVPR1e} u(x,0) & = \frac{1}{2} + \frac{4 x}{3}+\sin \left(\frac{\pi x}{3}\right), & \quad u(x,2) & = \frac{7}{2} -\frac{x}{3}+\frac{1}{2} \sin \left(\frac{2 \pi x}{3}\right) & \quad &\text{for all} \quad x \in [0,3], \\ \label{eqBVPR2e} u(0,y) & = \frac{1}{2} + \frac{3 y}{2}-\frac{2}{3} \sin \left(\frac{\pi y}{2}\right), & \quad u(3,y) & = \frac{9}{2} -y-\frac{1}{2} \sin (\pi y) & \quad & \text{for all} \quad y \in [0,2]. \\ \end{alignat}
The picture to the left below shows the boundary conditions as the parametric curve in \(xyu\)-space. The picture to the right is the equilibrium temperature, the solution of the Laplace's equation that satisfied the given boundary conditions. In the rest of this section we will explain how the solution is constructed.For each of these five boundary conditions we find the exact solution of Laplace's Equation and add them together to get the solution of the original problem.
The solution of Laplace's equation that satisfies the first boundary condition is \[ \sin \left(\frac{\pi}{3} x\right) \frac{\sinh \left(\frac{\pi}{3} (2-y)\right)}{\sinh\left(\frac{\pi }{3}\, 2 \right)} \]
The solution of Laplace's equation that satisfies the second boundary condition is \[ \frac{1}{2} \sin \left( \frac{2\pi}{3} x \right) \frac{\sinh \left(\frac{2\pi}{3} (2-y)\right)}{\sinh\left(\frac{2\pi }{3}\, 2 \right)} \]
The first solution, the second solution and the sum of the first and the second solutions are
The solution of Laplace's equation that satisfies the third boundary condition is \[ -\frac{2}{3} \sin \left( \frac{\pi}{2} y \right) \frac{\sinh \left(\frac{\pi}{2} (3-x)\right)}{\sinh\left(\frac{\pi}{2}\, 3 \right)} \]
The third solution, the preceding sum and the sum of the first, the second and the third solutions are
The solution of Laplace's equation that satisfies the fourth boundary condition is \[ -\frac{1}{2} \sin \left( \pi y \right) \frac{\sinh \left(\pi x \right)}{\sinh\left(\pi \, 3 \right)} \]
The fourth solution, the preceding sum and the sum of the first, the second, the third, and the fourth solutions are
The solution of Laplace's equation that satisfies the "straight edges" boundary condition is \[ \frac{1}{6} \bigl( 3 + 8 x + 9 y - 5 x y \bigr) \]
The solution to the "straight edges" boundary condition, the preceding sum, and the sum of the first, the second, the third, the fourth, and the solution to the "straight edges" boundary conditions are
Finally, the solution of the given boundary value problem for Laplace's equation is the sum of the preceding solutions: \begin{align*} \sin \left(\frac{\pi}{3} x\right) & \frac{\sinh \left(\frac{\pi}{3}(2-y)\right)}{\sinh\left(\frac{\pi }{3}\, 2 \right)} +\frac{1}{2} \sin \left( \frac{2\pi}{3} x \right) \frac{\sinh \left(\frac{2\pi}{3}(2-y)\right)}{\sinh\left(\frac{2\pi }{3}\, 2 \right)} \\ &\qquad - \frac{2}{3} \sin \left( \frac{\pi}{2} y \right) \frac{\sinh \left(\frac{\pi}{2}(3-x)\right)}{\sinh\left(\frac{\pi}{2}\, 3 \right)} -\frac{1}{2} \sin \left( \pi y \right) \frac{\sinh \left(\pi x \right)}{\sinh\left(\pi \, 3 \right)} +\frac{1}{6} \bigl( 3 + 8 x + 9 y - 5 x y \bigr) \end{align*} We close this section with a big graph of this solution: