I've been trying to solve the following 2D Heat equation but I'm not sure it is right, $$ \partial^2_x w + \partial^2_y w = - Kw $$
with the following boundary conditions, $$ w(0,y) = w(L_1,y) = 0, \quad \forall y \in [0, L_2] $$ $$ w(x,0) = w(x, L_2) = 0, \quad \forall x \in [0,L_1] $$
Separation of variables
$$ w(x,y) = u(x)v(y) $$
We can rewrite the boundary conditions, \begin{align*} w(0,y) = u(0)v(y) &\implies u(0) = 0 \\ w(L_1,y) = u(L_1)v(y) &\implies u(L_1) = 0 \end{align*}
\begin{align*} w(x,0) = u(x)v(0) &\implies v(0) = 0 \\ w(x,L_2) = u(x)v(L_2) &\implies v(L_2) = 0 \end{align*}
Applying the separation of variables, $$ u''(x)v(y) + u(x)v''(y) = -Ku(x)v(y) \implies u''(x)v(y) = -u(x)(Kv(y) + v''(y)) $$ $$ \frac{u''(x)}{u(x)} = - \left(K + \frac{v''(y)}{v(y)}\right) = -k^2 $$
Therefore we have, \begin{equation*} \begin{cases} u''(x) = -k^2 u(x) &\implies u(x) = A\cos(kx) + B\sin(kx) \\ v''(y) = (k^2 - K) v(y) &\implies v(y) = Ce^{-\eta y} + De^{\eta y}; \quad \eta^2 = (k^2 - K) \end{cases} \end{equation*}
Applying the boundary conditions, \begin{align*} u(0) = 0 &\implies A = 0 \\ u(L_1) = 0 &\implies B\sin(kL_1) = 0 \implies kL_1 = n\pi \implies k = \frac{n\pi}{L_1}, \quad n \in \mathbb{N} \end{align*}
\begin{align*} v(0) = 0 &\implies C = -D \\ v(L_2) = 0 &\implies 2D \sinh(\eta L_2) = 0 \implies \eta L_2 = 0 \implies \sqrt{(k^2 - K)}L_2 = 0 \implies k^2 = K \end{align*}
So the solution would be $$ w(x,y) = B\sin \left(\frac{n\pi x}{L_1} \right)(C-D) $$
I don't think it's correct, isn't it ?