Solve Helmholtz equation 
$$U_{xx}+U_{yy}+k^2U=0$$
Solve by separation of variables by assuming $u(x,y)=X(x)Y(y)$ with the following conditions:
  $$
U(0,y)=0,\,\,
U(2,y)=0,\,\,
U(x,0)=0,\,\,
U(x,1)=0,
$$

This is what I have done so far:
$$
X''(x)Y(y)+X(x)Y''(y)+k^2X(x)Y(y)=0
$$
To separate divide through by $X(x)Y(y)$, this gives
$$
X''(x)/X(x)  +   Y''(y)/Y(y)   +k^2  =0
$$
Now I am not sure where to go from here. I know that if I take over the $y$'s then it will be separated, but where does the $k^2$ go? Does it even matter to the aux. equation? 
What I thought is that I can just set $X''(x)/X(x) =k^2$ and $Y''(y)/Y(y) =k^2$, but I think I am wrong. Can someone help?  Thank you
 A: Do not fret!
$$X''(x)/X(x) + Y''(y)/Y(y) + k^2 = 0$$
goes to
$$Y''(y)/Y(y)+k^2 = -X''(x)/X(x)$$
Solve $Y''/Y+k^2 = \lambda$ and $-X''(x)/X(x) = \lambda$. Note this isn't much different than solving laplace's equation, but here we can think of solving $Y''/Y=\lambda_1$ and $X''/X=\lambda_2$ with $\lambda_1$ and $\lambda_2$ related in some way, not simply equal.
A: From the equation:
$$X''/X + Y''/Y + k^2 = 0,$$ 
it follows that:
$$X''/X = - Y''/Y -k^2 = \lambda,$$
for some $\lambda \in \mathbb{R}^- \cup \{0\} \cup \mathbb{R}^+$. This leads you to two problems, one for $x$ and one for $y$ in terms of $X$ and $Y$, respectively. You just need to solve the one for, say, $X(x)$. This is:
$$X'' - \lambda X = 0, \quad 0 < x < 2,$$
with homogeneous boundary conditions (obtained from BC for $u$): $X(0) = X(2) = 0$. If I remember well this problem  only has solution for $\lambda < 0$ and it is:
$$X_n(x) = \sin{\sqrt{|\lambda_n|} x}, \quad |\lambda_n| = n^2 \pi^2/L^2, \quad n = \{1,2,\ldots,\}, \quad L = 2,$$
where the constant of integration can be set to $1$ because the ode for $X$ is homogeneous. Then, if you assume an eigenvalues decomposition of the solution:
$$u(x,y) = \sum_{n=1}^\infty Q_n(y) X_n(x),$$
being $Q_n(y)$ the Fourier coefficientes, which are to be determined substituting this back into the original PDE:
$$\sum^\infty_{n=1} \left\{  Q''_n(y)- |\lambda_n| Q_n(y) + k^2 \right\}  X_n(x) = 0,$$
where I have taken into account that $X_n'' = -|\lambda_n| X_n$. Then, integrating over $x \in [0,2]$ and applying the orthogonality properties of $X_n(x)$ it yields an ode for $Q_n(y)$:
$$Q''_n(y) - n^2\pi^2 Q_n(y) = -k^2, \quad 0 < y < 1,$$  
which, together with the boundary conditions (coming from the definition of $u$ and applying again orthogonality to obtain them):
$$Q_n(0) = 0, \quad Q_n(1) = 0,$$
form an easy problem for determining $Q_n$ and hence the solution.
I hope this may be useful to you.
Cheers!
