Sub topic 6
The y-intercept: where the line crosses the y-axis
This chapter assumes you can plot points on the coordinate plane, work with signed numbers and fractions, and solve one-step and two-step linear equations. It also assumes you know slope as rise over run, from earlier in this tutorial. Here you will learn what the y-intercept is, how to find it from a graph, a table, an equation, or two points, and how it connects to the slope-intercept form that the next chapter builds.
What the y-intercept is
The y-axis is the vertical line where x = 0. A line that is not vertical crosses the y-axis exactly once. The point where it crosses is the y-intercept.
Every point on the y-axis has an x-coordinate of 0, so the y-intercept always has the form (0, b). The number b is the y-value at that point. People often say "the y-intercept is b" and mean the number. They sometimes say "the y-intercept is (0, b)" and mean the point. Both are common, so read the context.
A few cases are worth knowing:
- If the line crosses the y-axis above the origin, b is positive.
- If it crosses below the origin, b is negative.
- If it passes through the origin (0, 0), then b = 0.
- A vertical line such as x = 4 never meets the y-axis, so it has no y-intercept. The exception is the line x = 0, which is the y-axis itself and has infinitely many points on it. Neither case has a slope-intercept form.
- A horizontal line y = c crosses the y-axis at (0, c), so its y-intercept is c.
Finding the y-intercept from a graph
Look at where the line meets the vertical axis and read the y-value. This works well when the crossing falls on a grid mark.
Two cautions apply:
- Check the scale of the y-axis. If each grid line stands for 5 units, a crossing at the second line is 10, not 2.
- If the crossing falls between grid marks, a graph gives only an estimate. To get an exact value, use the equation or two exact points on the line.
Finding the y-intercept from a table
If a table of values includes the row where x = 0, the y-value in that row is the y-intercept.
| x | y |
|---|---|
| 0 | 5 |
| 1 | 8 |
| 2 | 11 |
The y-intercept is 5. The y-values rise by 3 each time x rises by 1, so the slope is 3.
If the table does not include x = 0, work backward using the constant rate of change. Suppose a table shows (2, 11) and (3, 14). The slope is (14 − 11) / (3 − 2) = 3. Moving from x = 2 back to x = 0 is a change of −2 in x. The matching change in y is 3 × (−2) = −6. So y at x = 0 is 11 − 6 = 5.
This backward step is the idea behind every method below: the y-intercept is the starting value you reach by undoing the rate of change back to x = 0.
Finding the y-intercept from an equation
For an equation in any form, substitute x = 0 and solve for y.
Take 3x + 4y = 12. Setting x = 0 gives 4y = 12, so y = 3. The y-intercept is (0, 3).
Take y = −2x + 7. Setting x = 0 gives y = 7. The y-intercept is (0, 7).
When the equation is already written as y = mx + b, you do not need to compute anything. The constant term is b, because the term mx vanishes when x = 0.
def y_intercept_from_standard(A, B, C):
"""Return the y-intercept of Ax + By = C as a number, or None if B == 0."""
if B == 0:
return None # vertical line: no y-intercept (or the whole y-axis if C == 0)
return C / B
print(y_intercept_from_standard(3, 4, 12)) # 3.0
print(y_intercept_from_standard(2, -5, 10)) # -2.0
print(y_intercept_from_standard(1, 0, 4)) # NoneThe function returns C / B because setting x = 0 in Ax + By = C leaves By = C. This matches the standard-form conversion code from the topic plan, which returns C/B as the intercept.
Finding the y-intercept from slope and a point
Sometimes you know the slope m and one point (x1, y1), but that point is not on the y-axis. Start at the point and move to x = 0. The change in x is 0 − x1 = −x1, so the change in y is m × (−x1). Then:
b = y1 − m × x1
This is the same formula used in the code example for the line through two points. You can check it by substituting: if y = mx + b passes through (x1, y1), then y1 = m × x1 + b, and solving for b gives the formula.
Worked example: a line has slope −3 and passes through (2, 1).
- Compute m × x1 = −3 × 2 = −6.
- Compute b = y1 − m × x1 = 1 − (−6) = 7.
- The y-intercept is (0, 7).
A check: starting at (2, 1) and moving left 2 units (to x = 0), a slope of −3 means y changes by −3 × (−2) = +6. Then 1 + 6 = 7. The two routes agree.
Finding the y-intercept from two points
First compute the slope, then use one of the points as in the previous section.
def y_intercept_from_points(x1, y1, x2, y2):
if x1 == x2:
raise ValueError("A vertical line has no single y-intercept")
m = (y2 - y1) / (x2 - x1)
b = y1 - m * x1
return b
print(y_intercept_from_points(1, 3, 3, 7)) # 1.0
print(y_intercept_from_points(-2, 4, 2, 0)) # 2.0For the points (1, 3) and (3, 7), the slope is (7 − 3) / (3 − 1) = 2 and b = 3 − 2 × 1 = 1. For (−2, 4) and (2, 0), the slope is (0 − 4) / (2 − (−2)) = −1 and b = 4 − (−1)(−2) = 4 − 2 = 2.
You get the same b whichever of the two points you use. If your two answers differ, one of the arithmetic steps is wrong. This makes a useful self-check.
How b shifts a line without changing its steepness
Two lines with the same slope and different y-intercepts are parallel. Changing b moves the whole line up or down by the amount of the change, and it leaves the slope alone.
Compare y = 2x, y = 2x + 3, and y = 2x − 4. At x = 1 their y-values are 2, 5, and −2. At every x, the second line is 3 above the first and the third is 4 below it. All three rise 2 for every 1 step right.
| Equation | Slope | y-intercept | Point at x = 1 |
|---|---|---|---|
| y = 2x | 2 | 0 | (1, 2) |
| y = 2x + 3 | 2 | 3 | (1, 5) |
| y = 2x − 4 | 2 | −4 | (1, −2) |
The y-intercept as a starting value
In a real situation, x often counts time or quantity, and x = 0 means "before anything has happened." The y-intercept is then the starting value.
Suppose a gym charges a $25 sign-up fee and $10 per month. The cost after x months is y = 10x + 25. The slope 10 is dollars per month. The intercept 25 is the cost at x = 0, the fee you pay before using any months.
Interpreting b takes some care:
- State it with units and in words: "the cost is $25 when no months have passed."
- Check that x = 0 makes sense in the situation. If x is the age of a child in years and y is height, then b is the height at birth, which is meaningful. If x is the year, such as 2024, then x = 0 means the year 0, and b is a mathematical artifact with no practical meaning.
- Treat b as unreliable if x = 0 lies far outside the data you actually have. Extending a line to x = 0 from data that spans x = 2020 to 2025 is a long extrapolation.
Common errors
- Swapping the coordinates. Writing the y-intercept as (b, 0). The point is (0, b). The point (a, 0) is an x-intercept, which is a different thing.
- Dropping the sign. In y = 5 − 2x, the y-intercept is +5. In y = 2x − 5, it is −5. Read the sign attached to the constant term.
- Reading b from an unsimplified equation. In y = 3(x + 2), the intercept is not 2. Setting x = 0 gives y = 3 × 2 = 6.
- Dividing wrongly in standard form. In 2x + 3y = 6, the intercept is C/B = 2, not C/A = 3. The value 3 is the x-intercept.
- Ignoring the vertical case. An attempt to divide by B = 0, or by x2 − x1 = 0, signals a vertical line, which has no y-intercept to find in this way.
Putting it together
The slope tells you how y changes as x increases. The y-intercept tells you where the line starts when x = 0. Together they pin down a non-vertical line exactly. You need both numbers, and the next chapter writes them into the single equation y = mx + b.
Exercise
A line has slope 1/2 and passes through (6, 5). Find its y-intercept, then state what y is when x = 0 and explain which formula you used.
Show answer
Use b = y1 − m × x1. Here m × x1 = (1/2) × 6 = 3, so b = 5 − 3 = 2. The y-intercept is (0, 2), so y = 2 when x = 0. Check: moving left 6 units from (6, 5) changes y by (1/2)(−6) = −3, and 5 − 3 = 2.
Exercise
Find the y-intercept of the line 5x − 2y = 8. Why is it not 8/5 or 8?
Show answer
Set x = 0, which gives −2y = 8, so y = −4. The y-intercept is (0, −4). The value 8/5 is the x-intercept, found by setting y = 0. The value 8 is just the constant C. Because B = −2 here, the intercept is C/B = 8 / (−2) = −4.
Exercise
A streaming service charges y = 8x + 12 dollars after x months, where 12 is a one-time setup fee. Interpret the slope and the y-intercept. Then explain why the intercept would be harder to interpret if x were the calendar year.
Show answer
The slope 8 means the cost rises $8 per month. The y-intercept 12 means the cost is $12 at x = 0, before any month has been used, which is the setup fee. If x were the calendar year, x = 0 would mean the year 0, far outside any real data, so b would be a mathematical artifact and not a meaningful starting value.