See the Math Momentum and Energy

The momentum has the value p = h/lambda = hnL/2. The energy of the particle, E, is its kinetic energy, p2/2M, and it follows that the energy of the nth state is En=n2(hL)2/8M.