The Schrödinger equation for the 1D potential well is given by:
$$-\frac{\hbar}{2m}\frac{\text{d}^2 \psi}{\text{d}x^2}=E\psi$$
Slightly re-written:
$$\psi''+k^2\psi=0\tag{1}$$
where:
$$k^2=\frac{2mE}{\hbar}$$
$(1)$ is a second order, linear, homogeneous differential equation and any decent math textbook will tell you it has the following solution, thus not experimentally obtained:
$$\psi=A\sin kx + B\cos kx$$
where $A$ and $B$ are integration constants.
Their value is determined by means of the boundary conditions $\psi(0)=\psi(L)=0$ (assuming the wave function acts on the domain$[0,L]$.