  We study the origin of cores and density profiles of gaseous baryonic
structures in cosmology. By treating the baryons as a viscous gas, we find that
both spheres and disks are possible solutions. We find analytically that the
density profiles have inner and outer solutions, which in general are
different. For disks we identify a central core, with density profile rho_d =
constant, and the outer profile rho_d ~ r^{-3}. For spherical structures we
find the profile rho_s ~ r^{-6}. In the presence of a dominating central black
hole we find the inner profile rho ~ r^{-3/2}. When the mass is dominated by a
dark matter component then the baryonic density profile will depend on the dark
matter profile, and we point out how one can use this connection to infer the
DM profile directly by observing the baryonic density profile.
