Solution (source code)

= Solution

The <initial condition> makes $p_\theta=0$ at all times. Accessible radii obey $|p_z-qA(r)|\leq\sqrt{2mH}$. For $q>0$ and $p_z>\sqrt{2mH}$, monotonicity of $A$ gives exactly the two stated turning equations and confinement to the interval between their unique roots.

The squared condition alone omits a sign qualification. More generally both <Positive root>[positive roots] require $p_z/q>0$, and are the sorted roots $A(r)=(p_z\pm\sqrt{2mH})/q$. For example $q=-1$, $A=r$, $p_z=-3$, $2mH=1$ confines the <orbit (dynamical system)>[orbit] to $2\leq r\leq4$, but the source's named $r_1,r_2$ equations reverse those labels. This is a convention issue, not a failure of confinement.