If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Writing slope-intercept equations

Learn how to find the slope-intercept equation of a line from two points on that line.
If you haven't read it yet, you might want to start with our introduction to slope-intercept form.

Writing equations from y-intercept and another point

A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points zero, three and two, seven, which are plotted and labeled.
Let's write the equation of the line that passes through the points (0,3) and (2,7) in slope-intercept form.
Recall that in the general slope-intercept equation y=mx+b, the slope is given by m and the y-intercept is given by b.

Finding b

The y-intercept of the line is (0,3), so we know that b=3.

Finding m

Recall that the slope of a line is the ratio of the change in y over the change in x between any two points on the line:
Slope=Change in yChange in x
Therefore, this is the slope between the points (0,3) and (2,7):
m=Change in yChange in x=7320=42=2
In conclusion, the equation of the line is y=2x+3.

Check your understanding

Problem 1
A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points zero, five and four, nine, which are plotted and labeled.
Write the equation of the line.

Problem 2
A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points zero, eight and three, two which are plotted and labeled.
Write the equation of the line.

Writing equations from any two points

A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points two, five and four, nine, which are plotted and labeled.
Let's write the equation of the line that passes through (2,5) and (4,9) in slope-intercept form.
Note that we are not given the y-intercept of the line. This makes things a little bit more difficult, but we are not afraid of a challenge!

Finding m

m=Change in yChange in x=9542=42=2

Finding b

We know that the line is of the form y=2x+b, but we still need to find b. To do that, we substitute the point (2,5) into the equation.
Because any point on a line must satisfy that line’s equation, we get an equation that we can solve to find b.
y=2x+b5=22+bx=2 and y=55=4+b1=b
In conclusion, the equation of the line is y=2x+1.

Check your understanding

Problem 3
A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points one, four and three, ten, which are plotted and labeled.
Write the equation of the line.

Problem 4
A first quadrant coordinate plane. The x- and y-axes each scale by one. A graph of a line goes through the points two, nine and four, one, which are plotted and labeled.
Write the equation of the line.

Challenge problem
A line passes through the points (5,35) and (9,55).
Write the equation of the line.

Want to join the conversation?