We present analytical expressions for the dynamic structure factor, or form factor S(k,omega), which is the quantity describing the x-ray cross section from a dense plasma or a simple liquid. Our results, based on the random phase approximation for the treatment on the charged particle coupling, can be applied to describe scattering from either weakly coupled classical plasmas or degenerate electron liquids. Our form factor correctly reproduces the Compton energy down-shift and the known Fermi-Dirac electron velocity distribution for S(k,omega) in the case of a cold degenerate plasma. The usual concept of scattering parameter is also reinterpreted for the degenerate case in order to include the effect of the Thomas-Fermi screening. The results shown in this work can be applied to interpreting x-ray scattering in warm dense plasmas occurring in inertial confinement fusion experiments or for the modeling of solid density matter found in the interior of planets.