We present analytical expressions for the dynamic structure factor, or form factor S(k,w,), which is the quantity describing the inelastic x-ray cross section from a dense plasma or a simple liquid. Our results, based on the random phase approximation (RPA) 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 downshift and the usual Fermi-Dirac electron velocity distribution for S(k,w) 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 inside the interior of planets.