Proof of formula for determining eigenvalues