SECTION 1
Where Did Straight-Line Equations Come From?
People have been drawing straight lines for thousands of years — think of a ruler on a piece of papyrus. But writing an equation that describes a line? That took some brilliant thinking over many centuries. Let's look at how this idea developed.
~300 BC • Euclid
~800 AD • Al-Khwarizmi
1637 • René Descartes
1700s–1800s • Standard Form Emerges
So here's the big question this lesson answers: How can one short equation — y = mx + b — perfectly describe every straight line on a graph? And what makes this equation a function?
SECTION 2
Core Ideas You Need to Know
Before we dive into graphing, let's lock down four key ideas. Each one is a building block for understanding y = mx + b.
What Is a Function?
What Makes It "Linear"?
Slope (m)
Y-Intercept (b)
Key takeaway
SECTION 3
Seeing y = mx + b on a Graph
The best way to understand a linear equation is to see it. Below is a graph of the equation y = 2x + 1. Notice how the line is perfectly straight, crosses the y-axis at the point (0, 1), and climbs upward at a steady rate.
Look at the graph carefully. The gold dot at (0, 1) is the y-intercept — that's where the line meets the y-axis. The dashed triangle between (0, 1) and (1, 3) shows the slope: for every 1 step to the right, the line goes 2 steps up. That's a slope of 2. Every point on this line follows the rule y = 2x + 1.
This graph is also proof that the equation is a function. You can check this with the vertical line test: if you draw any vertical line anywhere on the graph, it will cross the line at most once. That means each x-value has only one y-value. One input → one output. That's a function!
SECTION 4
Breaking Down the Equation
Let's take the equation apart piece by piece. Once you understand what each letter means, you'll be able to read any linear equation like a story.
SLOPE-INTERCEPT FORM
y = output | m = slope | x = input | b = y-intercept
Here's what each part does:
y is the output — the answer you get after plugging in a value for x. On a graph, y tells you how high or low the point sits.
m is the slope. It's a number that tells you the line's steepness. Slope is calculated as "rise over run" — how much y changes divided by how much x changes.
SLOPE FORMULA
Pick any two points on the line and subtract their coordinates.
x is the input — the value you choose. You get to pick any x-value you want, and the equation will give you the matching y.
b is the y-intercept. It's the value of y when x = 0. On the graph, it's where the line crosses the vertical axis. Notice that if you substitute x = 0 into y = mx + b, you get y = m(0) + b = b. That's why b is the y-intercept!
Key takeaway
SECTION 5
How Slope and Intercept Change the Line
Different values of m and b create different lines. The diagram below shows three lines on the same graph so you can compare them side by side.
Let's compare these three lines using a table:
| EQUATION | SLOPE (m) | Y-INTERCEPT (b) | WHAT THE LINE DOES |
|---|---|---|---|
y = 2x + 1 | 2 (positive, steep) | 1 | Goes up steeply from left to right; crosses y-axis at 1 |
y = −x + 3 | −1 (negative) | 3 | Goes downhill from left to right; crosses y-axis at 3 |
y = 0.5x − 2 | 0.5 (positive, gentle) | −2 | Goes up gently; crosses y-axis below the origin at −2 |
Notice the patterns. When the slope is positive, the line goes upward as you move right. When the slope is negative, the line goes downward. A bigger absolute value of slope means a steeper line. And the y-intercept simply shifts the line up or down.
What about a slope of 0? If m = 0, the equation becomes y = b — a perfectly horizontal line! The y-value never changes no matter what x is. That's still a function (each x gives one y), and it's still linear (a horizontal line is straight).
SECTION 6
Worked Example: From Table to Equation to Graph
Let's walk through a full problem together. Suppose you earn $8 per hour at a part-time job, plus a $15 bonus for showing up on time. Write and graph a linear equation for your total pay.
From Table to Equation to Graph
- 1
Step 1 — Identify the Variables
Let x = the number of hours you work. Let y = your total pay in dollars. - 2
Step 2 — Find the Slope (m)
You earn $8 for each hour. That means for every 1-unit increase in x, y goes up by 8. The rate of change is constant.m = 8 - 3
Step 3 — Find the Y-Intercept (b)
When x = 0 (you haven't worked any hours yet), you still get the $15 bonus. So your starting pay is $15.b = 15 - 4
Step 4 — Write the Equation
Plug m and b into y = mx + b:y = 8x + 15 - 5
Step 5 — Build a Table of Values
Pick a few x-values, plug them in, and calculate y: When x = 0, y = 8(0) + 15 = $15. When x = 1, y = 8(1) + 15 = $23. When x = 2, y = 8(2) + 15 = $31. When x = 3, y = 8(3) + 15 = $39. When x = 5, y = 8(5) + 15 = $55. - 6
Step 6 — Graph and Interpret
Plot these points on a coordinate plane and connect them. You'll get a straight line that starts at (0, 15) and rises steadily. Every point on this line represents a possible hours-pay combination. The line is straight because the pay rate ($8/hour) never changes — and that's exactly what makes it linear.The equation y = 8x + 15 defines a linear function. Its graph is a straight line with a slope of 8 and a y-intercept of 15.
SECTION 7
Linear vs. Non-Linear: How to Tell the Difference
Not every equation is linear. It's important to recognize what makes y = mx + b special — and what kinds of equations do not produce straight lines.
| FEATURE | LINEAR FUNCTION | NON-LINEAR FUNCTION |
|---|---|---|
| Equation form | y = mx + b (x has exponent of 1) | y = x², y = 2ˣ, y = √x, etc. |
| Graph shape | Perfectly straight line | Curved (parabola, exponential curve, etc.) |
| Rate of change | Constant — same slope everywhere | Changes — steeper in some places, flatter in others |
| Table pattern | y values increase/decrease by the same amount | y values change by different amounts |
| Example | y = 3x − 4 | y = x² + 1 |
Here's a quick test: look at the equation. If x is raised to a power other than 1 (like x² or x³), or if x is in the denominator (like 1/x), or if x is an exponent (like 2ˣ), it's not linear. A linear function keeps x simple — just x times some number, plus another number.
Also remember: y = mx + b always defines a function. For every input x, you get exactly one output y. But not every function is linear. The equation y = x² is a function too, but its graph is a U-shaped curve called a parabola — not a straight line.
Key takeaway
SECTION 8
Where Does This Lead Next?
Understanding y = mx + b is one of the most important foundations in all of mathematics. Once you master it, you'll be ready for bigger ideas. Here's a sneak peek at where this goes.
| WHAT YOU KNOW NOW | WHAT COMES NEXT |
|---|---|
| Graphing one line | Systems of equations — graphing two lines and finding where they cross |
| Slope as rate of change | Calculus — finding the rate of change for curved lines (derivatives) |
| Linear functions (y = mx + b) | Quadratic functions (y = ax² + bx + c) — curves instead of lines |
| One input, one output | Function notation — writing f(x) = mx + b and evaluating f(3), f(−2), etc. |
| Reading slope from an equation | Linear modeling — using real-world data to find the best-fit line |
In high school, you'll study function notation, where y = 2x + 1 gets written as f(x) = 2x + 1. The idea is the same, but the notation lets you talk about different functions more easily. You'll also explore what happens when you combine, shift, or stretch linear functions — and then move on to functions that aren't straight lines at all. Every one of those future topics builds on what you're learning right now.
SECTION 9
Practice Problems
Try these five problems to test your understanding. Start with the easier ones and work your way up. Click "Show Answer" when you're ready to check your work.
Question 1: PROBLEM 1 — CONCEPTUAL
Show answer
Question 2: PROBLEM 2 — BASIC
y = −3x + 7, identify the slope and the y-intercept. Then find the value of y when x = 2.Show answer
y = −3(2) + 7 = −6 + 7 = 1. So when x = 2, y = 1. The point (2, 1) is on this line. The negative slope tells us this line goes downhill from left to right.Question 3: PROBLEM 3 — INTERMEDIATE
Show answer
m = (11 − 5) / (3 − 1) = 6 / 2 = 3. Now use one of the points to find b. Plug x = 1, y = 5, and m = 3 into y = mx + b: 5 = 3(1) + b → 5 = 3 + b → b = 2. The equation is y = 3x + 2. You can check: when x = 3, y = 3(3) + 2 = 11. ✓ Great job working through both parts!Question 4: PROBLEM 4 — APPLIED / MULTI-STEP
Show answer
Question 5: PROBLEM 5 — CHALLENGE / CRITICAL THINKING
Show answer
LESSON SUMMARY
Putting It All Together
Summary
The equation y = mx + b is called slope-intercept form, and it defines a linear function — a rule that takes any input x and produces exactly one output y. The letter m represents the slope, which tells you the rate of change — how much y increases or decreases for each 1-unit increase in x. The letter b represents the y-intercept, the point where the line crosses the y-axis (where x = 0). Together, m and b completely determine the line's position and direction.
The graph of any equation in the form y = mx + b is always a straight line. A positive slope means the line rises from left to right; a negative slope means it falls. A larger absolute value of slope means a steeper line. Because every x-value produces exactly one y-value, the equation passes the vertical line test and qualifies as a function. This single, powerful equation connects algebra and geometry, letting you describe, predict, and analyze straight-line relationships in math and the real world.