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.
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?
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
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!
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.
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" |
Worked Examples
Example 1: From a Table
| x | y |
|---|---|
| 0 | 5 |
| 1 | 8 |
| 2 | 11 |
| 3 | 14 |
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).
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). |
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 |
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.
Practice Problems
Lesson 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.