Local density profiles in thin films and multilayers from diffuse x-ray and neutron scattering