How do you find the 2nd order perturbed energy shift from the quantised dipole hamiltonian?

Without using the Rotating wave approximation how do you find the trapping potential $U(\mathbf r)$ experienced by an atom at position $\mathbf r$ for arbitrary laser frequencies?

This can be done with time-independent perturbation theory where our full Hamiltonian is given by

$$H=\hbar\omega_0 \lvert e \rangle\langle e \rvert+\hbar a^\dagger a+\frac{dE}2(a^\dagger+a)\left(\lvert e \rangle\langle g \rvert+\lvert g \rangle\langle e \rvert\right)$$

We can start from the ground state with $n$ photons so we have

$$\lvert \psi\rangle^{(0)}=\lvert g,n\rangle$$

$$U=\frac{\left|\langle g,n\rvert H\lvert e,n+1\rangle\right|^2}{n\hbar \omega-(\hbar\omega_0+(n+1)\hbar\omega)}+\frac{\left|\langle g,n\rvert H\lvert e,n-1\rangle\right|^2}{n\hbar \omega-(\hbar\omega_0+(n-1)\hbar\omega)}$$
$$U\propto\frac1{\omega_0+\omega}+\frac 1{\omega_0-\omega}$$