Supply, Demand and Prices

Solving for Market Equilibrium With Linear Equations

Solve for equilibrium price and quantity step by step, then handle shifts, a tax, a price ceiling and a floor with checked worked examples.

Key takeaways

  • Equilibrium is found by setting the demand and supply equations equal and solving for the price.
  • Substituting the price into both equations is a quick and reliable check on the arithmetic.
  • A per-unit tax can be handled by letting sellers respond to the price they keep after paying it.
  • Answers make sense only when price and quantity are not negative and each equation is used inside its valid range.

To find a market equilibrium with equations, set quantity demanded equal to quantity supplied, solve for price, then put that price back into either equation to get quantity. With straight-line demand and supply this takes a few lines of algebra.

The same routine then handles questions that are hard to answer from a sketch: how far the price moves after a shift, how a tax is divided and how large a shortage a price limit would create.

The general setup

A linear demand curve and a linear supply curve can be written like this.

Qd = a − b·P        demand, with b > 0
Qs = c + d·P        supply, with d > 0

Here P is price, a and c are constants that set the position of each line, and b and d show how many units quantity changes when price rises by one. Setting Qd = Qs gives

a − bP = c + dP
a − c = (b + d)·P
P* = (a − c) ÷ (b + d)
Q* = a − b·P* = (a·d + b·c) ÷ (b + d)

The asterisks mark equilibrium values. The result is economically sensible when P* and Q* are positive, which requires a > c and a·d + b·c > 0. The idea behind the balance itself is described in how markets settle on a price.

It helps to read each letter in words before calculating. The constant a is the quantity buyers would take if the good were free, at least on paper, since a line is rarely reliable that far from observed prices. The coefficient b says how many sales are lost for each extra dollar. On the supply side, d says how many extra units sellers offer for each extra dollar.

The formula for P* also tells a story. Anything that raises a, such as stronger demand, raises the price. Anything that raises c, meaning more supplied at every price, lowers it. The larger the combined responsiveness b + d, the less the price has to move to absorb a given disturbance, because both sides adjust readily.

A worked example

Take a hypothetical market for bicycle tune-ups per week.

Qd = 120 − 4P
Qs = −30 + 6P        (valid for P ≥ 5)

120 − 4P = −30 + 6P      set quantities equal
150 = 10P                add 4P and 30 to both sides
P* = 15
Q* = 120 − 4·15 = 60     from demand
Check: −30 + 6·15 = 60   from supply

The equilibrium is $15 and 60 tune-ups. Both equations agree, so the arithmetic holds.

Four steps to solve a linear market
1 Write both curves Express quantity in terms of price 2 Set them equal Quantity demanded equals supplied 3 Solve for price Collect terms and divide 4 Find quantity and check Substitute into both equations Write both curves Express quantity in terms of price 1 Set them equal Quantity demanded equals supplied 2 Solve for price Collect terms and divide 3 Find quantity and check Substitute into both equations 4

Working with inverse equations

Textbooks often give price as a function of quantity, which matches the way graphs are drawn. Solving the same two equations for P gives

Demand:  P = 30 − 0.25·Q
Supply:  P = 5 + Q ÷ 6

30 − 0.25Q = 5 + Q/6        set prices equal
25 = (5/12)·Q               since 1/4 + 1/6 = 5/12
Q* = 60,  P* = 15

The inverse form also gives the intercepts for a sketch. Demand meets the price axis at $30, where nothing is bought, and the quantity axis at 120. Supply starts at a price of $5 and rises by $1 for every 6 units. A refresher on slopes is in reading economic graphs.

Solving after a shift

Suppose a cycling event raises demand by 30 tune-ups at every price.

150 − 4P = −30 + 6P
180 = 10P
P* = 18
Q* = 150 − 72 = 78       check: −30 + 108 = 78

Price rises by $3 and quantity by 18. The curve shifted by 30, but traded quantity grew by less because the higher price held back some buyers.

For linear curves there is a tidy shortcut. If demand shifts right by an amount k at every price, price rises by k ÷ (b + d) and quantity by d·k ÷ (b + d). Here that is 30 ÷ 10 = 3 and 6 × 30 ÷ 10 = 18.

Adding a per-unit tax

Now return to the original market and charge sellers a $5 tax on each tune-up. If buyers pay P, sellers keep P − 5, and supply depends on what they keep.

Qs = −30 + 6·(P − 5) = −60 + 6P
120 − 4P = −60 + 6P
180 = 10P
Buyer price = 18,  seller keeps 13
Q = 120 − 72 = 48        check: −30 + 6·13 = 48

Of the $5 tax, buyers bear $3 (the price they pay rose from 15 to 18) and sellers bear $2 (what they keep fell from 15 to 13). The buyers' share equals d ÷ (b + d) = 6 ÷ 10. Charging buyers instead would give the same final prices and quantity. That separation between who sends the payment and who bears it is the subject of who really pays a tax.

Tax revenue is $5 × 48 = $240 per week. The 12 tune-ups no longer traded represent lost gains, calculated in deadweight loss as ½ × 5 × 12 = $30.

Adding a subsidy

A subsidy runs the tax calculation in reverse. Suppose sellers receive $5 from a public program for each tune-up. If buyers pay P, sellers take in P + 5.

Qs = −30 + 6·(P + 5) = 6P
120 − 4P = 6P
120 = 10P
Buyer price = 12,  seller receives 17
Q = 120 − 48 = 72        check: 6·12 = 72

Buyers gain $3 of the $5 through a lower price, and sellers gain $2. The program costs $5 × 72 = $360 per week. The split follows the same ratio as the tax, because it depends on the slopes and not on which side the payment is handed to.

Whether such a program is worthwhile cannot be read from these lines alone. That depends on whether the activity brings benefits to people outside the market, on what else the money could buy and on how much one values the gains to each group.

Price ceilings and floors

A legal maximum below equilibrium, say $10, is solved by evaluating each equation at that price.

Ceiling P = 10:  Qd = 80,  Qs = 30,  shortage = 50

Only 30 tune-ups can happen, since sellers offer no more. A legal minimum above equilibrium, say $20, reverses the picture.

Floor P = 20:    Qd = 40,  Qs = 90,  surplus = 50

Only 40 are bought. A ceiling above $15 or a floor below $15 would change nothing, because the market price already satisfies the rule. Such a limit is called nonbinding.

Reading responsiveness from the answer

Slopes are not elasticities, but you can compute elasticities at the equilibrium. Multiply the slope of quantity with respect to price by P* ÷ Q*.

Demand elasticity = −4 × 15/60 = −1.0
Supply elasticity =  6 × 15/60 =  1.5

At this point a 1 percent price rise would reduce quantity demanded by about 1 percent and raise quantity supplied by about 1.5 percent. Elsewhere on the same lines the values differ, as shown in price elasticity calculations.

A limit on quantity

Rules can restrict quantity instead of price. Say a permit system allows only 40 tune-ups a week in the original market. Use each curve in its inverse form to find two different prices at that quantity.

Demand price at Q = 40:  P = 30 − 0.25·40 = 20
Supply price at Q = 40:  P = 5 + 40/6 ≈ 11.67

Buyers will pay about $20 for the 40th tune-up, while a seller would have provided it for about $11.67. If permitted sellers charge what the market will bear, the price is $20, and the gap of about $8.33 per unit goes to whoever holds the right to sell. A cap above 60 would not bind, since the free market trades only 60.

Checking an answer without algebra

Three quick tests catch most errors.

First, substitute the price into both equations. If they give different quantities, something went wrong. Second, check the direction. Stronger demand should raise both price and quantity here. A tax on each unit should raise the buyer's price, lower what the seller keeps and reduce quantity. Third, check the size. With a $5 tax, neither side can bear more than $5 when demand slopes down and supply slopes up.

A table of quantities at a few prices on either side of your answer is another good habit. At $14 the tune-up market has demand of 64 and supply of 54, a shortage. At $16 it has demand of 56 and supply of 66, a surplus. The balance must lie between them, as it does.

Mistakes to watch for

  • Dropping a sign. Moving −4P across the equals sign makes it +4P.
  • Mixing forms. Do not set an expression for quantity equal to one for price.
  • Using a line outside its range. If the formula gives negative quantity, the true quantity is zero.
  • Ignoring units. If Q is in thousands, an answer of 60 means 60,000.
  • Accepting impossible results. A negative equilibrium price usually signals an algebra error or lines that do not cross where trade makes sense.
  • Treating the lines as fact. Linear equations are approximations, most trustworthy near observed prices.

When two markets are linked

Sometimes one good's demand depends on another's price, so you solve two equations together. Take a hypothetical pair of substitutes with supply fixed at 50 units of X and 60 units of Y.

X:  Qx = 100 − 5·Px + 2·Py = 50
Y:  Qy = 120 − 4·Py + 1·Px = 60

From X:  Px = 10 + 0.4·Py
Into Y:  120 − 4·Py + 10 + 0.4·Py = 60
         70 = 3.6·Py   →  Py ≈ 19.44,  Px ≈ 17.78

Checking the first market gives 100 − 88.89 + 38.89 = 50. Neither price could be found alone, which is the practical reason to think about related markets together.

Common questions

Try one yourself: Qd = 90 − 2P and Qs = 10 + 3P

Setting them equal gives 80 = 5P, so P* = 16. Demand then gives 90 − 32 = 58, and supply gives 10 + 48 = 58.

What if the curves are not straight?

The principle is unchanged: set quantity demanded equal to quantity supplied. The algebra may need a quadratic formula, logarithms or a numerical method.

Where do the numbers a, b, c and d come from?

In class they are given. In research they are estimated from data, which is hard because observed prices and quantities reflect both curves at once.

Written for 4Economics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 49 articles in Supply, Demand and Prices →

Latest news on this topic