Validating a PDE problem solution I have the following problem, which I have tried to solve myself and I would like someone to verify that my answer is valid. The problem is the following:

By separation of variables, derive the family
$$u_{mn}^{\pm}(x,y,z) = \sin(m\pi x)\cos(n\pi y)\exp(\pm\sqrt{m^2+n^2}\pi z)$$
of the problem
$$u_{xx} + u_{yy} + u_{zz} = 0, \;\;\;u(0,y,z) = u(1,y,z) = u_y(x,0,z) = u_y(x,1,z) = 0$$

Here is my attempted solution: 
First I try to separate the PDE, by defining $u(x,y,z) = X(x)v$, where $v=Y(y)Z(z)$ and plugging this into the PDE:
$$X''(x)v + X(x)v_{yy}+X(x)v_{zz} = 0$$
$$X''(x)v + X(x)(v_{yy}+v_{zz})=0$$
$$\frac{X''(x)}{X(x)}=\frac{-(v_{yy}+v_{zz})}{v}$$
Sine the variables are independent the equation must equal some constant so:
$$\frac{X''(x)}{X(x)}=\frac{-(v_{yy}+v_{zz})}{v} = -\lambda^2$$
$$X''(x) = -\lambda^2X(x)$$
$$\frac{-(v_{yy}+v_{zz})}{v} =-\lambda^2$$
Now I insert $v = Y(y)Z(z)$:
$$\frac{-Y''(y)Z(z)-Y(y)Z''(z)}{Y(y)Z(z)} = -\lambda^2$$
$$\frac{Y''(y)}{Y(y)}+\frac{Z''(z)}{Z(z)} = \lambda^2$$
$$\frac{Y''(y)}{Y(y)} = \lambda^2 - \frac{Z''(z)}{Z(z)}$$
$$\frac{Y''(y)}{Y(y)} = \lambda^2 - \frac{Z''(z)}{Z(z)} = -b^2$$
from which I can deduce:
$$Y''(y) = -b^2Y(y)$$
$$Z''(z)= -(-b^2-\lambda^2)Z(z)$$
I set $\epsilon^2=-b^2-\lambda^2$, so I get
$$Z''(z)= -\epsilon^2Z(z)$$
According to my source book the general solution for a ODE of type $X''(x) = -\lambda^2X(x)$, where $-\lambda^2$ is some constant (possibly complex) is:
$$X(x) = C_1\cos(\lambda x) + C_2\sin(\lambda x)\;\;\; (C_1, C_2 \;\;\;\;\text{constants})$$
I use this for the ODEs I have solved and I get:
$$X(x) = C_1\cos(\lambda x) + C_2\sin(\lambda x)$$
$$Y(y) = C_3\cos(b y) + C_4\sin(b y)$$
$$Z(z) = C_5\cos(\epsilon z) + C_6\sin(\epsilon z)$$
from the initial conditions I deduce that:  $X(0)=X(1)=Y'(0)=Y'(1)=0$ and I get:
$$X(0) = C_1=0$$
$$X(1)= C_2\sin(\lambda)=0$$
because I'm looking for non-trivial solutions I conclude that $\lambda=n\pi$ where $n$ is some integer. Next I get:
$$Y'(0) = -C_3b\sin(0)+C_4b\cos(0)=C_4b = 0,$$ so I select $C_4=0$.
$$Y'(1)=-C_3b\sin(b)=0 \rightarrow b=m\pi$$
$$Y(y) = C_3\cos(m\pi y)$$
$$Z(z) = C_5\cos(\epsilon z) + C_6\sin(\epsilon z)$$
$\epsilon^2 = -n^2\pi^2 -m^2\pi^2$
$\epsilon = \pm\sqrt{-\pi^2(m^2+n^2)} = \pm i\pi\sqrt{m^2+n^2}$
so:
$$u(x,y,z) = X(x)Y(y)Z(z)= $$
$$C_2C_3\sin(n\pi x)\cos(m\pi y)[C_5\cos(\pm i\pi z\sqrt{m^2+n^2}) + C_6\sin(\pm i\pi z\sqrt{m^2+n^2})]$$
Now I can select $C_2C_3 = 1$, $C_5 = 1$ and $C_6 = -i$ and I get:
$$u(x,y,z) = \sin(n\pi x)\cos(m\pi y)[\cos(\pm i\pi z\sqrt{m^2+n^2}) -i\sin(\pm i\pi z\sqrt{m^2+n^2})]$$
and if I understand correctly I know that $e^x = \cos(ix)-i\sin(ix)$ so I get:
$$u_{mn}^{\pm}(x,y,z) = \sin(n\pi x)\cos(m\pi y)\exp(\pm \sqrt{m^2+n^2}\pi z)$$
It seems I got it correct, but are the operations I used valid? 

The method is correct. At the end, to arrive at the given solution you choose some coefficients. A little remark: for completeness, you should also consider the case $b=0$. 
This cases arises when, dealing with the boundary conditions for $Y(y)$, you write
$$Y^{'}(0)=C_4b=0, $$
$$Y^{'}(1)=-C_3b\sin b+C_4 b\cos b=0.$$
Looking at the first equation you decided to put $C_4=0$. What if $b=0$, instead?
Then $Y$ would be solution of the O.D.E. $Y^{''}(y)=0$, which admits general solution $Y(y)=A+By$, and $Z(z)$ would satisfy the O.D.E.  $Z^{''}(z)=-(-\lambda^2)Z(z)$. The boundary conditions $Y^{'}(0)=Y^{'}(1)=0$ imply $Y(y)=A$, i.e. $Y(y)$ constant. The family of $u$'s associated to this case are "degenerate".  
