Math Core

Lesson 5.2 · Linear Functions

Slope-intercept form

A line is completely determined by two facts: how steep it is and where it crosses the yy-axis. Slope-intercept form puts both facts right in the equation, so you can read a line's graph straight off its formula, and write a formula straight off its graph.

Where the form comes from

Think about a gym that charges a $20 sign-up fee plus $15 per month. After xx months you've paid

y=15x+20.y = 15x + 20.

The two numbers each have a job:

  • 1515 is the rate of change: each extra month adds $15. On the graph, that's the slope.
  • 2020 is the starting value: at x=0x = 0 months, you've paid $20. On the graph, that's where the line crosses the yy-axis.

Every non-vertical line has an equation of this shape.

Definition

Slope-intercept form

The slope-intercept form of a line is

y=mx+b,y = mx + b,

where mm is the slope and bb is the yy-intercept. The line crosses the yy-axis at the point (0,b)(0, b).

Why is bb the yy-intercept? Every point on the yy-axis has x=0x = 0. Substituting x=0x = 0 gives y=m(0)+b=by = m(0) + b = b.

Since a linear function is just a line written with function notation, you'll also see f(x)=mx+bf(x) = mx + b. It means exactly the same thing.

Reading mm and bb

To read the slope and intercept, the equation must be in the exact shape y=mx+by = mx + b, with yy alone on one side. Take each sign with its number.

equationslope mmyy-intercept bb
y=4x−7y = 4x - 744−7-7
y=−x+2y = -x + 2−1-122
y=23xy = \dfrac{2}{3}x23\dfrac{2}{3}00
y=5y = 50055
y=6−3xy = 6 - 3x−3-366

The last row is a trap: the terms are in a different order, but the slope is still the coefficient of xx, which is −3-3.

Common mistake

In y=4x−7y = 4x - 7 the yy-intercept is −7-7, not 77. The form is y=mx+by = mx + b, so subtracting 77 means b=−7b = -7. The line crosses the yy-axis below the origin.

Graphing from the equation

Slope-intercept form gives you a two-step recipe for graphing.

Graphing y = mx + b

  1. Plot the yy-intercept (0,b)(0, b).
  2. From that point, use the slope riserun\dfrac{\text{rise}}{\text{run}} to find a second point. Then draw the line through both.

Worked example: Graphing with a fractional slope

Graph y=−23x+4y = -\dfrac{2}{3}x + 4.

The yy-intercept is 44, so plot (0,4)(0, 4). The slope is −23-\dfrac{2}{3}: from (0,4)(0, 4) go down 22 and right 33 to reach (3,2)(3, 2). Repeat to reach (6,0)(6, 0). Draw the line.

Start at the y-intercept (0, 4), then go down 2 and right 3, again and again.Open in grapher →

Check a point: at x=3x = 3, y=−23(3)+4=−2+4=2y = -\dfrac{2}{3}(3) + 4 = -2 + 4 = 2, which matches.

A negative slope can be thought of as −23\dfrac{-2}{3} (down 22, right 33) or 2−3\dfrac{2}{-3} (up 22, left 33). Both land on the same line.

Writing the equation of a line

To write y=mx+by = mx + b, you need two numbers: mm and bb. How you find them depends on what you're given.

Worked example: From a graph

Write the equation of the line.

y = 3x/2 - 2(0, -2)(2, 1)Open in grapher →

The line crosses the yy-axis at (0,−2)(0, -2), so b=−2b = -2. From (0,−2)(0, -2) to (2,1)(2, 1) the line rises 33 and runs 22, so m=32m = \dfrac{3}{2}.

y=32x−2.y = \frac{3}{2}x - 2.

When the yy-intercept isn't given, find the slope first, then substitute one point to solve for bb.

Worked example: From two points

Write the equation of the line through (2,1)(2, 1) and (6,9)(6, 9).

Slope. m=9−16−2=84=2m = \dfrac{9 - 1}{6 - 2} = \dfrac{8}{4} = 2, so the equation looks like y=2x+by = 2x + b.

Intercept. The point (2,1)(2, 1) is on the line, so it must make the equation true:

1=2(2)+b1=4+b−3=b\begin{aligned} 1 &= 2(2) + b \\ 1 &= 4 + b \\ -3 &= b \end{aligned}

The equation is y=2x−3y = 2x - 3. Check the other point: 2(6)−3=92(6) - 3 = 9, as it should.

Tip

Always test your equation with a point you didn't use to find bb. If it satisfies the equation, you almost certainly have the right line.

Rewriting into slope-intercept form

Sometimes an equation arrives in a different shape, like 3x+2y=103x + 2y = 10. Solve for yy (you practiced this with literal equations):

3x+2y=102y=−3x+10subtract 3xy=−32x+5divide every term by 2\begin{aligned} 3x + 2y &= 10 \\ 2y &= -3x + 10 && \text{subtract } 3x \\ y &= -\frac{3}{2}x + 5 && \text{divide every term by } 2 \end{aligned}

Now you can read it: slope −32-\dfrac{3}{2}, yy-intercept 55.

Worked example: A model

A candle is 3030 cm tall and burns down 2.52.5 cm per hour. Write an equation for its height yy after xx hours. When does it burn out?

The starting value is 3030 and the rate is −2.5-2.5 (the height goes down), so y=−2.5x+30y = -2.5x + 30.

It burns out when y=0y = 0: 0=−2.5x+300 = -2.5x + 30, so 2.5x=302.5x = 30 and x=12x = 12 hours.

Practice

Practice 1

What is the slope of the line y=−4x+7y = -4x + 7?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

What is the yy-intercept of the line y=5−3xy = 5 - 3x?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Write the equation of the line with slope 33 and yy-intercept −2-2. Enter it in the form y=mx+by = mx + b.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 4

Write the equation of the line shown, in the form y=mx+by = mx + b.

y = -2x + 3(0, 3)(2, -1)Open in grapher →

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 5

Which is 3x+2y=103x + 2y = 10 written in slope-intercept form?

Practice 6

A line has slope 12\dfrac{1}{2} and passes through (4,10)(4, 10). Write its equation in the form y=mx+by = mx + b.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 7

Write the equation of the line through (−1,4)(-1, 4) and (3,−4)(3, -4), in the form y=mx+by = mx + b.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 8

A plumber charges a $60 visit fee plus $45 per hour. Write an equation for the cost yy of a job lasting xx hours. How much, in dollars, does a 3.53.5-hour job cost?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.