$\renewcommand{\Re}{\operatorname{Re}}$ $\renewcommand{\Im}{\operatorname{Im}}$ $\newcommand{\bR}{\mathbb{R}}$ $\newcommand{\bC}{\mathbb{C}}$ $\newcommand{\bZ}{\mathbb{Z}}$ $\newcommand{\const}{\operatorname{const}}$ $\newcommand{\sgn}{\mathrm{sgn}}$
Consider Schrödinger operator \begin{equation} H=h^2D^2 +V(x) \label{eq-6.3.1} \end{equation} and an energy level $E$ such that \begin{align} &V(x_E^-)=V(x_E^+)=E, && V(x)< E \iff \ x_E^-< x < x_E^+, \label{eq-6.3.2}\\[3pt] &V'(x_E^-)< 0, \quad V'(x_E^+) > 0. \label{eq-6.3.3} \end{align}
We are interested in the energy levels (i.e. eigenvalues) of $H$ close to $E$. To do this we employ the stationary theory. Consider Lagrangian manifold $\Lambda_E=\{(x,p): p^2+V(x)=E\}$ and construct function $S$ on it which everywhere except the end points $(x_E^\pm)$ can be locally expressed as function of $x$ satisfying $S_x^2 + V(x)=E$.
However globally $S(x)$ is not defined uniquely: as point $(x,p)$ circles once counterclockwise $\Lambda$ its increment is $\Delta S= \int_{\Lambda_E} p\,dx$. On the other hand,
Exercise 1. Prove that Maslov index of this path is $2\mod 4$.
Therefore argument of amplitude $u_h(x)$ is increased by $h^{-1}\int_{\Lambda_E} p\,dx +\pi$ where $\pi$ comes from the increment of amplitude $A(x)$.
Since $u_h(x)$ must be a function of $x$ we conclude that this increment is $\equiv 0\mod 2\pi\bZ$: \begin{equation} F(E):= -\frac{1}{2\pi h} \int_{\Lambda_E} p\,dx = n +\frac{1}{2}\qquad n\in \mathbb{Z}. \label{eq-6.3.4} \end{equation}
This is Bohr-Sommerfeld formula. One can prove rigorously
Theorem 1.
Remark 1.
Example 1. As $V(x)=x^2$ (harmonic oscillator) then $F(E)=\pi E$ and $E_n= (2n+1)h$ precisely. Eigenfunctions are $h^{-\frac{1}{4}} e_n (h^{-\frac{1}{2}}($ where $e_n$ are Hermite functions.
Remark 2. What we denote by "$h$"' physicists denote by "$\hbar$", and "their" $h=2\pi \hbar$ is the minimal possible action (according to N. Bohr).