Budget Constraint Explained: Equation, Slope, Intercepts and Shifts
Jude Wallis
Founder of EconLearn · 2nd place internationally, Economics Olympiad (econolympiad.org)
A budget constraint shows every combination of two goods a consumer can afford when spending all of their income, and its equation is Px × X + Py × Y = I. Its intercepts are I ÷ Px on the X axis and I ÷ Py on the Y axis, and its slope is -Px ÷ Py; its absolute value, Px ÷ Py, is the number of units of Y you give up to buy one more unit of X.
On a graph the budget constraint is a straight line, usually called the budget line. This guide explains where the equation comes from, how to find the intercepts and slope, exactly how the line moves when income or a price changes, and why its slope is an opportunity cost. Every example uses the same numbers so you can follow each change from the same starting point.
The budget line equation
Suppose a consumer has an income I to spend on two goods, X and Y, with prices Px and Py. Spending on X is Px × X, spending on Y is Py × Y, and the bundles on the budget line are the ones where total spending equals income:
Px × X + Py × Y = I
Every bundle that satisfies this equation spends the income exactly. To graph it with Y on the vertical axis, solve for Y:
1. Subtract Px × X from both sides: Py × Y = I - Px × X.
2. Divide both sides by Py: Y = I ÷ Py - (Px ÷ Py) × X.
This is slope-intercept form. The vertical intercept is I ÷ Py and the slope is -Px ÷ Py.
### Inside, on, and outside the line
- On the line: the bundle costs exactly I. All income is spent.
- Inside the line (toward the origin): the bundle is affordable with money left over.
- Outside the line: the bundle costs more than I and cannot be bought.
The set of bundles on or inside the line is called the budget set or opportunity set.
Worked example: building a budget line
Setup. Maya has $120 a month for entertainment. Movie tickets (X) cost $15 each and coffees (Y) cost $5 each.
Equation. 15X + 5Y = 120.
X intercept. If she buys only movies, X = I ÷ Px = 120 ÷ 15 = 8 tickets. Check: 8 × $15 = $120.
Y intercept. If she buys only coffee, Y = I ÷ Py = 120 ÷ 5 = 24 coffees. Check: 24 × $5 = $120.
Slope. -Px ÷ Py = -15 ÷ 5 = -3. Check with the intercepts: rise over run from (0, 24) to (8, 0) is (0 - 24) ÷ (8 - 0) = -24 ÷ 8 = -3. Both methods agree.
Slope-intercept form. Y = 120 ÷ 5 - (15 ÷ 5) × X, which simplifies to Y = 24 - 3X.
Here are points along the line. Each one should cost exactly $120.
| Movie tickets (X) | Coffees (Y = 24 - 3X) | Spending on movies | Spending on coffee | Total |
|---|---|---|---|---|
| 0 | 24 | $0 | $120 | $120 |
| 2 | 18 | $30 | $90 | $120 |
| 4 | 12 | $60 | $60 | $120 |
| 6 | 6 | $90 | $30 | $120 |
| 8 | 0 | $120 | $0 | $120 |
Now test three bundles against the line:
- 3 tickets and 10 coffees: 3 × 15 + 10 × 5 = 45 + 50 = $95. That is less than $120, so the bundle is inside the line with $25 unspent.
- 5 tickets and 10 coffees: 5 × 15 + 10 × 5 = 75 + 50 = $125. That is more than $120, so the bundle is outside the line and unaffordable.
- 6 tickets and 6 coffees: 6 × 15 + 6 × 5 = 90 + 30 = $120. That is on the line.
The budget constraint calculator repeats these steps for any income and prices.
The slope is an opportunity cost
The slope of -3 means each extra movie ticket costs Maya 3 coffees. That is the opportunity cost of a ticket measured in coffee: to buy one more ticket she must spend $15, and $15 is exactly what 3 coffees cost. Going the other direction, the opportunity cost of one coffee is 1 ÷ 3 of a movie ticket.
In general, the opportunity cost of one unit of X is Px ÷ Py units of Y, and the opportunity cost of one unit of Y is Py ÷ Px units of X. Because prices do not change as Maya moves along the line, the opportunity cost is the same at every point, which is why the budget line is straight. Compare that with a production possibilities curve, which is usually bowed outward because opportunity cost rises as an economy specializes. The budget constraint vs PPC comparison sets the two side by side, and the opportunity cost guide covers the concept from scratch.
The ratio Px ÷ Py is also called the relative price of X. It is the only thing that sets the slope. Doubling both prices leaves the ratio, and so the slope, unchanged.
How income changes shift the budget line
Income appears in both intercepts (I ÷ Px and I ÷ Py) but not in the slope (-Px ÷ Py). So a change in income moves both intercepts by the same proportion and leaves the slope alone: the line shifts parallel.
- Income rises from $120 to $150: X intercept = 150 ÷ 15 = 10, Y intercept = 150 ÷ 5 = 30, slope still -15 ÷ 5 = -3. The line shifts out.
- Income falls from $120 to $90: X intercept = 90 ÷ 15 = 6, Y intercept = 90 ÷ 5 = 18, slope still -3. The line shifts in.
Check the new lines with a bundle: at $150, 4 tickets and 18 coffees cost 60 + 90 = $150, on the new line. At $90, 4 tickets and 6 coffees cost 60 + 30 = $90, on the new line.
How price changes rotate the budget line
A price change affects only one intercept, because each intercept divides income by just one price. The other intercept stays fixed and the line rotates (pivots) around it.
- Price of movies falls from $15 to $10: X intercept = 120 ÷ 10 = 12 (up from 8). Y intercept = 120 ÷ 5 = 24 (unchanged). Slope = -10 ÷ 5 = -2, flatter than before. The line pivots outward around the Y intercept.
- Price of coffee rises from $5 to $6: Y intercept = 120 ÷ 6 = 20 (down from 24). X intercept = 120 ÷ 15 = 8 (unchanged). Slope = -15 ÷ 6 = -2.5, flatter than -3. The line pivots inward around the X intercept.
Notice that a cheaper X and a pricier Y both flatten the line, because both lower the relative price of X. They differ in which intercept moves and whether the affordable set grows or shrinks. A price fall makes the consumer better off in real terms even though money income is unchanged, which is the starting point for the income and substitution effects.
Summary table: what each change does
| Change (starting from I = $120, Px = $15, Py = $5) | X intercept | Y intercept | Slope | Movement |
|---|---|---|---|---|
| Starting line | 8 | 24 | -3 | None |
| Income rises to $150 | 10 | 30 | -3 | Parallel shift out |
| Income falls to $90 | 6 | 18 | -3 | Parallel shift in |
| Px falls to $10 | 12 | 24 | -2 | Rotates out around the Y intercept |
| Py rises to $6 | 8 | 20 | -2.5 | Rotates in around the X intercept |
| Both prices double ($30 and $10) | 4 | 12 | -3 | Parallel shift in, same as income halving |
| Income and both prices double | 8 | 24 | -3 | No change |
Check the last two rows. With prices of $30 and $10 and income of $120, the intercepts are 120 ÷ 30 = 4 and 120 ÷ 10 = 12, and the slope is -30 ÷ 10 = -3. Halving income to $60 at the original prices gives 60 ÷ 15 = 4 and 60 ÷ 5 = 12, the same line. If income also doubles to $240, the intercepts are 240 ÷ 30 = 8 and 240 ÷ 10 = 24, exactly the starting line. Only real income and relative prices matter; scaling every dollar figure by the same factor changes nothing.
You can run the same kinds of shock, an income change, a single price change and all prices doubling, by dragging the income and price sliders in the budget constraint sandbox.
A budget line: every combination of two goods a consumer can afford. Tap it to drag the curves, open the full version, or put it on your own site free, or turn it into a five-minute class activity.
From the budget line to the best bundle
The budget line tells you what Maya can afford, not what she will choose. To pick one point on the line you need her preferences, which economists draw as indifference curves. Her best bundle is on the highest indifference curve that touches the budget line, where the marginal rate of substitution equals the price ratio. With Px ÷ Py = 3, that means she ends up where she values one more ticket at exactly 3 coffees. The full method, with a solved optimum, is in indifference curves explained, and the MRS calculator handles the arithmetic. The consumer choice module puts both pieces together with practice questions.
Common mistakes
- Writing the slope as -Py ÷ Px. With X on the horizontal axis the slope is -Px ÷ Py. Check with the intercepts: rise ÷ run = -(I ÷ Py) ÷ (I ÷ Px) = -Px ÷ Py.
- Rotating the line for an income change. Income changes shift the line parallel. Only a change in relative prices changes the slope.
- Moving the wrong intercept after a price change. A change in Px moves only the X intercept. The Y intercept depends on I and Py alone.
- Calling a flatter line "cheaper overall." A rise in Py also flattens the line, yet it shrinks what the consumer can buy.
- Placing the optimum inside the line. If more is always better, leftover money could buy more of something, so the chosen bundle sits on the line.
Frequently asked questions
What is the budget constraint equation?
The budget constraint is Px × X + Py × Y = I, where Px and Py are the prices of the two goods and I is income. Every bundle that satisfies the equation spends the income exactly. Solved for Y, it becomes Y = I ÷ Py - (Px ÷ Py) × X.
How do you find the intercepts of a budget line?
Divide income by each price. The X intercept is I ÷ Px, the most X you can buy with nothing spent on Y, and the Y intercept is I ÷ Py. With $120, movie tickets at $15 and coffees at $5, the intercepts are 8 tickets and 24 coffees.
How do you know if a bundle is affordable on a budget constraint?
Multiply each quantity by its price and add. If the total is less than income, the bundle sits inside the line and is affordable with money left over. If it equals income it is on the line, and if it is more it is outside and unaffordable. With $120, 3 tickets at $15 and 10 coffees at $5 cost $95, so that bundle is inside the line.
What happens to the budget line when the price of one good changes?
The budget line rotates around the intercept of the good whose price did not change. If the price of X falls, the X intercept moves outward, the Y intercept stays put, and the line becomes flatter. If the price of X rises, the X intercept moves inward and the line becomes steeper.
How is the budget constraint related to opportunity cost?
The absolute value of the budget line's slope is the opportunity cost of one good measured in the other. One unit of X costs Px ÷ Py units of Y, because the money spent on it could have bought that much Y instead. Since prices are fixed along the line, the opportunity cost is constant, which is why the budget line is straight.
Use what you just learned
Turn this topic into a class activity
Build a short prediction activity with one student link, or browse the free interactive graphs you can place in a class site or LMS.
Get new study guides in your inbox
Occasional emails with new posts, study tips, and exam-season reminders. Free, no spam.
No spam. Unsubscribe anytime. Read our privacy policy.
Teaching this topic? Every interactive graph on this site can be assigned as a graded activity with scores in your gradebook, and the classroom tools are free to pilot. No student accounts are needed for the graphs themselves.