SECTION 1
Where Did y = mx + b Come From?
People have been drawing straight lines for thousands of years. But writing a linear equation (an equation whose graph is a straight line) took centuries of math discoveries. Let's look at how we got the handy formula y = mx + b.
~300 BCE • Euclid & Geometry
~825 CE • Al-Khwarizmi & Algebra
1637 • Descartes & the Coordinate Plane
1800s • Slope-Intercept Form Becomes Standard
Today, y = mx + b is everywhere. Scientists use it to predict weather trends. Business owners use it to forecast profits. You'll use it whenever you need to describe how two quantities are connected in a straight-line pattern. The big question this lesson answers is: How do I write that equation from a graph, a table, or a word problem?
SECTION 2
Core Ideas You Need to Know
Before we start writing equations, let's nail down four key vocabulary words. Each one is a building block for y = mx + b.
Linear Equation
Slope (m)
Y-Intercept (b)
Slope-Intercept Form
KEY TAKEAWAY
SECTION 3
Seeing y = mx + b on a Graph
A graph is the easiest place to spot slope and y-intercept. The diagram below shows the line y = 2x + 1. Notice how the line crosses the y-axis at 1 (that's b). Then for every 1 unit you move right, the line goes up 2 units (that's m).
To write the equation from a graph, you only need two pieces of information. First, find where the line crosses the y-axis — that's your b. Second, pick two points on the line and count the rise and run between them — that gives you m. Plug both values into y = mx + b, and you're done!
SECTION 4
The Math Behind the Equation
Let's break down the formula piece by piece. Once you understand what each letter means, writing the equation becomes as simple as filling in blanks.
SLOPE-INTERCEPT FORM
y = the output (dependent variable) · m = slope (rise ÷ run) · x = the input (independent variable) · b = y-intercept (the value of y when x = 0)
SLOPE FORMULA
Pick any two points on the line: (x₁, y₁) and (x₂, y₂). Subtract the y-values (that's the rise), then subtract the x-values (that's the run). Divide rise by run to get the slope.
Positive vs. Negative Slope
FINDING b FROM A POINT
If you already know the slope (m) and one point (x, y) on the line, plug them in to solve for b.
SECTION 5
Writing Equations from Three Sources
You might be asked to write a linear equation from a graph, a table, or a real-world context. The steps are slightly different for each. The diagram below shows all three side by side.
| Source | How to find m (slope) | How to find b (y-intercept) |
|---|---|---|
| Graph | Count rise ÷ run between two points on the line | Read the y-value where the line crosses the y-axis |
| Table | Pick two rows: (y₂ − y₁) ÷ (x₂ − x₁) | Find the y-value when x = 0, or use b = y − mx |
| Context | Look for "per," "each," or "every" — that's the rate | Look for "starts with," "initial," or "already has" |
Quick-reference: finding m and b from different sources
SECTION 6
Worked Examples
Example 1: From a Table
| x | y |
|---|---|
| 0 | 5 |
| 1 | 8 |
| 2 | 11 |
| 3 | 14 |
Data table for Example 1
Write the equation in y = mx + b form
- 1
Step 1 — Find b (the y-intercept)
Look for the row where x = 0. When x = 0, y = 5. So b = 5.b = 5 - 2
Step 2 — Find m (the slope)
Pick two rows. Let's use (0, 5) and (1, 8). The rise is 8 − 5 = 3. The run is 1 − 0 = 1. So m = 3 ÷ 1 = 3. You can check: every time x goes up by 1, y goes up by 3. ✓m = 3 - 3
Step 3 — Write the equation
Plug m = 3 and b = 5 into y = mx + b.y = 3x + 5
Example 2: From a Word Problem
A pizza shop charges $12 for a plain pizza plus $2 for each topping. Write an equation for the total cost (y) based on the number of toppings (x).
Write the equation in y = mx + b form
- 1
Step 1 — Identify the starting value (b)
The plain pizza costs $12. That's the cost before any toppings, so b = 12.b = 12 - 2
Step 2 — Identify the rate of change (m)
Each topping adds $2. The word "each" tells you this is the rate. So m = 2.m = 2 - 3
Step 3 — Write the equation
Plug m = 2 and b = 12 into y = mx + b.y = 2x + 12 - 4
Step 4 — Check with a value
If you order 3 toppings: y = 2(3) + 12 = 6 + 12 = 18. A pizza with 3 toppings costs $18. That makes sense!Check: $18 ✓
SECTION 7
Common Mistakes & How to Avoid Them
Even great math students slip up when writing linear equations. Here are the most common mistakes and how to dodge them.
| Mistake | Why It Happens | How to Fix It |
|---|---|---|
| Swapping m and b | Students put the y-intercept where the slope should go, or vice versa. | Remember: m is always multiplied by x. b stands alone. |
| Forgetting the negative sign on slope | A line going downhill has a negative slope, but students write it as positive. | If the line goes down from left to right, the slope MUST be negative. |
| Flipping rise and run | Computing run ÷ rise instead of rise ÷ run. | Rise is the vertical (up/down) change. Run is the horizontal (left/right) change. Rise comes first. |
| Using the wrong point for b | Picking any point on the line instead of the one where x = 0. | The y-intercept is ONLY where the line crosses the y-axis (x = 0). |
Common mistakes when writing y = mx + b
QUICK MEMORY TRICK
SECTION 8
Connection to Future Math
Learning y = mx + b is your first step into a huge area of math. In later courses, you'll see more powerful versions of this idea. Here's a sneak peek.
| What You Know Now | What's Coming Next |
|---|---|
| y = mx + b (slope-intercept form) | Standard form (Ax + By = C) and point-slope form y − y₁ = m(x − x₁) |
| One equation, one line | Systems of equations — two lines at once, finding where they cross |
| Straight lines only | Quadratic equations (y = ax² + bx + c) make curves called parabolas |
| Finding slope from two points | In calculus, slope becomes "derivatives" — instant rates of change |
How y = mx + b connects to future topics
The great news? Every one of those future topics builds on the same two ideas you've learned here: slope and y-intercept. Master them now, and you'll have a huge head start.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Lesson Summary
Summary
A linear equation in slope-intercept form is written as y = mx + b, where m is the slope (rise over run — how steep the line is) and b is the y-intercept (where the line crosses the y-axis, or the starting value). You can find m and b from a graph by reading the y-intercept and counting rise ÷ run, from a table by calculating the change in y over the change in x, or from a real-world context by identifying the rate and starting amount.
Remember: m stands for "move" (how fast the line moves) and b stands for "beginning" (where the line begins on the y-axis). Always check your equation by plugging in a known point. Mastering y = mx + b prepares you for systems of equations, standard form, and eventually quadratic equations in Algebra and beyond.