See attached file.
The Schrödinger equation is:
[-hbar^2/(2m) nabla^2 + V(x, y)]psi(x, y) = E psi(x, y)
In case of the infinite 2d square well, V(x, y) = 0 inside the well, so there we have:
-hbar^2/(2m) nabla^2 psi(x, y) = E psi(x, y) (1)
Outside the well the wavefunction is zero. The wavefunction is continuous, which means that it has to be zero at the boundary of the well. We can solve the differential equation (1) by writing psi(x, y) as a product of a function that only depends on x and a function that only depends on y:
psi(x, y) = X(x) Y(y) (2)
If we substitute (2) in (1) and divide both sides by psi(x, y), we get:
1/X d^2X/dx^2 + 1/Y d^2Y/dy^2 = -2m/hbar^2 E (3)
The first term on the l.h.s. can only depend on x, the second can only depend on y. The sum must yield the constant on the r.h.s.. This means that both terms on the l.h.s. must be constants, because any x dependence of the first term cannot be canceled by the second term and vice versa for any y dependence of the second term. This means that:
1/X d^2X/dx^2 = px (4)
1/Y d^2Y/dy^2 = py (5)
where px and py are constants. Eq. (3) then implies that:
px + py = -2m/hbar^2 E (6)
If we assume that both px and py are negative we can put
px = -kx^2
py = ...
A detailed solution is given.