The Schrödinger equation for the [1D potential well ][1] 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]$.


  [1]: https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Supplemental_Modules_(Physical_and_Theoretical_Chemistry)/Quantum_Mechanics/05.5%3A_Particle_in_Boxes/Particle_in_a_1-Dimensional_box