An electron moving through the electric field of the nucleus experiences a magnetic field due to its velocity (relativistic effects). An electron circulating around a given axis (which we will define to be $z$) experiences a magnetic field pointing in the $z$ direction. Therefore a spin up or down electron ( $S_z\pm \frac 12 \hbar$) in the same orbital will have different energies by an amount that depends on $L_z$. Thus we can this a spin orbit coupling or interaction.
We know
$$ V_{S.O.}=f(r)\,\underline{L}\cdot\underline{S} $$
where
$$ f(r)=\frac1{2m_e^2c^2}\,\frac1r\,\frac{\mathrm{d}V}{\mathrm{d}r}=\frac{e^2}{8\pi\varepsilon_0m_e^2c^2r^3} $$
🗒️Note: the factor of $1/c^2$ which shows clearly that this is a relativistic effect
In quantum mechanics we can simply promote each of the variables in $V_{S.O.}$ to operators
$$ \widehat{H}=\widehat{H}0+\widehat{V}{S.O.}=\widehat{H}_0+f(r)\underline{\widehat{L}}\cdot\underline{\widehat{S}} $$
where $\widehat{H}_0$ is the hydrogen Hamiltonian already studied.
To get an idea of the expected size of this effect we can estimate $\underline{\widehat{L}}\cdot\underline{\widehat{S}}\sim\hbar^2$ and $r\sim a_0$ and obtain
$$ \left\langle V_{S.O.} \right\rangle\sim10^{-3}\,\mathrm{eV} $$
This is much smaller than the spacing between hydrogen energy levels $(\sim \rm{few} \,\rm{eV})$ so we can reliably use first order first order perturbation theory to calculate them, but it is large enough to be observed. The effect we will calculate is called the ‘fine structure’ of the atom.
🗒️ Note: now $\widehat L_z$ no longer commutes with $\widehat H$ as it is no longer a central potential.
Therefore states of definite $L_z$ will no longer be stationary states and $m_\ell$ will not be a good quantum number, the same goes for $S_z$ and $m_s$
Let us try the total angular momentum
$$ \begin{aligned} \underline{\widehat{J}}&=\underline{\widehat{L}}+\underline{\widehat{S}} \\ \Rightarrow \underline{\widehat{J}}^2&=\underline{\widehat{L}}^2+2\underline{\widehat{L}}\cdot\underline{\widehat{S}}+\underline{\widehat{S}}^2 \\ \Rightarrow \underline{\widehat{L}}\cdot\underline{\widehat{S}}&=\frac12\left(\underline{\widehat{J}}^2-\underline{\widehat{L}}^2-\underline{\widehat{S}}^2\right) \end{aligned} $$
Therefore, if we are in a definite state of $J^2, L^2$ and $S^2$ then
$$ \left\langle \underline{\widehat{L}}\cdot\underline{\widehat{S}} \right\rangle=\frac12\Bigl(j(j+1)-\ell(\ell+1)-s(s+1)\Bigr)\hbar^2 $$
💼 Case: consider the $2s$ and $2p$ orbitals have $n=2$ and either $\ell=0$ or $\ell=1$ with $m_\ell =-1,0,1$. Each of those 4 states can be occupied by an electron with $m_s=\frac 12 , -\frac 12$. Thus there are $8$ states and they are all degenerate with energy $E)n=-E_r/n^2$
The $\ell=0$ state has $L=0$ and hence $\left\langle\underline{\widehat{L}}\cdot\underline{\widehat{S}}\right\rangle=0$
The $\ell=1$ state we have to combine $\ell=1$ with $s=\frac 12$ so $j=\frac 32$ or $j=\frac 12$
with $j=\frac 32$ we have
$$ \frac 12 \left ( j(j+1)-\ell(\ell+1)-s(s+1) \right )\hbar^2=\frac 12 \hbar ^2 $$
with $j=\frac 12$ we have
$$ \frac12\Bigl(j(j+1)-\ell(\ell+1)-s(s+1)\Bigr)\hbar^2=-\hbar^2 $$
Therefore the energy levels of these states are shifted by amount
$$ \begin{aligned} \Delta E &= \left\langle f(r)\underline{\widehat{L}}\cdot\underline{\widehat{S}}\right\rangle \\ &= \frac{e^2}{8\pi\varepsilon_0m_e^2c^2}\left\langle\frac1{r^3}\right\rangle \frac12\Bigl(j(j+1)-\ell(\ell+1)-s(s+1)\Bigr)\hbar^2\end{aligned} $$
We will take the following definition for $\left\langle\frac1{r^3}\right\rangle$
$$ \left\langle\frac1{r^3}\right\rangle=\frac1{\ell(\ell+\frac12)(\ell+1)n^3a_0^3} \quad \text{for $\ell>0$} $$
Plugging in
$$ \Delta E_n=\frac{E_n^2}{m_ec^2}\,n\frac{j(j+1)-\ell(\ell+1)-s(s+1)}{\ell(\ell+\frac12)(\ell+1)} $$
our $n=2$ state are split into a set of states with energy shifts
$$ \Delta E_2=\frac{(13.6\,\mathrm{eV})^2}{511\,\mathrm{keV}}\times\frac1{24}\left\{\begin{array}{r}+1\\0\\-2\end{array}\right.\quad=1.51\times10^{-5}\,\mathrm{eV}\left\{\begin{array}{r}+1\\0\\-2\end{array}\right. $$
The $+1$ state has degeneracy $4$ ($m_j=-\frac 32 ,\ldots , \frac 32$) The $0$ state has degeneracy $2$ ($m_s=-\frac 12,\frac 12$ or equivalently $m_j=-\frac 12,\frac 12$ since $\ell=0$) and the $-2$ state also has degeneracy $2$ ($m_j=-\frac 12, \frac 12$). There are still $8$ states, the spin-orbit interactions has just split their energies
🍎 A magnetic dipole $\vec \mu$ in a magnetic field $\vec B$ has energy $-\vec \mu\cdot \vec B$ so