Quick answer: Slope-intercept form is y = mx + b, where m is the slope (vertical change divided by horizontal change) and b is the y-intercept, the y-value when x = 0. This middle-school algebra lesson explains how to write equations, find slope from two points, and check your answer.
Learning objectives
After this lesson, students should be able to explain slope, distinguish a slope from a y-intercept, graph a line using two points, and convert an equation such as 2x + y = 7 into slope-intercept form. These skills align with Grade 8 work on linear equations and proportional relationships in the Common Core State Standards (8.EE). Individual school curricula may differ.
What do m and b mean in y = mx + b?
The letter m measures a line’s rate of change: for each one-unit increase in x, y changes by m units. The letter b is the point where the line crosses the vertical (y) axis, written as (0, b). For y = 3x + 2, the slope is 3 and the y-intercept is 2. Example points on this line are (0, 2), (1, 5), and (2, 8). Substituting x = 2 gives y = 3(2) + 2 = 8.
How to find slope from two points
Use m = (y₂ − y₁) / (x₂ − x₁) when x₂ is different from x₁. For the points (2, 5) and (6, 13), the change in y is 13 − 5 = 8 and the change in x is 6 − 2 = 4, so m = 8/4 = 2. The slope is positive, meaning the line rises as you move to the right. A zero slope describes a horizontal line. If both x-values are the same, the line is vertical and its slope is undefined.
Worked example: write a line equation from two points
Question: Write the equation for a line through (1, 4) and (3, 10).
- Calculate slope: m = (10 − 4)/(3 − 1) = 6/2 = 3.
- Substitute m = 3 and the point (1, 4) into y = mx + b: 4 = 3(1) + b.
- Solve for the intercept: b = 1.
- Answer: y = 3x + 1. Check with (3, 10): 3(3) + 1 = 10.
How to rewrite an equation in slope-intercept form
Start with 2x + y = 7. Subtract 2x from both sides to isolate y: y = −2x + 7. Therefore, m = −2 and b = 7. The line decreases by 2 vertical units for each 1 horizontal unit to the right.
For an equation with fractions, first isolate y. For example, 3y = 6x − 9 becomes y = 2x − 3 by dividing every term by 3. Remember: y = mx + b cannot represent vertical lines such as x = 4, because the slope would be undefined.
Real-world application: compare two prices
A bike rental shop charges a $5 starting fee plus $4 per hour. Let x represent hours and y represent the total cost in dollars: y = 4x + 5. The slope 4 is the hourly rate, and the intercept 5 is the initial fee. At three hours the total is 4(3) + 5 = $17. This linear model is valid only under the stated pricing assumptions.
Common mistakes to avoid
- Mixing up slope and intercept: the slope describes change, while the intercept describes a starting value at x = 0.
- Subtracting point coordinates in mismatched orders: keep y₂ − y₁ over x₂ − x₁.
- Assuming every line has a slope-intercept equation: vertical lines do not.
- Forgetting to verify the finished equation with an original point.
Try it yourself: five practice questions
- What are m and b in y = −4x + 6?
- Find the slope through (−1, 2) and (3, 10).
- Write a line with slope 2 and y-intercept −5.
- Rewrite y + 3x = 9 in slope-intercept form.
- Write the equation through (0, −2) and (2, 4).
Answer key
- m = −4; b = 6.
- (10 − 2)/(3 − (−1)) = 8/4 = 2.
- y = 2x − 5.
- y = −3x + 9.
- Slope = (4 − (−2))/(2 − 0) = 3; y = 3x − 2.
Related learning
Explore Space & Astronomy lessons to apply measurement and graphical thinking to science, or more mathematics and algebra lessons.
Official education sources
- Common Core State Standards: Grade 8 Expressions & Equations
- California Department of Education: Mathematics Standards
Educational example created for practice; not an official examination or a substitute for an assigned school curriculum.
Sık Sorulan Sorular
What does m stand for in y = mx + b?
m is the slope, the vertical change for each one-unit horizontal increase.
How do I find the y-intercept?
Set x = 0 and calculate y, or identify b after solving the equation for y.
