MathIsimple
Grades 7–8
linear equations
9 min read

Slope and Linear Equations: How to Find Slope and Write y = mx + b

A 7th-and-8th-grade guide to slope: the rise-over-run definition, the slope formula between two points, slope-intercept form y = mx + b, and how to read slope from a graph.

What is slope?

Slope measures how steep a line is — how fast the yy-value changes as the xx-value changes. The classic definition is

slope=riserun\text{slope} = \frac{\text{rise}}{\text{run}}

where rise is the vertical change and run is the horizontal change between any two points on the line.

We almost always call slope mm. A bigger m|m| means a steeper line; the sign of mm tells you the direction:

The slope formula between two points

Given two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a line, the slope is

m=y2y1x2x1.m = \frac{y_2 - y_1}{x_2 - x_1}.

The numerator is the rise; the denominator is the run. The order of the points does not matter as long as you are consistent on top and bottom.

Example 1. Find the slope of the line through (2,3)(2, 3) and (5,9)(5, 9).

m=9352=63=2.m = \frac{9 - 3}{5 - 2} = \frac{6}{3} = 2.

The line rises 22 units for every 11 unit you move right.

Example 2. Find the slope of the line through (1,4)(1, 4) and (6,1)(6, -1).

m=1461=55=1.m = \frac{-1 - 4}{6 - 1} = \frac{-5}{5} = -1.

A slope of 1-1 means the line falls 11 unit for every 11 unit you move right.

Slope-intercept form: y=mx+by = mx + b

The most useful form of a linear equation is slope-intercept form:

y=mx+by = mx + b

where:

Once a line is in this form, you can read off both pieces of information instantly.

Example 3. Identify the slope and yy-intercept of y=3x2y = 3x - 2.

The line has slope m=3m = 3 and crosses the yy-axis at (0,2)(0, -2), so b=2b = -2.

Writing a line from two points

Given two points, you can produce the slope-intercept equation in three steps:

  1. Compute the slope mm using the formula above.
  2. Plug one point into y=mx+by = mx + b and solve for bb.
  3. Write the equation y=mx+by = mx + b with the values you found.

Example 4. Find the equation of the line through (2,5)(2, 5) and (6,13)(6, 13).

  1. Slope: m=13562=84=2m = \dfrac{13 - 5}{6 - 2} = \dfrac{8}{4} = 2.
  2. Plug (2,5)(2, 5) into y=2x+by = 2x + b: 5=2(2)+b5 = 2(2) + b, so b=1b = 1.
  3. The line is y=2x+1y = 2x + 1.

You can sanity-check by plugging in the second point: y=2(6)+1=13y = 2(6) + 1 = 13. ✓

Graphing a line from y=mx+by = mx + b

When the equation is already in slope-intercept form, graphing is fast:

  1. Plot the yy-intercept (0,b)(0, b).
  2. Use the slope as rise/run from that point to find a second point.
  3. Draw the line through the two points.

Example 5. Graph y=12x+3y = \dfrac{1}{2}x + 3.

For a negative slope, you can either go down-right or up-left — both produce the same line.

Other forms you will see

You may also see lines written in these forms; each is just y=mx+by = mx + b in disguise.

Example 6. Convert 4x+2y=104x + 2y = 10 to slope-intercept form.

Solve for yy:

2y=4x+10    y=2x+5.2y = -4x + 10 \implies y = -2x + 5.

So the slope is 2-2 and the yy-intercept is (0,5)(0, 5).

Common mistakes

Practice Yourself

Try each one on paper first, then click Show answer to check your work.

  1. 1Practice problem 1

    Find the slope of the line through (1,2)(1, 2) and (4,11)(4, 11).

    Show answer

    m=11241=93=3m = \dfrac{11 - 2}{4 - 1} = \dfrac{9}{3} = 3.

  2. 2Practice problem 2

    Identify the slope and yy-intercept of y=23x+4y = -\dfrac{2}{3}x + 4.

    Show answer

    Slope m=23m = -\dfrac{2}{3} (line falls 22 units for every 33 units right). yy-intercept is (0,4)(0, 4), so b=4b = 4.

  3. 3Practice problem 3

    Write the slope-intercept equation of the line through (0,1)(0, -1) with slope 55.

    Show answer

    The yy-intercept is given as (0,1)(0, -1), so b=1b = -1. The equation is y=5x1y = 5x - 1.

  4. 4Practice problem 4

    Convert 3xy=63x - y = 6 to slope-intercept form. What are the slope and yy-intercept?

    Show answer

    Solve for yy: y=3x+6    y=3x6-y = -3x + 6 \implies y = 3x - 6. Slope m=3m = 3, yy-intercept (0,6)(0, -6).

  5. 5Practice problem 5

    Write the equation of the line through (2,1)(2, 1) and (6,9)(6, 9) in slope-intercept form.

    Show answer

    Slope: m=9162=2m = \dfrac{9 - 1}{6 - 2} = 2. Plug (2,1)(2, 1) into y=2x+by = 2x + b: 1=4+b1 = 4 + b, so b=3b = -3. The line is y=2x3y = 2x - 3.

Related Topics

Frequently Asked Questions

What does "rise over run" mean?

Rise is the vertical change between two points on the line; run is the horizontal change. Slope equals rise divided by run, which measures how many units up the line goes for every unit it goes right.

What is the difference between slope-intercept form and point-slope form?

Slope-intercept form y=mx+by = mx + b shows the slope and where the line meets the yy-axis. Point-slope form yy1=m(xx1)y - y_1 = m(x - x_1) shows the slope and one specific point. They describe the same line — just the most convenient piece of info up front.

What does it mean if the slope is zero?

A slope of zero means the line is horizontal — yy stays constant no matter what xx does. The equation looks like y=by = b.

Why is a vertical line's slope undefined?

Because the run (the change in xx) is zero, and dividing by zero is not defined. Vertical lines are written as x=x = constant.

Does the order of the two points matter in the slope formula?

No, as long as you keep the order consistent on top and bottom. y2y1x2x1\dfrac{y_2 - y_1}{x_2 - x_1} and y1y2x1x2\dfrac{y_1 - y_2}{x_1 - x_2} give the same slope.

Want to keep going?

Try a different problem with the AI Math Solver, browse the practice library, or return to Middle School Math.

Ask AI ✨