Find a course

Module 3: Linear Functions and GraphsLesson 8 of 1111 min

Slope-Intercept Form: y = mx + b

Use y = mx + b to graph lines, find the slope and intercept from an equation, write equations from two points, and spot parallel and perpendicular lines.

Step 1 of 12Learn

Starting point plus rate

Priya opens a savings account with $50 and adds $20 every week. After x weeks her balance y is:

y = 20x + 50

This is a line in slope-intercept form, y = mx + b:

  • m is the slope, the rate of change: $20 per week.
  • b is the y-intercept, the value of y when x = 0: the starting $50.

The form is popular because both numbers can be read straight from the equation without any work. In y = −3x + 4, the slope is −3 and the line crosses the y-axis at (0, 4). In y = x − 6, the slope is 1 (since x means 1x) and the intercept is −6. In y = 5x, there's no constant, so b = 0 and the line passes through the origin.

Real situations fit this pattern constantly: a taxi's pickup fee plus a per-mile rate, a candle's starting height minus the amount burned per hour, a gym's sign-up fee plus a monthly charge. Spot the starting amount (that's b) and the amount per unit (that's m), and you can write the equation directly.

Use the explorer below to see how each number changes the graph.

Step 2 of 12Explore

Slope-intercept explorer

Move m to change the steepness and direction. Move b to slide the line up and down. Notice that changing b never changes the steepness, and changing m always keeps the line through (0, b).

-10-50510 -10-50510
Crosses the y-axis at y =
1
Crosses the x-axis at x =
-0.5
y when x = 3
7

Step 3 of 12Practice · Choose one

What are the slope and y-intercept of y = −3x + 4?

Step 4 of 12Learn

Graphing a line from its equation

With y = mx + b you can graph a line in seconds, without a table of values.

Graph y = (2/3)x − 1.

  1. Plot the intercept. b = −1, so put a point at (0, −1).
  2. Use the slope as rise over run. m = 2/3 means rise 2, run 3. From (0, −1), go up 2 and right 3 to reach (3, 1).
  3. Repeat once more to land on (6, 3), which confirms the pattern.
  4. Draw the line through the points and extend it in both directions.

For a negative slope like m = −4, write it as −4/1: go down 4 and right 1. For a whole-number slope like 3, think 3/1.

If the equation isn't in slope-intercept form yet, solve for y first. For example, 2x + y = 7 becomes y = −2x + 7, so you'd start at (0, 7) and go down 2, right 1.

Another quick way to graph is to find both intercepts. Set x = 0 to find where the line crosses the y-axis, and set y = 0 to find the x-axis crossing. For 2x + y = 7, the intercepts are (0, 7) and (3.5, 0). Two points are all you need for a line.

Step 5 of 12Diagram

Graphing y = (2/3)x − 1 in four moves

Graphing y = (2/3)x − 1 in four movesProcess diagram: Plot (0, −1) → Up 2 → Right 3 → (3, 1) → Draw through both.Plot (0, −1)Up 2Right 3 → (3,1)Drawthrough both

Tap a shape with to see more.

Plot (0, −1)

Start at the y-intercept b.

Up 2

The top of the slope is the rise.

Right 3 → (3, 1)

The bottom of the slope is the run.

Draw through both

Repeat rise/run once more to check: (6, 3) should also be on the line.

Step 6 of 12Learn

Writing the equation of a line

Often you know two points and need the equation. Two steps:

Step 1: find the slope. Through (2, 5) and (6, 13): m = (13 − 5)/(6 − 2) = 8/4 = 2.

Step 2: find b. Substitute the slope and either point into y = mx + b. Using (2, 5):

5 = 2(2) + b, so 5 = 4 + b, and b = 1.

The equation is y = 2x + 1. Check the other point: 2(6) + 1 = 13. It works.

Point-slope form is a shortcut that skips solving for b at the start:

y − y1 = m(x − x1)

With m = 2 and the point (2, 5): y − 5 = 2(x − 2). Distribute and add 5 to get y = 2x + 1, the same line.

From a story. A candle is 30 cm tall and burns 2.5 cm per hour. Starting height is b = 30; it shrinks, so m = −2.5. Height after x hours: y = −2.5x + 30. It burns out when y = 0: 2.5x = 30, so x = 12 hours.

A common error: finding m correctly, then using the y-value of a point as b. The intercept is the y-value only where x = 0; for the point (2, 5), b is not 5.

Step 7 of 12Practice · Work it out

A line passes through (1, 4) and (3, 10). What is its y-intercept b?

Step 8 of 12Learn

Other forms, parallel and perpendicular

Lines are also written in standard form, Ax + By = C, such as 3x + 2y = 12. To find the slope, solve for y: 2y = −3x + 12, so y = −1.5x + 6. Slope −1.5, intercept 6. Standard form is handy for finding intercepts: with x = 0, y = 6; with y = 0, x = 4.

Two special relationships between lines depend only on slopes:

  • Parallel lines never meet, so they rise at the same rate: equal slopes and different intercepts. y = 2x + 1 and y = 2x − 7 are parallel.
  • Perpendicular lines meet at a right angle. Their slopes are negative reciprocals: flip the fraction and change the sign. A line with slope 2/3 is perpendicular to one with slope −3/2. The product of perpendicular slopes is always −1.

Horizontal and vertical lines are the exception to the reciprocal rule: y = 3 (slope 0) and x = 5 (undefined) are perpendicular.

Example. Write the line through (4, 1) perpendicular to y = 2x − 3. The perpendicular slope is −1/2. Then 1 = −1/2 (4) + b gives 1 = −2 + b, so b = 3: y = −(1/2)x + 3.

Step 9 of 12Practice · Fill in the blanks

Fill in the blanks

A line parallel to y = 4x − 7 has slope . A line perpendicular to it has slope .

Step 10 of 12Compare

Parallel versus perpendicular lines

AspectParallelPerpendicular
SlopesEqualNegative reciprocals
Example for y = 2x + 1y = 2x − 5y = −(1/2)x + 3
Product of slopesm × m−1 (for example 2 × −1/2)
Do they meet?Never (unless the same line)Once, at a right angle

Step 11 of 12Practice · Match the pairs

Match each equation to its description.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. y = −2x + 5
  2. y = 5x − 2
  3. y = 5
  4. x = 5
  5. y = (1/2)x

Step 12 of 12Practice · What would you do?

What would you do?

A ride-share company charges according to y = 1.75x + 4, where x is miles and y is the fare in dollars. Which interpretation is correct?