In one dimension ,how does energy depend on size of region if an electron is confined there ??

E=h²n²/8ma²

Read
http://www.umich.edu/~chem461/QMChap3.pdf