Formula

Slope-intercept form

Also written: y = mx + b · y equals mx plus b · slope intercept equation

y=mx+by = mx + b

Slope-intercept form writes a line so its slope and its y-intercept can be read straight off the equation.

What each part means

mm
the slope — how much y changes per step of 1 in x
bb
the y-intercept — the y-value where the line crosses the y-axis

Slope-intercept form calculator

Describe a line by a slope and a point, by two points, or by its equation, and see it written as y=mx+by = mx + b with the slope and the y-intercept read off and the graph drawn. Choose how the line is given and fill in the boxes that choice uses. Whole numbers, decimals and fractions all work.

The steps below write the line with slope −2 through (0, 7) in slope-intercept form, y=mx+by = mx + b. Turn on JavaScript to try your own line.

Worked example: m=−2, through (0,7)

y = −2x + 7. The slope is −2 and the y-intercept is 7.

Graph of y = −2x + 7 A straight line that falls from left to right with slope −2. It crosses the y-axis at (0, 7) and the x-axis at (7/2, 0). Marked points: (0, 7) and (1, 5). −4−2246−22468xy (0, 7) (1, 5) (7/2, 0)
  • y = −2x + 7
Graph of y = −2x + 7

Identify the slope and the point

Keep each sign with its number.

m=−2x1=0y1=7

Read m and b

The point (0,7) is on the y-axis, so b=7.

m=−2b=7

Write the equation

Put m and b into y=mx+b.

y=−2x+7

Graph it in two moves

Plot the y-intercept (0,7).

The slope −2 is −2/1: go down 2 and across 1. That lands on (1,5).

Draw the line through the two points.

Check

Put the point back into the equation.

At x=0:

y=−2(0)+7=0+7=7

The same line in other forms

Point-slope form, through (0,7):

y−7=−2x

Standard form, with whole-number coefficients and A not negative:

2x+y=7

Intercepts and graph

Set y=0 to find where the line crosses the x-axis.

2x=7x=72

Set x=0 to find where it crosses the y-axis.

y=7

The line crosses the x-axis at (72,0) and the y-axis at (0,7).

A straight line that falls from left to right with slope −2. It crosses the y-axis at (0, 7) and the x-axis at (7/2, 0). Marked points: (0, 7) and (1, 5).

Runs on your device: nothing you type is sent or saved. Want the reasoning behind each step? Read the slope-intercept form lesson, or see how to graph a linear equation.

When to use it

You want to graph a line quickly, or compare two lines, or read a rate and a starting value out of a real-world equation.

Why this form is the useful one

Every other arrangement hides the two facts you most often want. Here they are both visible without any work:

y=3x−4⇒m=3, b=−4y = 3x - 4 \quad\Rightarrow\quad m = 3,\ b = -4

To graph it, plot (0,b)(0, b), then step across 11 and up mm, and repeat. Two points fix a line.

Why b is the y-intercept

The yy-axis is the set of points where x=0x = 0. Substituting:

y=m(0)+b=by = m(0) + b = b

So the line passes through (0,b)(0, b), whatever mm is. The intercept is not a separate fact bolted on — it is what the equation says at x=0x = 0.

In a real situation

C=15h+40C = 15h + 40

The 1515 is a rate: dollars per hour. The 4040 is a fixed starting amount charged before any hours are worked. Slope is the per-unit cost and the intercept is the flat fee, in almost every problem of this shape.

Worked examples

Write the line with slope −2-2 through (0,7)(0, 7).

The point is on the yy-axis, so b=7b = 7:

y=−2x+7y = -2x + 7

Put 6x+2y=106x + 2y = 10 into slope-intercept form.

2y=−6x+10⇒y=−3x+52y = -6x + 10 \quad\Rightarrow\quad y = -3x + 5

Slope −3-3, intercept 55. Converting from standard form means solving for yy.

The line it cannot write

A vertical line has undefined slope, so no value of mm describes it. Vertical lines are written x=kx = k instead.

Lessons that teach this

Related