Please read the following:
Chapter 7.2: Utility Maximization and Demand (eText)