MathemagiciansLibraryExplorationsDeep Dives
← Economics · Upper Secondary
EconomicsUpper Secondary

Finding equilibrium algebraically — supply equals demand

EU2.1 — Markets › EU2.1.4 — Market Equilibrium and InterventionLecture 1 of 4~2690 words

A price that nobody chose

Go back to the town with the coffee market. Buyers' plans are cups per week. Sellers' plans are . In the lecture on consumer and producer surplus, the two plans matched at a price of $4, with 300 cups sold.

But who decided on $4? No government set it. No meeting of café owners agreed on it. Most buyers have never seen the demand curve, and most cafés have never seen the supply curve. Yet the price ends up close to $4. That lecture promised to show how a market finds this price. This lecture keeps that promise. Then it shows how to find the price yourself, exactly, with two lines of algebra. Then it uses the algebra to answer a bigger question: what happens to the price when something changes?

What happens at the wrong price

Start at a price that is too low, $3. Buyers want cups. Sellers offer only cups. So 150 cups are wanted that nobody is making. Economists call this a shortage, or excess demand.

A shortage does not stay quiet. Queues form, and cafés sell out early. Some buyers would happily pay more than $3, so they do. Cafés notice that they could charge more and still sell every cup. So the price rises.

Now try a price that is too high, $5. Buyers want only 250 cups. Sellers offer 400. So 150 cups are left unsold at the end of the week. This is a surplus, or excess supply. Cafés with spare coffee cut their prices to sell it. So the price falls.

0 100 200 300 400 500 600 0 2 4 6 8 10 Quantity (cups per week) Price ($) D S surplus 150 shortage 150 P* = 4
The coffee market. At $5, sellers offer 400 cups but buyers want 250: a surplus of 150 cups pushes the price down. At $3, buyers want 350 cups but sellers offer 200: a shortage of 150 cups pushes the price up. Only at $4 do the plans match, at 300 cups.

Each wrong price creates a push towards $4. Below $4 the push is up, and above $4 it is down. At $4 itself there is no push, because every buyer who wants a cup at that price gets one, and every café sells all it planned to sell. A price where the push stops is called the equilibrium. Nobody chose it. It is simply the only price where nothing forces a change.

Try it yourself. Move the price and watch the gap between the two plans.

Explore — the push towards equilibrium

Move the price. Watch the gap between what buyers want and what sellers offer, and which way the price is pushed. Find the price where the push stops.

The two plans for coffee at five prices. The gap is what buyers want minus what sellers offer.

Price ($)Buyers wantSellers offerGapPush on price
2400100300up (shortage)
3350200150up (shortage)
43003000none (equilibrium)
5250400−150down (surplus)
6200500−300down (surplus)

Each $1 rise in price closes the gap by 150 cups: 50 fewer cups wanted and 100 more offered.

Did you notice how steady the gap is? Every $1 rise in price makes buyers want 50 fewer cups. It also makes sellers offer 100 more. So the gap closes by cups for every dollar. At a price of zero, the gap would be cups. To close a gap of 600 at 150 per dollar takes dollars. That is where $4 comes from. That is it. That is the whole idea: the equilibrium price is how far the price must rise to close the gap between the two plans.

Finding the equilibrium with algebra

The equilibrium is defined by one condition: the two plans match. So write that condition as an equation and solve it.

Equilibrium by algebra

1. Set quantity demanded equal to quantity supplied: .

2. Solve the equation for the price. This is .

3. Put into both equations. Each must give the same quantity, . If they do not, there is a mistake.

For the coffee town:

Look at the middle step. The 600 is the gap at a zero price. The 150 is how fast the gap closes per dollar. The algebra is doing exactly what the explorer showed. Then , and the check gives . The two match.

The same steps work for any pair of straight lines. Write demand as and supply as . Here and are positive: is how many fewer units buyers want for each $1 rise, and is how many more units sellers offer. Setting the plans equal gives , so:

Read the price formula in words. The top, , is the gap at a zero price. The bottom, , is how fast the gap closes. You do not need to learn the quantity formula. Substituting into either equation always gets you there, and the check catches mistakes.

Worked Example 1 — A market from two equations

In a market, and , with prices in dollars and quantities in units per week. Find the equilibrium.

Plans match: . Collect the numbers on one side and the prices on the other: . So .

Quantity, from both equations: and . They agree, so .

What it means: the gap at a zero price is 80 units. It closes by 5 units per dollar, 2 from buyers and 3 from sellers.

Stop and think

A student solves and gets . Then she writes " too, because at equilibrium the two sides are equal." What has she mixed up?

Show the answer

She has mixed up the price with the quantity. At equilibrium, the two quantities are equal: buyers want 68 and sellers offer 68. The price, $16, is a different kind of number. It is measured in dollars, not in units. To find , put the price into one of the equations: . Then check it in the other. Keeping track of units is the easiest way to avoid this slip: is always in dollars, is always in units per week.

When a curve shifts: compare the before and after

Finding one equilibrium is useful. Comparing two is more useful. Economists call this comparative statics: change one equation, solve again, and compare the new equilibrium with the old one.

Worked Example 2 — Demand rises

In the market of Worked Example 1, incomes rise, and buyers want 30 more units at every price. Demand becomes . Supply is unchanged.

New equilibrium: , so . The new price is . Then , and the check gives .

Compare: the price rises from $16 to $22, by $6. The quantity rises from 68 to 86, by 18 units.

A puzzle: buyers want 30 more units, so why does the quantity rise by only 18? Look at the old price, $16. Buyers now want units, but sellers still offer 68. That is a shortage of 30. The price must rise until the gap closes. Each $1 closes 5 units, so the price rises by dollars. Over that $6, sellers offer more units. Buyers want fewer than they wanted at $16. So of the 30 extra units buyers wanted, 18 are made and 12 are priced away.

0 20 40 60 80 100 120 140 0 10 20 30 40 50 60 70 Quantity (units per week) Price ($) D₁ D₂ S A B +30
Demand shifts right by 30 units at every price, from D₁ to D₂. The equilibrium moves from A (68 units at $16) to B (86 units at $22). The quantity rises by only 18, because the higher price prices away 12 of the 30 extra units.

This split is the most important thing the algebra shows. It depends on the slopes. Sellers here respond more strongly to price (3 units per dollar) than buyers do (2 units per dollar). So most of the change shows up as more quantity. If sellers could hardly respond, almost all of it would show up as a higher price. This is the price elasticity of supply from the last topic, now inside an equation.

Worked Example 3 — Supply falls

Back to the original market. Costs of production rise, so sellers offer 15 fewer units at every price. Supply becomes . Demand is the original .

New equilibrium: , so and . Then , and the check gives .

Compare: the price rises by $3. The quantity falls by 6. Buyers pay more and get less. The 15-unit cut is split again: at the old price there is a shortage of 15, which needs a $3 rise to close. Over that $3, sellers restore 9 units and buyers give up 6.

Now shift the curves yourself.

Graph builder — shifting demand and supply

Start from Qd = 100 − 2P and Qs = 20 + 3P. Shift demand and supply by a number of units at every price. Watch the new equilibrium. Then shift both curves to the right together, by different amounts. Which result is always certain, and which one can go either way?

Starting from Qd = 100 − 2P and Qs = 20 + 3P (equilibrium $16 and 68 units), each row shifts the curves by the number of units shown at every price.

Demand shiftSupply shiftNew P*New Q*Change
+3002286P up 6, Q up 18
0−151962P up 3, Q down 6
+30+301698P unchanged, Q up 30
+10+301286P down 4, Q up 18

The rule behind every row: price change = (demand shift − supply shift) ÷ 5, and quantity change = (3 × demand shift + 2 × supply shift) ÷ 5.

When both curves move

The rule you found in the graph builder explains every case. In this market, the price change is the demand shift minus the supply shift, divided by 5.

When both curves move, one result is still certain, and the other depends on the sizes of the shifts. Suppose both curves move right. Both shifts add to the quantity, so the quantity certainly rises. But demand pushes the price up while supply pushes it down. Which push wins depends on which shift is bigger. In the graph builder, equal shifts of 30 left the price at $16. A demand shift of 10 with a supply shift of 30 lowered it to $12.

Supply shifts rightSupply shifts left
Demand shifts rightQ rises; P could go either wayP rises; Q could go either way
Demand shifts leftP falls; Q could go either wayQ falls; P could go either way

There is no need to learn this table as four facts. In each cell, ask one question: do the two shifts push the price the same way, and do they push the quantity the same way? Where they push the same way, the result is certain. Where they push in opposite ways, you must know the sizes. So a good answer states the certain result and then the condition for the other one.

A real case: bird flu and the price of eggs

Worked Example 4 — Supply falls in a real market (United States, 2022)

The event. In 2022, an outbreak of avian influenza spread through egg farms in the United States. When a flock was infected, the birds died or were destroyed to stop the disease spreading. From February to December 2022, more than 43 million egg-laying hens were lost (United States Department of Agriculture, Economic Research Service, January 2023). Feed for the hens also cost more: about 13% more in December 2022 than a year before (agricultural economist Jayson Lusk, January 2023, from USDA data).

The prediction. Both changes shift supply to the left: fewer hens, and higher costs for the hens that remain. Demand for eggs had no reason to change much. So the price should rise and the quantity should fall. There is a second prediction about the split. People keep eating eggs even when they cost more, so buyers respond only weakly to price. In the algebra, is small. A small means that most of the supply cut shows up as a higher price, and only a little as fewer eggs bought.

What happened. Production of table eggs in December 2022 was about 6.6% lower than a year earlier (Lusk, from USDA data). The average price of a dozen large eggs in United States cities was about $1.79 in December 2021 (US Bureau of Labor Statistics). It rose to about $4.25 in December 2022, and to about $4.82 in January 2023 (same source). As flocks were rebuilt, supply recovered and the price fell back, to about $2.22 by June 2023 (same source).

The verdict. The directions are exactly what the model predicts: supply left, price up, quantity down, and the reverse when supply recovered. The sizes match the second prediction too. A cut of under 7% in quantity came with a rise of over 130% in the price of a dozen. Lusk notes that estimates of how strongly egg buyers respond to price are very low, around 0.1 to 0.15, which fits this split. What the simple model leaves out is time. The price rose and fell over months, as farms restocked, while the model jumps straight from one equilibrium to the next.

Worked Example 5 — From equilibrium to surplus

For and , find consumer surplus at equilibrium.

The equilibrium is and . Demand meets the price axis where , so .

So buyers gain $1 156 per week beyond what they pay. The algebra gives you the corner of the triangle, and the welfare diagram does the rest.

Three classic mistakes

Trap 1 — Giving the price as the quantity

Solving gives the price, not the quantity. The quantity comes from putting that price back into an equation. Always put it into both, and check that the two quantities agree.

Trap 2 — Reading a shift as a price change

When demand changes from to , buyers want 30 more units at every price. The price does not rise by 30, and the quantity does not rise by 30 either. Solve again: the price rises by 6 and the quantity by 18. The shift is the start of the story, not the answer.

Trap 3 — Claiming two certain results when both curves shift

When demand and supply both shift, only one of price and quantity has a certain direction. Saying "price and quantity both rise" after demand and supply both shift right is wrong unless you know the demand shift is bigger. State the certain result, then the condition for the other.

Try it yourself

Work each one on paper first. Open a hint only when you are stuck.

  1. In a market, and . Find the equilibrium price and quantity.

    Hint 1

    Set . Move the numbers to one side and the prices to the other.

    Hint 2

    You should get .

    Full answer

    , so . Then and . They agree, so . The gap at a zero price is 240 units, and it closes by 6 units per dollar.

  2. In the market of question 1, buyers now want 30 more units at every price. Find the new equilibrium. Explain why the quantity rises by less than 30.

    Hint 1

    The new demand is . Supply is unchanged.

    Hint 2

    At the old price of $40, find the shortage. How many dollars of price rise does it take to close it?

    Full answer

    , so and . Then ; check: . The price rises by $5 and the quantity by 10. At the old price of $40 there is a shortage of 30. Each $1 closes 6 units, so the price must rise by $5. Over that $5, sellers offer more, and buyers give up of the extra units they wanted. Here buyers respond more strongly than sellers, so most of the shift is priced away.

  3. Start again from question 1. Demand rises by 30 units at every price, and at the same time supply rises by 30 units (). Find the new equilibrium. Then repeat with a supply rise of 60 units instead (). What does this show about the price when both curves shift right?

    Hint 1

    Solve , then .

    Hint 2

    Compare each new price with the original $40, and each new quantity with the original 40.

    Full answer

    With equal shifts: , so and . The price is unchanged and the quantity rises by 30. With the bigger supply shift: , so and . The price falls by $5 and the quantity rises by 50. Checks: and . The quantity rose both times; that result is certain. The price stayed the same in one case and fell in the other. Its direction depends on which shift is bigger.

  4. An invented egg market has and (millions of dozens per month, price in dollars). Disease cuts supply by 12 at every price, so . Find both equilibria and the percentage changes in price and quantity. Then show, for general and , that a supply cut of raises the price by and lowers the quantity by . What happens to the quantity change when is very small?

    Hint 1

    Before: . After: .

    Hint 2

    For the general case, use . Replacing with adds to the top. Then use .

    Full answer

    Before: , so and . After: , so and . Checks: and . The price rises by $2, which is about 14% (). The quantity falls by 4, which is about 5% ().

    In general, the new price is , so the price rises by . Quantity demanded is , so it falls by times the price rise: . Here that is , as found above. When is very small, the quantity hardly falls at all and the price rise approaches . Buyers who barely respond to price take the whole cut as a higher price. That is the egg market of 2022.

The bigger idea

A market price is not a fact that someone announces. It is the solution of an equation that nobody writes down. Millions of buyers and sellers each follow their own plan. The shortages and surpluses push the price until the plans match. The algebra simply does in one line what the market does over days or months.

That is why the algebra is so powerful for policy. Before a government taxes a product, fixes its price or pays a subsidy, it can change one equation and solve again. The next lectures do exactly that. A tax shifts supply, and the split you saw in this lecture decides who really pays it.

Key concepts in this lesson