I try to follow the derivation of Rabi two-level problem but I went into trouble when attempting to set up the equations as many notes have suggested.
Using the book (Laser cooling and trapping by Metcalf and Straten) I am reading. We start by with writing down Schrodinger's equation for a two-level system where the Hamiltonian is given by $H=H_0 + H'$. And $H_0$ absorbs all diagonal terms from $H'$ so that the resulting Schrodinger equations are a coupled differential equations. $$i\hbar\frac{\partial\psi}{\partial t} = H \psi$$ and $$|\psi\rangle = c_g |g\rangle + c_e e^{-i\omega_{eg}t}|e\rangle$$ where $|g\rangle$ is the ground state, $|e\rangle$ is the excited state, and $\omega_{eg}=\omega_e-\omega_g$.
The coupled equations are $$\begin{align} i\hbar \dot{c}_g(t) &= c_e(t)H'_{ge}(t) e^{-i\omega_{eg}}t\\ i\hbar \dot{c}_e(t) &= c_g(t)H'_{eg}(t) e^{i\omega_{eg}}t \end{align} $$
In the book, the author uses $H'(t)=-e\vec{E}(\vec{r},t) \cdot \vec{r}$ and with a plane wave travelling in the $z$-direction, the electric field operator becomes $\vec{E}(\vec{r},t)=E_0\hat{\epsilon}\cos(kz-\omega_l t)$, where $\omega_l$ is the laser frequency. Now if we define Rabi frequency as $$\Omega\equiv \frac{-eE_0}{\hbar}\langle e|r|g\rangle,$$ the element of $H'$ becomes $H'_{eg}=\hbar \Omega \cos (kz-\omega_l t)$.
Here is where I run into problems, I plug in the expression for $H'_{eg}$, differentiate the second equation and use both first order equations to eliminate $c_g(t)$. However the resulting equation contains $z$ dependence that I do not know how to get rid of.
Referring to this note, I see they use the same expression for $H'$ but they also ignored the $z$ dependence. I am wondering what I have missed in considering setting up the equations.