# WKB Approximation on an linear + harmonic potential

I have a quick question:

I have performed the WKB approximation to find the energies of bound states in symmetric potentials (Square, harmonic, ...). To do this I just find the "turning points" by setting $p=0$ and using those turning points as the bounds on my integral:

$$\int_{x^1}^{x^2} p(x) dx=\left(n-\frac{1}{2}\right) \pi \hbar$$ where $p= \sqrt{2m(E-V)}$.

I have come across a problem with a non-symmetrical potential:

$$V(x)=\begin{cases} mgx & x>0\\ \frac{1}{2}kx^2 & x\leq 0 \end{cases}$$

I have found the turning points:

When $x>0$ the turning point is: $\frac{E}{mg}$ and when $x \leq 0$, the turning point is $-\sqrt{\frac{2E}{k}}$

How would I go about "patching" these two potentials together to find a equation for the bound states of this potential?

Would it simply be:

$$\int_{\sqrt{\frac{2E}{k}}}^0 \sqrt{2m(E-\frac{1}{2}kx^2)}\ dx + \int _0^{\frac{E}{mg}} \sqrt{2m(E-mgx)}\ dx =\left(n-\frac{1}{2}\right) \pi \hbar~?$$

The lower limit should be negative: $$\int_{\color{red}-\sqrt{2E/k}}^0 \sqrt{2m\left(E-\frac{1}{2}kx^2\right)} dx + \int _0^{E/mg} \sqrt{2m(E-mgx)} dx =\left(n-\frac{1}{2}\right) \pi \hbar$$ but the answer is yes: this is the correct expression. The general expression for the WKB approximation is $$\int_{x^1}^{x^2}\sqrt{2m(E-V(x))} dx=\left(n-\frac{1}{2}\right) \pi \hbar\tag{WKB}$$ and, in your case, you have a piecewise defined potential, but this doesn't make $V(x)$ special. If you had $V(x)= \mathrm e^{-|x|}\sin (x)$ you would use (WKB) without hesitation. But, depending on how you define the $\sin$ function, this $V(x)$ would also be a piecewise defined function!. My point is that piecewise defined functions are not necessarily different from "standard" functions, say, polynomials.
For the record, if you take $m=\hbar=k=g=1$, the exact eigenvalues$^1$ are $$E_n=0.63202,\ 1.6935,\ 2.5459,\ 3.3407,\ 4.0698,\ 4.7604,\ 5.4229, \ 6.0551,\ 6.6657,\ 7.2596,\cdots$$ while the WKB approximations are $$E_n=0.6705,\ 1.6860,\ 2.5524,\ 3.3386,\ 4.0706,\ 4.7623,\ 5.4221, \ 6.0557,\ 6.6672,\ 7.2597,\cdots$$
$^1$ numerically obtained with Mathematica.