Slope-intercept form: write an equation

A line can be written in the slope-intercept form:

y = mx + b

where:

  • m = slope of the line (steepness)
  • b = y-intercept (the point where the line crosses the y-axis)

The slope between two points (x1,y1)​ and (x2,y2) is:

m=y2−y1/x2−x1


If you know mmm and bbb, simply substitute into:

y=mx+b

Example:
Slope m=3, y-intercept b=−2

y=3x−2


If you know mmm and a point (x1,y1), use the point-slope form first: y−y1=m(x−x1)

Then, rearrange into y=mx+b.

Example:
Slope m=−4point (2, 5)

y−5=−4(x−2)

y−5=−4x+8

y=−4x+13


1.Find the slope mmm using:

m=y2−y1/x2−x1

2.Use one of the points and point-slope form to find b.

3.Write the final equation in slope-intercept form.

Example:
Points (1, 2) and (3, 6)
Step 1:

m=6−2/3−1=4/2=2

Step 2: Using (1, 2):

y−2=2(x−1)

y = 2x + 0

Final:

y=2xy


  • Horizontal line: slope m=0 → equation is y=b
  • Vertical line: slope is undefined → cannot be written in y=mx+b

1. Write the equation of a line with slope 5 and y-intercept -3.

2. Write the equation of a line with slope -2 passing through (4, 7).

3. Find the equation of the line passing through (0, -2) and (5, 3).

4. A line has slope 34\frac{3}{4}43​ and passes through (2, -1). Write its equation.

Plug the slope m = 8 and the y-intercept b = 16 into the slope-intercept formula.
y = mx + b

y = 8x + 16

y = 8x − 16

The equation of the line in slope-intercept form is y = 8x − 16.

Plug the slope m = 1 and the y-intercept b = 19 into the slope-intercept formula.
y = mx + b

y = 1x + 19

y = x + 19

The equation of the line in slope-intercept form is y = x + 19.

Plug the slope m = 1 and the y-intercept b = 20 into the slope-intercept formula.

y = mx + b

y = 1x + 20

y = x + 20

y = x − 20

The equation of the line in slope-intercept form is y = x − 20.

Let’s Practice!