# Laplace's equation in 2 dimensions with mixed Dirichlet and Neumann BCs: Is this the only solution?

I have a PDE that looks like this

$$\Delta T=\frac{\partial^{2}T}{\partial x^{2}}+\frac{\partial^{2}T}{\partial y^{2}}=0,\quad (x,y)\in \Omega$$

with boundary conditions

$$T(0,y)=20,\quad 0\leq y\leq 2, \\ T(5,y)=100,\quad 0\leq y\leq 2, \\ \frac{\partial T}{\partial y}(x,0)=0,\quad 0\leq x\leq 5, \\ \frac{\partial T}{\partial y}(x,2)=0,\quad 0\leq x\leq 5.$$

In short I have a two dimensions Laplace equation with mixed Dirichlet and Neumann boundary conditions on a rectangular domain $$\Omega$$. I believe I have found a way to solve it by separation of variables and I will get an infinite sum, but is this necessary? All boundary conditions are exactly specified. Also, when I solve the PDE this way I get a (particular?) solution which is

$$T(x,y)=16x+20,$$

and this solution satisfies all boundary conditions. Can I conclude that this is the only unique solution that exists?

Moreover I obtain something like this (quick solution sketch):

Let $$T(x,y)=X(x)Y(y)$$. Inserted into the Laplace equation, it yields

$$\frac{X''}{X}=-\frac{Y''}{Y}=\pm \lambda^{2},\quad \text{choose positive sign}.$$

Then we first get for $$Y$$

$$Y''+\lambda^{2}Y=0\implies Y(y)=A\sin(\lambda y)+B\cos(\lambda y),\\ \text{with BCs}\quad \frac{\partial Y}{\partial y}(0)=0=\frac{\partial Y}{\partial y}(2).$$

Taking into account the BCs we get the solution $$Y$$ to be

$$Y_{n}(y)=\cos(\lambda_{n}y),\quad \lambda_{n}=\frac{n\pi}{2}\quad n=0,1,....$$

Then we finally get for $$X$$

$$\lambda_{n}\neq 0: X''-\lambda^{2}X=0\implies X_{n}(x)=C\sinh(\lambda_{n}x)+D\cosh(\lambda_{n}x) \\ \text{with BCs}\quad X(0)=20,\quad X(5)=100.$$

Taking the BCs into account we get the solution

$$X(x)=\frac{100-20\cosh(5\lambda_{n})}{\sinh(5\lambda_{n})}\sinh(\lambda_{n}x)+20\cosh(\lambda_{n}x).$$

For $$\lambda_{n}=0$$ we get

$$X''=0\implies X(x)=cx+k \\ \text{with BCs}\quad X(0)=20,\quad X(5)=100.$$

Therefore,

$$X_{0}=16x+20$$

Furthermore the complete solution becomes (at least I think it becomes a series like this!)

$$T(x,y)=X(x)Y(y)=c_{0}(16x+20)+\sum_{n=1}^{\infty}c_{n}[\frac{100-20\cosh(5\lambda_{n})}{\sinh(5\lambda_{n})}\sinh(\lambda_{n}x)+20\cosh(\lambda_{n}x)]\cos(\lambda_{n}y).$$

(For some this might have been to long to read, but) is this the correct solution, or is $$16x+20$$ the correct solution? If the former, how do I determine the $$c_{n}$$ in this case? If none is correct (might as well be), how do I solve it?

Best regards//

Solutions to your boundary value problem are unique. Let me give you a quick proof, which uses the divergence theorem (see e.g. https://en.wikipedia.org/wiki/Divergence_theorem): Let $$T_1,T_2$$ be two solutions. Then $$T:=T_1-T_2$$ satisfies the differential equation and additionally $$T(0,y)=0,\quad 0\leq y\leq 2, \\ T(5,y)=0,\quad 0\leq y\leq 2, \\ \frac{\partial T}{\partial y}(x,0)=0,\quad 0\leq x\leq 5, \\ \frac{\partial T}{\partial y}(x,2)=0,\quad 0\leq x\leq 5.$$
Let $$\Omega:=(0,5)\times(0,2)$$ the open set, on which you are looking for your solutions. With $$n$$ being the outer unit normal of $$\Omega$$, we have $$0=\int_\Omega T\cdot\Delta T\, d(x,y) = \int_{\partial\Omega}\langle n,\nabla T\rangle T\, dS - \int|\nabla T|^2\, d(x,y).$$ The boundary term is now as follows: $$\int_{\partial\Omega}\langle n,\nabla T\rangle T\, dS = \int_0^2 T(0,y)(-1)\frac{\partial T}{\partial x}(0,y)\, dy+\int_0^2 T(5,y)\frac{\partial T}{\partial x}(5,y)\, dy\\ + \int_0^5 T(x,0)(-1)\frac{\partial T}{\partial y}(x,0)\, dx + \int_0^5 T(x,2)\frac{\partial T}{\partial y}(x,2)\, dx$$ Since the integrands vanish, the boundary term is zero. Hence $$0=\int_\Omega |\nabla T|^2\, d(x,y).$$ This yields $$T$$ to be constant and since we have $$T(0,0)=0$$, $$T$$ has to be zero on the whole of $$\Omega$$. Hence $$T_1=T_2$$.
The solution $$T(x,y)=16x+20$$ is therefore the only solution. You can check it easily by just plugging it into your problem.
Where might be a problem with your solution? The only thing, that comes to my mind, is that it is not clear a-priori that your series converges uniformely, i.e. that you can interchange derivatives and summation. If you only add finitely many, then the uniqueness result really yields $$c_n=0$$ for $$n\geq 1$$.