A function showing how the demand for any good or service relates to underlying variables. The ordinary demand function (or Marshallian demand function) depends on income and prices. The compensated demand function depends on prices and utility. See also aggregate demand; excess demand.