$${mgh = \frac{kl^2}{2} - mgl}$$