EconGraphs Logo BETA
Note: This work is under development and has not yet been professionally edited.
If you catch a typo or error, or just have a suggestion, please submit a note here. Thanks!
course home page

Lecture 9: Demand Functions and Demand Curves


Click here for the quiz on this reading.

In the last module we solved the utility maximization problem for specific values of $p_1$, $p_2$, and $m$. For example, suppose you had to maximize the Cobb-Douglas utility function \(u(x_1,x_2) = x_1^{1 \over 2}x_2^{1 \over 2}\) subject to a budget line with the equation \(2x_1 + x_2 = 12\) Since the MRS for this utility function is $x_2/x_1$ and the price ratio $p_1/p_2$ is 2, you asserted that the optimum would be characterized by the tangency condition \(\begin{aligned} MRS &= {p_1 \over p_2}\\ {x_2 \over x_1} &= 2\\ x_2 &= 2x_1 \end{aligned}\) And you plugged that into the budget constraint to find the optimal choice: \(\begin{aligned} 2x_1 + 2x_1 &= 12\\ 4x_1 &= 12\\ x_1^\star &= 3\\ x_2^\star &= 2x_1^\star = 6 \end{aligned}\)

However, in this section we’re now interested in characterizing the optimal bundle as a function of prices and income. Therefore we’ll be interested in solving this problem, keeping $p_1$, $p_2$, and $m$ as variables. Therefore our tangency condition will set the MRS equal to the generic slope of the budget line, $p_1/p_2$: \(\begin{aligned} MRS &= {p_1 \over p_2}\\ {x_2 \over x_1} &= {p_1 \over p_2}\\ x_2 &= {p_1 \over p_2}x_1 \end{aligned}\) We’ll then plug this into the generic budget line, $p_1x_1 + p_2x_2 = m$: \(\begin{aligned} p_1x_1 + p_2\left[{p_1 \over p_2}x_1\right] &= m\\ p_1x_1 + p_1x_1 &= m\\ 2p_1x_1 &= m\\ x_1^\star(p_1,p_2,m) &= {m \over 2p_1}\\ x_2^\star(p_1,p_2,m) &= {p_1 \over p_2}x_1^\star(p_1,p_2,m) = {m \over 2p_2} \end{aligned}\) Note that if you then plug in $p_1 = 2$, $p_2 = 1$, and $m = 12$, you get the same bundle as before; but now we have a more general demand function expressing our optimal bundle $(x_1,x_2)$ as a function of the parameters of the model: $p_1$, $p_2$, and $m$.

In the diagram below you can see how this works. The left-hand graph shows a 3D rending of the utility function; the “hill” represents the amount of utility at every bundle $(x_1,x_2)$. The budget line, in green, shows a path over the hill. The blue dot shows the highest point along the path.

The diagram on the right shows the projection of this onto plane: that is, the budget line and the indifference curve through the optimal bundle.

Try changing the prices and income. You can see that the hill does not change but the path over the hill does change, and therefore the highest point along the path changes:

See interactive graph online here.

This is one of the hardest concepts to grasp, especially because it seems like indifference curves “shift” as you change the budget line (and therefore the optimal point). Key to understanding this is that prices do not affect utility: changes in the prices do not affect the curvature of the hill, but only the location of the path over the hill.

Demand functions

Let’s first derive the optimal choice for a few of the utility functions we’ve been looking at. We’ll then see how we can plot the demand curves that correspond to each of the functions. Note that on homework and exams, you should be able to solve for the demand functions for any utility function!

Cobb-Douglas

For a generic Cobb-Douglas utility function \(u(x_1,x_2) = x_1^a x_2^b\) or equivalently, \(u(x_1,x_2) = a \ln x_1 + b \ln x_2\) the MRS is \(MRS = {ax_2 \over bx_1}\) It’s easy to see that all the conditions for using the Lagrange method are met: the MRS is infinite when $x_1 = 0$, zero when $x_2 = 0$, and smoothly descends along any budget line. Therefore, to find the optimal bundle, we will set the MRS equal to the price ratio and plug the result back into the budget constraint.

Setting the MRS equal to the price ratio $p_1/p_2$ gives us the tangency condition \(\begin{aligned} MRS &= {p_1 \over p_2}\\ {ax_2 \over bx_1} &= {p_1 \over p_2}\\ x_2 &= {b \over a}{p_1 \over p_2}x_1 \end{aligned}\) Plugging this back into the budget constraint, we can solve for $x_1$: \(\begin{aligned} p_1x_1 + p_2x_2 &= m\\ p_1x_1 + p_2\left[{b \over a}{p_1 \over p_2}x_1\right] &= m\\ ap_1x_1 + bp_1x_1 &= am\\ p_1x_1 &= {a \over a + b}m\\ x_1^\star(p_1,p_2,m) &= {a \over a + b}{m \over p_1} \end{aligned}\) and therefore \(\begin{aligned} x_2^\star(p_1,p_2,m) &= {b \over a}{p_1 \over p_2}x_1^\star(p_1,p_2,m)\\ &= {b \over \cancel{a}}{\cancel{p_1} \over p_2} \left[ {\cancel{a} \over a + b}{m \over \cancel{p_1}} \right]\\ &= {b \over a + b}{m \over p_2} \end{aligned}\) Intuitively, this means you spend fraction ${a \over a+b}$ of your income on good 1, and fraction ${b \over a + b}$ on good 2.

Try playing around with the graph below to see how $a$, $b$, $p_1$, $p_2$, and $m$ affect the optimal choice:

See interactive graph online here.

Perfect Substitutes

We can write a generic perfect substitutes utility function as \(u(x_1,x_2) = ax_1 + bx_2\) This will have a constant MRS of \(MRS = {MU_1 \over MU_2} = {a \over b}\) Since the MRS is constant and the price ratio is constant, one of the following three conditions must hold:

We therefore need to express the optimal bundle as a piecewise function, to delineate what happens in each of those three cases: \(\begin{aligned} x_1^\star(p_1,p_2,m) &= \begin{cases} {m \over p_1} & \text{ if }{a \over b} > {p_1 \over p_2 }\\ \\ \left[0, {m \over p_1}\right] & \text{ if }{a \over b} = {p_1 \over p_2 }\\ \\ 0 & \text{ if }{a \over b} < {p_1 \over p_2 } \end{cases}\\ \\ x_2^\star(p_1,p_2,m) &= \begin{cases} 0 & \text{ if }{a \over b} > {p_1 \over p_2 }\\ \\ \left[0, {m \over p_2}\right] & \text{ if }{a \over b} = {p_1 \over p_2 }\\ \\ {m \over p_2} & \text{ if }{a \over b} < {p_1 \over p_2 } \end{cases} \end{aligned}\) Try playing around with the graph below to see how $a$, $b$, $p_1$, $p_2$, and $m$ affect the optimal choice:

See interactive graph online here.

Quasilinear

With a quasilinear utility function of the form \(u(x_1,x_2) = v(x_1) + x_2\) the marginal rate of substitution is just $v^\prime(x_1)$. If we assume $v^\prime(x_1)$ is continuous and exhibits diminishing marginal utility, there is some point at which the MRS equals the price ratio. However, that point is not guaranteed to be in the first quadrant (i.e. have positive quantities of both good 1 and good 2), so corner solutions are possible. In particular, with a quasilinear utility function, it may be the case that there is an interior solution characterized by a tangency condition for certain values of $p_1$, $p_2$, and $m$, and a corner solution for other values.

For example, consider the utility function \(u(x_1,x_2) = a \ln x_1 + x_2\) For simplicity, let’s suppose that good 2 is “dollars spent on other goods;” this is a convenient way to analyze a generic tradeoff between “good 1” and “all other goods.” Since good 2 is measured in dollars, $p_2$ is just 1 (more specifically, 1 dollar per dollar), so the price ratio is $p_2 = 1$. This means that the MRS is \(MRS = {MU_1 \over MU_2} = {a/x_1 \over 1} = {a \over x_1}\) Because this is measured in “units of good 2 per units of good 1” as always, and because “units of good 2” is just dollars, we can interpret this MRS as the consumer’s marginal willingness to pay for the $x_1^\text{th}$ unit of good 1. The tangency condition just says that she will buy units of good 1 up until the point where her marginal willingness to pay is equal to the price. We can write this as the “Lagrange solution” $x_1^\mathcal{L}$: \(\begin{aligned} MRS &= p_1\\ {a \over x_1} &= p_1\\ x_1^\mathcal{L} &= {a \over p_1} \end{aligned}\) Because $p_2 = 1$, the budget line has the equation \(p_1x_1 + x_2 = m\) Plugging $x_1^\mathcal{L}$ into that and solving for $x_2$ gives us the Lagrange solution for good 2 of \(x_2^\mathcal{L} = m - a\) However, note that this is positive only if $m \ge a$; if $m < a$, then the consumer doesn’t have enough money to afford $x_1^\mathcal{L}$, so the optimum occurs at a corner solution in which she simply spends all her money on good 1: that is $x_1 = m/p_1$, $x_2 = 0$.

Because the optimal behavior changes according to income level, the demand functions must be defined in a piecewise manner: \(\begin{aligned} x_1^\star(p_1,p_2,m) &= \begin{cases} {a \over p_1} & \text{ if }m \ge a\\ \\ {m \over p_1} & \text{ if }m \le a \end{cases}\\ \\ x_2^\star(p_1,p_2,m) &= \begin{cases} m - a & \text{ if }m \ge a\\ \\ 0 & \text{ if }m \le a \end{cases} \end{aligned}\) Try playing around with the graph below to see how $a$, $p_1$, and $m$ affect the optimal choice. In particular, try lowering $m$ until it is less than $a$, to see how the solution shifts from being an interior solution to a corner solution:

See interactive graph online here.

Note that this is not a “general” solution for all quasilinear utility functions; quasilinear utility functions cover a broad range of possible functions $v(x_1)$, each of which will have its own unique demand function. But because the tangency condition is just a value of $x_1$, they all share the characteristic that the solution will sometimes be a corner solution, and sometimes not.

Demand curves

Having derived the demand functions, we can visualize them in different ways. The most important visualization of a demand function is a demand curve, which is fundamentally a way to understand how the quantity of one good — without loss of generality, good 1 — varies as its own price changes.

For historical reasons, economists plot demand curves with the quantity of the good on the horizontal axis, and its price on the vertical axis. This is a little counterintuitive, because most students are used to seeing the exogenous (independent) variable on the horizontal axis; so remember to follow the right convention in this course!

While we can draw the demand curve for any utility function, let’s look at two of the canonical functions we’ve been looking at in this chapter: Cobb-Douglas, perfect complements, and perfect substitutes.

Demand curve for Cobb-Douglas

Let’s start by plotting our demand curve for a Cobb-Douglas utility function. In the top graph, we have the budget line/indifference curve diagram demonstrating the constrained optimization problem for a consumer with Cobb-Douglas preferences. As the price of good 1 varies, the budget line pivots around the vertical axis: a lower price of good 1 means a larger budget set (and a larger horizontal intercept, $m/p_1$), while a higher price of good 1 means a smaller budget set. As you can see, as the price of good 1 increases, the quantity demanded of good 1 — that is, the value of $x_1^\star$, or the amount of good 1 in the optimal bundle — decreases.

The demand curve, which is shown in the lower graph, plots the relationship between the price of good 1 and the quantity demanded directly. The horizontal axis is the same as in the top graph: that is, it’s the quantity of good 1 in the optimal bundle. The vertical axis here shows the price. Try changing the price of good 1 to see how each diagram changes:

See interactive graph online here.

Note that we label the curve in the bottom diagram $d_1(p_1 | p_2,m)$. We can read this as: “the quantity demanded of good 1 at price $p_1$, holding $p_2$ and $m$ constant.” This is the familiar ceteris paribus assumption from Econ 1.

When plotting a demand curve, the easiest way is often to choose a few prices and plot the quantity demanded at those prices. If you check the “Show $p_1 = 2, 4, 6, 8$” box in the diagram above, it will add the four budget lines corresponding to those prices in the top diagram, and grid lines for those prices in the bottom graph. You can see that the horizontal coordinates of the optimal points subject to each of those budget lines correspond to the horizontal coordinates of the demand curve. We’ll do this exercise in class for a number of functions.

Let’s now take a preliminary look at what some of those demand functions look like, and how they reflect the behavior implied by the utility functions.

Demand curves for perfect substitutes

The behavior for goods that are perfect substitutes was different than these other kinds of goods, because it’s characterized by a discontinuity: below a certain price of good 1, you’ll spend all you money on good 1; but above that price, you’ll spend none. At the exact cutoff price, you’re indifferent between all the bundles on the budget line. This results in a demand curve that “jumps” at a single price from $x_1 = 0$ to $x_1 = m/p_1$:

See interactive graph online here.

To see how this works, check the box marked “Show $m/p_1$.” A dotted curve will appear showing this relationship. All along this curve, the consumer is spending all her money on good 1. Of course, along the vertical axis, she’s spending none of her money on good 1. The horizontal portion of her demand curve occurs at the price of good 1 such that $MRS = p_1/p_2$; that is, when $p_1 = MRS \times p_2$.

Try changing the price of good 2, and see how this affects the demand curve. Changing $p_2$ means this cutoff price shifts: the higher the price of good 2, the higher the price of good 1 at which you’re indifferent between buying these two goods.

Summary and next steps

Fundamentally, there was no new math in this lecture; what we did was to solve for the optimal bundle as a function of the parameters of the budget line, $p_1$, $p_2$, and $m$. We then visualized the relationship between the price of a good and the quantity demanded of that good as a demand curve.

Next time we’ll investigate what factors shift a demand curve.


Reading Quiz

That's it for today! Click here to take the quiz on this reading.

Copyright (c) Christopher Makler / econgraphs.org