Consider the following problem for Laplace's equation on the square $\Omega = \{(x,y):0\leq x,y \leq 1\} \subseteq \mathbb{R}^2$: $$P):\left\{\begin{aligned} &\Delta u = 0 \ \mathrm{in} \ \mathrm{\Omega} \\ & u(0,y) = 0\\ &u(x,0) = 0 \\ &u(x,1) = x \\ &u(1,y) = y\end{aligned}\right. $$ By inspection, it is clear that the solution is given by $u(x,y) = xy$. This solution is unique due standard results on uniqueness for the Laplace equation.
Suppose, however, that I am unable to spot this solution by inspection, and that I must try to solve the equation systematically. One way to do so would be to exploit the linearity of the problem, and to split in to two problems, $P_v$ and $P_w$ respectively, in terms of functions $v$ and $w$, such that $u=v+w$ and the problems $P_v$ and $P_w$ only have non-homogeneous boundary conditions in one-direction respectively. That is: $$P_v):\left\{\begin{aligned} &\Delta v = 0 \ \mathrm{in} \ \mathrm{\Omega} \\ & v(0,y) = 0\\ &v(x,0) = 0 \\ &v(x,1) = x \\ &v(1,y) = 0\end{aligned}\right., \ P_w):\left\{\begin{aligned} &\Delta w = 0 \ \mathrm{in} \ \mathrm{\Omega} \\ &w(0,y) = 0\\ &w(x,0) = 0 \\ &w(x,1) = 0 \\ &w(1,y) = y\end{aligned}\right. $$
We may then try to solve problem $P_v$ using separation of variables. Due to the boundary conditions in the $x$-direction, we make the following ansatz: $$1) \ v(x,y) = \sum_{k=1}^\infty \sin(k\pi x)Y_k(y).$$ If this series can be differentiated termiwise, we find that $$2) \ \Delta v = \sum_{k=1}^\infty \sin(k\pi x)[k^2\pi^2Y_k(y)-Y_k''(y)].$$ Thus, we get $Y_k''(y)-k^2\pi^2Y_k(y)=0$. In order to accommodate the conditions $v(x,0)=0$, we see that we get $Y_k(y) = A_k\sinh(k\pi y)$, for some coefficient $A_k$. Thus, we get $$3) \ v(x,y) = \sum_{k=1}^\infty A_k\sin(k\pi x)\sinh(k\pi y).$$ We must also fit the boundary condition $v(x,1) = x$. Do do so, we may consider the Fourier series of the 2-periodic function $f$ defined by $f(x) = x, x \in (-1,1)$. We then immediately find that $A_k = \frac{1}{\sinh(k\pi)}\frac{2(-1)^{k+1}}{k\pi}$, so that $$4) \ v(x,y) = \sum_{k=1}^\infty \frac{1}{\sinh(k\pi)}\frac{2(-1)^{k+1}}{k\pi}\sin(k\pi x)\sinh(k\pi y).$$ At this stage I have a few questions/concerns:
- Q1: We note, from the expression in $4)$, that $v(1,1) = 0$, which is not consistent with the boundary condition $v(x,1) = x$ for $x=1$ (of course, this derives from the Gibbs phenomenon of the function $f$ at $x=1$). Thus, $4)$ is not a pointwise solution. Does there exist a pointwise solution to problem $P_v$? My guess is that a pointwise solution does not exists, since the boundary conditions are not continuous.
- Q2: What can we say about existence and uniqueness for problem $P_v$?
Let us continue, and solve problem $P_w$. This is of course analogous to what we did above, so we find that $$5) \ w(x,y) = \sum_{k=1}^\infty \frac{1}{\sinh(k\pi)}\frac{2(-1)^{k+1}}{k\pi}\sin(k\pi y)\sinh(k\pi x).$$
By the superposition principle, we would now like to say that the solution $u$ to the original problem $P$ is given by $v+w$, i.e. $$\begin{align}6) \ u(x,y) &= v(x,y)+w(x,y)=\\&=\sum_{k=1}^\infty \frac{1}{\sinh(k\pi)}\frac{2(-1)^{k+1}}{k\pi}[\sin(k\pi x)\sinh(k\pi y)+\sin(k\pi y)\sinh(k\pi x)]\end{align}.$$ As pointed out by "A rural reader" and "Äres", this of course does not have the right value at $(x,y)=(1,1)$. Thus, $u$ in equation $6)$ cannot be a pointwise solution. I now have a few more questions/concerns:
- Q3: In what sense does the expression in equation 6) solve the original problem $P$? Certainly in $L^2$ sense, but can anything more be said about it?
- Q4: Is there a better way to solve the original problem $P$, aside from spotting the solution $u(x,y)=xy$ by inspection? (Adressed by Äres)
You are complicating the problem. If you try to re-write the solution as $u(x,y)=v(x,y)+w(x,y)$, then you are not simplifying calculations and are doing more work, since $u$ is already a function of $x$ and $y$, so substituting $u(x,y)=v(x,y)+w(x,y)$ doesn't help.
Then you obtained $$P_v):\left\{\begin{aligned} &\Delta v = 0 \ \mathrm{in} \ \mathrm{\Omega} \\ & v(0,x) = 0\\ &v(x,0) = 0 \\ &v(x,1) = x \\ &v(1,y) = 0\end{aligned}\right., \ P_w):\left\{\begin{aligned} &\Delta w = 0 \ \mathrm{in} \ \mathrm{\Omega} \\ &w(0,x) = 0\\ &w(x,0) = 0 \\ &w(x,1) = 0 \\ &w(1,y) = y\end{aligned}\right. $$
However, the conditions $v(x,1)=x$ and $v(1,y)=0$ (and similarly for $w$) contradict each other at the point $(x,y)=(1,1)$. Substituting $(x,y)=(1,1)$ into
$$\begin{align} \ u(x,y) &= v(x,y)+w(x,y)=\\&=\sum_{k=1}^\infty \frac{1}{\sinh(k\pi)}\frac{2(-1)^{k+1}}{k\pi}[\sin(k\pi x)\sinh(k\pi y)+\sin(k\pi y)\sinh(k\pi x)]\end{align}$$
gives $u(1,1)=0$, but we know that $u(1,1)=1$. Thus the above $u(x,y)$ is not a solution to the original problem.
It is easier to solve the original problem by assuming a separable solution of the form $u(x,y)=f(x)g(y)$ (see here for examples). This general method assumes the solution can be written as the product of two independent functions. Then substituting into Laplace's equation and re-arranging we obtain
$$\frac{1}{f(x)}\frac{\partial^2 f}{\partial^2x}=-\frac{1}{g(y)}\frac{\partial^2 g}{\partial^2y}$$
Since the LHS has $y$-independence and the RHS has $x$-independence, both sides must be equal to a constant, say $\lambda$, which is the separation constant.
Then we obtain the equations
$$f''(x)-\lambda f(x)=0,\quad\quad g''(y)+\lambda g(y)=0$$
We will obtain different solutions depending on the sign of $\lambda$ (and we determine this according to the conditions). Lets look at the boundary conditions:
$$u(0,x)=0\implies f(0)=0$$ $$u(x,0)=0\implies g(0)=0$$ $$u(x,1)=x \implies \{f(x)=x\}\cap\{g(1)=1\}$$ $$u(1,y)=y \implies \{f(1)=1\}\cap\{g(y)=y\}$$
So choosing $\lambda = 0$ will do since both $f(x)$ and $g(y)$ are linear. In fact, we obtain that $f(x)=x$ and $g(y)=y$ from the conditions and thus $u(x,y)=xy$.