Solution (source code)

= Solution

The incident <X-ray> drives the <electrons> of an atom. Away from an <absorption edge>, and when the photon <energy> greatly exceeds the relevant electronic binding energies but is small compared with $m_ec^2$, each electron has approximately the same <Thomson scattering> amplitude. The much heavier nucleus makes a negligible contribution because its acceleration is much smaller.

For <elastic scattering>, the amplitudes from different bound <electrons> add coherently. In units of the single-electron amplitude, the <atomic scattering factor> is the <Fourier transform> of the bound-electron <number density>:
$$
f(\mathbf q)=\int n_e(\mathbf r)e^{i\mathbf q\cdot\mathbf r}\,d^3r,
\qquad f(\mathbf0)=N_e.
$$
Consequently, when the <electron> cloud is not well resolved by the <scattering vector>, its internal phase differences are small and
$$
\boxed{f\simeq N_e,\qquad I\propto N_e^2.}
$$
This is an approximation to the coherent <scattering amplitude>, not an assertion that independently scattered intensities add as $N_e$. At larger momentum transfer, destructive interference within the cloud reduces $f$; near <absorption edges>, the <atomic scattering factor> acquires dispersive corrections. <Inelastic scattering> is a separate contribution. In an <ionic crystal>, use the ion's bound-electron count rather than automatically using the neutral atom's atomic number.