I am trying to use separation of variables to solve
$\triangle u = 0,\ u(x,\ 0) = 10,\ u(x,\ 2) = 0,\ u(0,\ y) = 0,\ u(1,\ y) = 0$
Plugging $u = X(x)Y(y)$ into the PDE leads to $-\frac{\frac{\partial^2 X}{\partial x^2}}{X} = \frac{\frac{\partial^2 Y}{\partial y^2}}{Y} = \lambda$. My solutions to the Sturm-Louiville problems are $X = Ae^{-\sqrt{-\lambda} x} + Be^{\sqrt{-\lambda} x}$ and $Y = Ce^{-\sqrt\lambda y} + De^{\sqrt\lambda y}$ (I have ruled out the $\lambda = 0$ case). Thus I have $$u = (Ae^{-\sqrt{-\lambda} x} + Be^{\sqrt{-\lambda} x})(Ce^{-\sqrt\lambda y} + De^{\sqrt\lambda y})$$
Then I apply the boundary conditions $u(0,\ y) = 0$ and $u(1,\ y) = 0$, yielding the system $$\begin{cases}0 = (A + B)(Ce^{-\sqrt\lambda y} + De^{\sqrt\lambda y}) \\ 0 = (Ae^{-\sqrt{-\lambda}} + Be^{\sqrt{-\lambda}})(Ce^{-\sqrt\lambda y} + De^{\sqrt\lambda y})\end{cases}$$
Since this this must hold for all $y$, not just the special case where $(Ce^{-\sqrt\lambda y} + De^{\sqrt\lambda y}) = 0$, this has to entail that $$\begin{cases}0 = A + B \\ 0 = Ae^{-\sqrt{-\lambda}} + Be^{\sqrt{-\lambda}}\end{cases}$$
This system has the solution $A = -B, \lambda = n^2 \pi^2$, so $$u = (Be^{n\pi xi} - Be^{-n\pi xi})(Ce^{-n\pi y} + De^{n\pi y})$$
This looks like a good time to apply Euler's Formula. Letting $B$ eat some constants that pop out, this simplifies to $$u = Bsin(n\pi x)(Ce^{-n\pi y} + De^{n\pi y})$$
Next I apply the boundary conditions $u(x,\ 0) = 10$ and $u(x,\ 2) = 0$, yielding the system $$\begin{cases}10 = Bsin(n\pi x)(C + D) \\ 0 = Bsin(n\pi x)(Ce^{-2n\pi} + De^{2n\pi})\end{cases}$$
I have ruled out the $B = 0$ case, so I can divide the second equation by $B$. Also, since this this must hold for all $x$, not just the special case where $sin(n\pi x) = 0$, this has to entail that $$\begin{cases}10 = B(C + D) \\ 0 = Ce^{-2n\pi} + De^{2n\pi}\end{cases}$$
This system has the solution $C = \frac{10e^{4n\pi}}{Be^{4n\pi} - B}, D = \frac{10}{B - Be^{4n\pi}}$. However, this produces the PDE solution $u = 0$ when plugged back into $u = Bsin(n\pi x)(Ce^{-n\pi y} + De^{n\pi y})$.
I see now how I can proceed using Fourier Series, but why am I only getting the trivial solution out of this method when I use what appears to be valid algebra instead?