Skip to content
Family Table Math
Auto

Equations of Lines

In Grade 9 you worked with lines in the form y=mx+by = mx + b. This page adds a formula for slope that works for any two points, shows how to find the equation of a line from whatever information you’re given, and introduces two more ways to write the same line. You’ll use all of this in every linear systems and analytic geometry page that follows.

The slope mm of a line measures how steep it is: how much yy changes for each step in xx.

m=riserun=change in ychange in xm = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x}

Pick any two points on the line, (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). Going from the first to the second, the rise is y2−y1y_2 - y_1 and the run is x2−x1x_2 - x_1. That gives the slope formula:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
A line through (1, 2) and (7, 6) with a slope triangle: run 6, rise 4, so the slope is 4/6 = 2/3 −1 1 2 3 4 5 6 7 8 9 10 11 2 4 6 (x₁, y₁) = (1, 2) (x₂, y₂) = (7, 6) run = 7 − 1 = 6 rise = 6 − 2 = 4
From (1,2)(1, 2) to (7,6)(7, 6) the run is 66 and the rise is 44, so m=46=23m = \dfrac{4}{6} = \dfrac{2}{3}.

It doesn’t matter which point you call “first”, as long as you subtract in the same order on the top and the bottom. Going from (7,6)(7, 6) to (1,2)(1, 2) instead gives 2−61−7=−4−6=23\dfrac{2 - 6}{1 - 7} = \dfrac{-4}{-6} = \dfrac{2}{3}, the same slope.

Write slopes as exact fractions in lowest terms, like 23\dfrac{2}{3}, not 0.670.67.

LineSlopeEquation looks like
rises left to rightpositivey=2x+1y = 2x + 1
falls left to rightnegativey=−3x+4y = -3x + 4
horizontal00 (the rise is 00)y=5y = 5
verticalundefined (the run is 00)x=−2x = -2

A vertical line has no slope at all: the slope formula would divide by 00. Its equation is x=ax = a, because every point on it has the same xx-coordinate. A horizontal line through (3,5)(3, 5) is y=5y = 5, because every point on it has yy-coordinate 55.

FormExampleGood for
slope–intercept: y=mx+by = mx + by=−32x+3y = -\dfrac{3}{2}x + 3reading the slope and yy-intercept, graphing
standard form: Ax+By+C=0Ax + By + C = 03x+2y−6=03x + 2y - 6 = 0no fractions; a tidy final answer
Ax+By=DAx + By = D3x+2y=63x + 2y = 6finding intercepts, setting up linear systems

In the last two forms, AA, BB, CC and DD are integers, and we usually make AA positive. All three examples in the table are the same line.

To convert to y=mx+by = mx + b, solve for yy. To convert from y=mx+by = mx + b, multiply by the denominator to clear fractions, then move every term to one side (for Ax+By+C=0Ax + By + C = 0) or move only the constant to the right side (for Ax+By=DAx + By = D).

  • The xx-intercept is where the line crosses the xx-axis. Every point on the xx-axis has y=0y = 0, so set y=0y = 0 and solve for xx.
  • The yy-intercept is where the line crosses the yy-axis. Set x=0x = 0 and solve for yy. In y=mx+by = mx + b, it’s simply bb.

For 3x+2y=63x + 2y = 6: when y=0y = 0, 3x=63x = 6 so x=2x = 2; when x=0x = 0, 2y=62y = 6 so y=3y = 3. Plotting (2,0)(2, 0) and (0,3)(0, 3) is a fast way to graph the line.

You always need two things: the slope mm and the yy-intercept bb.

  1. Find mm. From a graph, count rise over run. From two points or a table, use the slope formula.
  2. Find bb. If you can see where the line crosses the yy-axis, read it off. Otherwise, substitute mm and any point (x,y)(x, y) on the line into y=mx+by = mx + b and solve for bb.
  3. Write the equation, then change the form if the question asks.
  4. Check that a second point on the line satisfies your equation.

Find the equation of the line in the graph. Write it in the form y=mx+by = mx + b and in the form Ax+By+C=0Ax + By + C = 0.

A line falling from left to right, crossing the y-axis at (0, 3) and the x-axis at (2, 0) −2 −1 1 3 4 −3 −2 −1 1 2 4 5
The line crosses the axes at (0,3)(0, 3) and (2,0)(2, 0).

Solution. The line crosses the yy-axis at (0,3)(0, 3), so b=3b = 3.

From (0,3)(0, 3) to (2,0)(2, 0), the run is 22 (right) and the rise is −3-3 (down):

m=−32=−32m = \frac{-3}{2} = -\frac{3}{2}

So the equation is

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

For standard form, multiply every term by 22, then move everything to the left side:

2y=−3x+63x+2y−6=0\begin{aligned} 2y &= -3x + 6 \\ 3x + 2y - 6 &= 0 \end{aligned}

Check with (2,0)(2, 0): 3(2)+2(0)−6=03(2) + 2(0) - 6 = 0. ✓

Find the equation of the line through (−2,5)(-2, 5) and (4,−7)(4, -7).

Solution. Use the slope formula:

m=−7−54−(−2)=−126=−2m = \frac{-7 - 5}{4 - (-2)} = \frac{-12}{6} = -2

Substitute m=−2m = -2 and the point (−2,5)(-2, 5) into y=mx+by = mx + b:

5=−2(−2)+b5=4+bb=1\begin{aligned} 5 &= -2(-2) + b \\ 5 &= 4 + b \\ b &= 1 \end{aligned}

The equation is y=−2x+1y = -2x + 1.

Check with the other point, (4,−7)(4, -7): −2(4)+1=−8+1=−7-2(4) + 1 = -8 + 1 = -7. ✓

Find the equation of the line that passes through these points. Give it in standard form.

xx−1-1113355
yy774411−2-2

Solution. Each time xx goes up by 22, yy goes down by 33. The changes are constant, so the points really are on a line, and

m=−32=−32m = \frac{-3}{2} = -\frac{3}{2}

The table doesn’t include x=0x = 0, so find bb by substituting a point, say (1,4)(1, 4):

4=−32(1)+bb=4+32=112\begin{aligned} 4 &= -\frac{3}{2}(1) + b \\ b &= 4 + \frac{3}{2} = \frac{11}{2} \end{aligned}

So y=−32x+112y = -\dfrac{3}{2}x + \dfrac{11}{2}. Multiply by 22 and move everything to the left:

2y=−3x+113x+2y−11=0\begin{aligned} 2y &= -3x + 11 \\ 3x + 2y - 11 &= 0 \end{aligned}

Check with (5,−2)(5, -2): 3(5)+2(−2)−11=15−4−11=03(5) + 2(-2) - 11 = 15 - 4 - 11 = 0. ✓

Example 4: Converting forms and finding intercepts

Section titled “Example 4: Converting forms and finding intercepts”

For the line 4x−3y+12=04x - 3y + 12 = 0:

  • (a) Write the equation in the form y=mx+by = mx + b, and state the slope.
  • (b) Write the equation in the form Ax+By=DAx + By = D.
  • (c) Find both intercepts.

Solution.

(a) Solve for yy:

4x−3y+12=0−3y=−4x−12y=43x+4divide every term by −3\begin{aligned} 4x - 3y + 12 &= 0 \\ -3y &= -4x - 12 \\ y &= \frac{4}{3}x + 4 && \text{divide every term by } -3 \end{aligned}

The slope is 43\dfrac{4}{3}.

(b) Move only the constant to the right side: 4x−3y=−124x - 3y = -12.

(c) For the yy-intercept, read bb from part (a): it’s 44, the point (0,4)(0, 4). For the xx-intercept, set y=0y = 0: 4x=−124x = -12, so x=−3x = -3, the point (−3,0)(-3, 0).

Check: the slope from (−3,0)(-3, 0) to (0,4)(0, 4) is 4−00−(−3)=43\dfrac{4 - 0}{0 - (-3)} = \dfrac{4}{3}. ✓

Subtracting in different orders on the top and bottom. Writing y2−y1x1−x2\dfrac{y_2 - y_1}{x_1 - x_2} flips the sign of the slope. Whatever point you start with on the top, start with the same point on the bottom.

Putting run over rise. Slope is change in ychange in x\dfrac{\text{change in } y}{\text{change in } x}. The yy-values go on top. A quick sense check: a line that looks steeper than 45∘45^\circ should have a slope bigger than 11 (or less than −1-1).

Mixing up zero and undefined slope. A horizontal line has slope 00 and equation y=by = b. A vertical line has undefined slope and equation x=ax = a. “No slope” and “zero slope” are not the same thing.

Using b from the wrong place. In y=mx+by = mx + b, bb is the yy-intercept only after you’ve solved for yy. In 3x+2y=63x + 2y = 6, the yy-intercept is 33, not 66.

Sign slips when changing forms. When a term crosses the equals sign it changes sign, and when you divide by a negative, every term changes sign. Check by substituting a point into both versions of the equation.

Confusing the two intercepts. The xx-intercept is found by setting y=0y = 0 (not x=0x = 0), because it’s on the xx-axis, where yy is 00.

1. (Warm-up) Find the slope of the line through (3,−1)(3, -1) and (7,11)(7, 11).

Solutionm=11−(−1)7−3=124=3m = \frac{11 - (-1)}{7 - 3} = \frac{12}{4} = 3

2. (Warm-up) Find the slope of the line through each pair of points, and write the equation of the line.

  • (a) (−4,2)(-4, 2) and (5,2)(5, 2)
  • (b) (3,1)(3, 1) and (3,−6)(3, -6)
Solution

(a) m=2−25−(−4)=09=0m = \dfrac{2 - 2}{5 - (-4)} = \dfrac{0}{9} = 0. The line is horizontal: y=2y = 2.

(b) m=−6−13−3=−70m = \dfrac{-6 - 1}{3 - 3} = \dfrac{-7}{0}, which is undefined. The line is vertical: x=3x = 3.

3. (Warm-up) A line has slope 25\dfrac{2}{5} and yy-intercept −3-3. Write its equation in the form y=mx+by = mx + b and in the form Ax+By+C=0Ax + By + C = 0.

Solution

y=25x−3y = \dfrac{2}{5}x - 3.

Multiply by 55: 5y=2x−155y = 2x - 15. Move everything to the right side so that the xx term stays positive: 0=2x−5y−150 = 2x - 5y - 15. So

2x−5y−15=02x - 5y - 15 = 0

Check with the yy-intercept (0,−3)(0, -3): 2(0)−5(−3)−15=02(0) - 5(-3) - 15 = 0. ✓

4. (Core) Find the equation of the line through (6,−1)(6, -1) with slope −23-\dfrac{2}{3}. Give your answer in both y=mx+by = mx + b form and standard form.

Solution

Substitute into y=mx+by = mx + b:

−1=−23(6)+b−1=−4+bb=3\begin{aligned} -1 &= -\frac{2}{3}(6) + b \\ -1 &= -4 + b \\ b &= 3 \end{aligned}

So y=−23x+3y = -\dfrac{2}{3}x + 3. Multiply by 33: 3y=−2x+93y = -2x + 9, so

2x+3y−9=02x + 3y - 9 = 0

Check with (6,−1)(6, -1): 2(6)+3(−1)−9=12−3−9=02(6) + 3(-1) - 9 = 12 - 3 - 9 = 0. ✓

5. (Core) Find the equation of the line through (−3,−4)(-3, -4) and (1,8)(1, 8).

Solutionm=8−(−4)1−(−3)=124=3m = \frac{8 - (-4)}{1 - (-3)} = \frac{12}{4} = 3

Substitute (1,8)(1, 8): 8=3(1)+b8 = 3(1) + b, so b=5b = 5. The equation is y=3x+5y = 3x + 5.

Check with (−3,−4)(-3, -4): 3(−3)+5=−43(-3) + 5 = -4. ✓

6. (Core) Write 5x+2y−10=05x + 2y - 10 = 0 in the form y=mx+by = mx + b. State the slope and both intercepts.

Solution2y=−5x+10y=−52x+5\begin{aligned} 2y &= -5x + 10 \\ y &= -\frac{5}{2}x + 5 \end{aligned}

The slope is −52-\dfrac{5}{2} and the yy-intercept is 55. For the xx-intercept, set y=0y = 0: 5x−10=05x - 10 = 0, so x=2x = 2.

7. (Core) Water drains from a tank at a constant rate. The table shows the volume VV (in litres) after tt minutes.

tt (min)225588
VV (L)340340280280220220
  • (a) Find an equation for VV in terms of tt.
  • (b) What do the slope and the VV-intercept mean here?
  • (c) When will the tank be empty?
Solution

(a) Every 33 minutes the volume drops by 6060 L, so m=−603=−20m = \dfrac{-60}{3} = -20. Substitute (2,340)(2, 340): 340=−20(2)+b340 = -20(2) + b, so b=380b = 380.

V=−20t+380V = -20t + 380

Check with (8,220)(8, 220): −20(8)+380=220-20(8) + 380 = 220. ✓

(b) The slope means the tank loses 2020 L every minute. The VV-intercept means the tank held 380380 L when it started draining (t=0t = 0).

(c) Set V=0V = 0: −20t+380=0-20t + 380 = 0, so t=19t = 19. The tank is empty after 1919 minutes.

8. (Challenge) The line through (2,k)(2, k) and (−1,4)(-1, 4) has slope −3-3. Find kk.

Solutionk−42−(−1)=−3k−43=−3k−4=−9k=−5\begin{aligned} \frac{k - 4}{2 - (-1)} &= -3 \\ \frac{k - 4}{3} &= -3 \\ k - 4 &= -9 \\ k &= -5 \end{aligned}

Check: the slope from (−1,4)(-1, 4) to (2,−5)(2, -5) is −5−42+1=−93=−3\dfrac{-5 - 4}{2 + 1} = \dfrac{-9}{3} = -3. ✓

9. (Challenge) A line has xx-intercept 44 and yy-intercept −6-6. Write its equation in all three forms.

Solution

The line passes through (4,0)(4, 0) and (0,−6)(0, -6).

m=−6−00−4=−6−4=32m = \frac{-6 - 0}{0 - 4} = \frac{-6}{-4} = \frac{3}{2}

The yy-intercept is −6-6, so y=32x−6y = \dfrac{3}{2}x - 6.

Multiply by 22: 2y=3x−122y = 3x - 12. Rearranging gives 3x−2y−12=03x - 2y - 12 = 0, or 3x−2y=123x - 2y = 12.

Check the intercepts in 3x−2y=123x - 2y = 12: when y=0y = 0, x=4x = 4 ✓; when x=0x = 0, y=−6y = -6 ✓.