Sub topic 2
The y-intercept: where the line crosses the y-axis
This chapter assumes you can plot points on the coordinate plane, substitute values into simple expressions, and solve one-step and two-step linear equations.
What the y-intercept is
The y-intercept is the y-value where a line crosses the y-axis. At that point, x = 0, so the crossing point is (0, b). The number b is the y-intercept.
To find it from a graph, find where the line meets the vertical axis. To find it from an equation, substitute x = 0 and solve for y.
Slope-intercept form: y = mx + b
The slope-intercept form of a linear equation is y = mx + b. In this form, m is the slope (rise over run) and b is the y-intercept.
In y = 2x + 1, the slope is 2 and the y-intercept is 1. Substituting x = 0 gives y = 1, so the line crosses the y-axis at (0, 1).
The following code evaluates this line for several x-values:
def y_from_line(m, b, x):
return m * x + b
m, b = 2, 1
for x in range(-2, 3):
print(f"x = {x:>2} y = {y_from_line(m, b, x):>2}")Graphing a line from its equation
- Plot the y-intercept (0, b).
- Write the slope as a fraction. For m = 2, use 2/1.
- From the intercept, move up by the rise and right by the run to find a second point.
- Draw a straight line through both points.
For a negative slope such as m = -3/4, move down 3 and right 4.
Exercise
What are the slope and y-intercept of y = -3x + 5, and where does the line cross the y-axis?
Show answer
The slope is -3, the y-intercept is 5, and the line crosses the y-axis at (0, 5).