M4.8.4 Chapter 4

Equations of straight lines

A straight line goes through (1, 3) and (4, 9). How do I find its equation?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Find the equation of a line through two points
  • Spot parallel and perpendicular lines from their gradients

A path goes from the point A (1, 3) to the point B (4, 9). Going across, it climbs. How steep is it? Count the steps across, and count how far it goes up.

Draw it first

Rise over run

  1. A graph with the x axis x and the y axis y. Step 1 draws a straight line named y = 2x + 1 through the points A (1, 3) and B (4, 9). Step 2 draws a dashed leg from A across to the right, named run 3. Step 3 draws a dashed leg up to B, named rise 6.A (1, 3)B (4, 9)y = 2x + 11234562468100xy

    1 Draw the line through A and B.

  2. A graph with the x axis x and the y axis y. Step 1 draws a straight line named y = 2x + 1 through the points A (1, 3) and B (4, 9). Step 2 draws a dashed leg from A across to the right, named run 3. Step 3 draws a dashed leg up to B, named rise 6.A (1, 3)B (4, 9)y = 2x + 1run 31234562468100xy

    2 From A go across to the right until you are below B. This is the run: 4 − 1 = 3.

  3. A graph with the x axis x and the y axis y. Step 1 draws a straight line named y = 2x + 1 through the points A (1, 3) and B (4, 9). Step 2 draws a dashed leg from A across to the right, named run 3. Step 3 draws a dashed leg up to B, named rise 6.A (1, 3)B (4, 9)y = 2x + 1run 3rise 61234562468100xy

    3 Then go up to B. This is the rise: 9 − 3 = 6.

The gradient is how steep the line is. It is the rise divided by the run: 6 ÷ 3 = 2. For the points (x₁, y₁) and (x₂, y₂), the gradient is m = (y₂ − y₁)/(x₂ − x₁). Take the points in the same order on the top and the bottom.

The equation of a straight line is y = mx + c. The number m is the gradient. The number c is where the line crosses the y axis. For our line m = 2, so y = 2x + c. To find c, put in the coordinates of any point on the line.

A graph with the x axis x and the y axis y. A straight line named y = 2x + 1 through the points A (1, 3) and B (4, 9). It crosses the y axis at the point (0, 1).(0, 1)A (1, 3)B (4, 9)y = 2x + 1123452468100xy
The line crosses the y axis at 1, so c = 1.

Worked example

Find the equation of the line through (1, 3) and (4, 9).

  1. Gradient: m = (9 − 3)/(4 − 1) = 6/3 = 2.
  2. The line is y = 2x + c.
  3. Put in the point (1, 3): 3 = 2 × 1 + c, so c = 1.
  4. The equation is y = 2x + 1.
  5. Check with the other point (4, 9): 2 × 4 + 1 = 9.

Answer: y = 2x + 1

A line that goes down as you move right has a negative rise. Its gradient is negative. From J (2, 7) to K (5, 1) the run is 3 and the rise is −6, so the gradient is −2.

A graph with the x axis x and the y axis y. A falling straight line named y = −2x + 11 through the points J (2, 7) and K (5, 1). A dashed leg from J across, named run 3, and a dashed leg down to K, named rise −6.J (2, 7)K (5, 1)y = −2x + 11run 3rise −6123456246810120xy
A line that falls to the right has a negative gradient.

Worked example

Find the equation of the line through (2, 7) and (5, 1).

  1. Rise: 1 − 7 = −6. Run: 5 − 2 = 3.
  2. Gradient: m = −6/3 = −2. The line falls, so the gradient is negative.
  3. The line is y = −2x + c. Put in the point (2, 7): 7 = −2 × 2 + c, so c = 11.
  4. The equation is y = −2x + 11.
  5. Check with (5, 1): −2 × 5 + 11 = 1.

Answer: y = −2x + 11

Two lines are parallel when they never meet. Parallel lines go up at the same rate, so they have the same gradient. Lines with the same gradient and different values of c are parallel.

A graph with the x axis x and the y axis y. Two straight lines named y = 2x + 1 and y = 2x − 3 never meet. Both rise by 2 for each 1 across.y = 2x + 1y = 2x − 312345−4−2246810120xy
The same gradient, 2, makes the lines parallel.

Two lines are perpendicular when they cross at a right angle. Their gradients multiply to give −1. To see why, take a step "across 2, up 1" along a line through the origin. A quarter turn about the origin sends it to "across −1, up 2". The first line has gradient 1/2 and the turned line has gradient −2.

A graph with the x axis x and the y axis y, with the same scale across and up. A line named y = 0.5x through the origin and the point A. A line named y = −2x through the origin and the point B. The two lines meet at a right angle.ABy = 0.5xy = −2x−3−2−1123−3−2−11230xy
A is (2, 1). A quarter turn takes it to B, which is (−1, 2). The gradients 0.5 and −2 multiply to −1.

In general, a step "across a, up b" turns into "across −b, up a". The gradients are b/a and −a/b, and their product is −1. This works when neither line is upright. An upright line has no gradient, and it is perpendicular to a flat line.

A graph with the x axis x and the y axis y, with the same scale across and up. A line named y = 2x − 1 and a line named y = −0.5x + 4 cross at the point P (2, 3) at a right angle.P (2, 3)y = 2x − 1y = −0.5x + 4−1123456−11234560xy
The gradients are 2 and −0.5. Their product is −1, so the lines are perpendicular.
A graph with the x axis x and the y axis y, with the same scale across and up. A line named y = −2x + 5 and a line named y = 0.5x + 3 cross at a right angle. The point T (4, 5) is on the line y = 0.5x + 3.T (4, 5)y = −2x + 5y = 0.5x + 31234561234560xy
The line y = 0.5x + 3 goes through T (4, 5). It meets y = −2x + 5 at a right angle.

Worked example

A line has the equation y = −2x + 5. Find the line perpendicular to it through (4, 5).

  1. The first line has gradient −2. For perpendicular lines the gradients multiply to give −1.
  2. So −2 × m = −1, which gives m = 0.5.
  3. The new line is y = 0.5x + c. It passes through (4, 5).
  4. Put in x = 4 and y = 5: 5 = 0.5 × 4 + c, so 5 = 2 + c.
  5. So c = 5 − 2 = 3, and the line is y = 0.5x + 3.
  6. Check: the point (4, 5) gives 0.5 × 4 + 3 = 5. And −2 × 0.5 = −1.

Answer: y = 0.5x + 3

See it three ways

With things

A ramp starts 2 metres up a wall and reaches 8 metres at 2 metres across. How steep is it, and what is its rule?

As a picture

A graph with the x axis x, across (m) and the y axis y, up (m). A straight line named y = 3x + 2 through the points E (0, 2) and F (2, 8). A dashed run named run 2 m and a dashed rise named rise 6 m.E (0, 2)F (2, 8)y = 3x + 2run 2 mrise 6 m12342468100x, across (m)y, up (m)

In words

The line starts at 2 on the y axis. For every 2 across it goes up 6, so for every 1 across it goes up 3.

In symbols

m = (8 − 2)/(2 − 0) = 3 and c = 2, so y = 3x + 2.

Try it

Find a line from two points

You need: squared paper, a ruler, a pencil.

  1. Plot the points (2, 2) and (6, 5) and draw the line through them.
  2. Mark the run from the first point across to the right. Count it: 4.
  3. Mark the rise up to the second point. Count it: 3. Write the gradient, 3 ÷ 4.

What you will see: The gradient is 0.75. Where the line meets the y axis you can read c = 0.5, so the equation is y = 0.75x + 0.5.

If you cannot try it, this is what happens.
A graph with the x axis x and the y axis y. A straight line named y = 0.75x + 0.5 through the points G (2, 2) and H (6, 5). A dashed run named run 4 and a dashed rise named rise 3.G (2, 2)H (6, 5)y = 0.75x + 0.5run 4rise 312345671234560xy

A wrong idea many people have

A line perpendicular to a line with gradient 2 has gradient −2.

Why it feels right: Perpendicular lines point in opposite directions, so the opposite number feels right.

The test that breaks it: Take y = 2x and y = −2x. Their gradients multiply to 2 × (−2) = −4, not −1. Drawn on squared paper, the two lines do not meet at a right angle. The line y = −0.5x does.

What is true: Perpendicular gradients multiply to −1. Turn the number upside down and change its sign: 2 becomes −1/2, which is −0.5.

A wrong idea many people have

The gradient is the run divided by the rise.

Why it feels right: Both numbers are on the picture, so the order feels like a choice.

The test that breaks it: The line y = 2x goes up 2 for every 1 across. Run ÷ rise gives 1 ÷ 2 = 0.5, but the steep line has gradient 2.

What is true: The gradient is the rise divided by the run. A steeper line has a bigger gradient.

Key words

gradient
how steep a line is: the rise divided by the run, m = (y₂ − y₁)/(x₂ − x₁).
parallel
lines that never meet. They have the same gradient.
perpendicular
lines that cross at a right angle. Their gradients multiply to give −1.

Back to your guess

The answer is C: y = 2x + 1, because it goes up 2 for every 1 across.

The line rises 6 while it runs 3 across, so the gradient is 6 ÷ 3 = 2. Putting the point (1, 3) into y = 2x + c gives c = 1. The equation is y = 2x + 1.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. What is the gradient of the line through C and D?

    A graph with the x axis x and the y axis y. A falling straight line through the points C (1, 7) and D (4, 1). A dashed leg from C across, named run 3, and a dashed leg down to D, named rise −6.C (1, 7)D (4, 1)run 3rise −612345624680xy
    Tap your answer.
    1. Not this one. The line goes down as you move right, so the gradient is negative. Check the sign of the rise. Go to M4.8.4. Try another.

    2. Not this one. You divided the run by the rise. The gradient is the rise divided by the run: −6 ÷ 3. Go to M4.8.4. Try another.

    3. Not this one. That is the rise alone. Divide it by the run, 3, to get the steepness for each 1 across. Go to M4.8.4. Try another.

    4. Yes, that is right. The rise is 1 − 7 = −6 and the run is 4 − 1 = 3. The gradient is −6 ÷ 3 = −2.

    See the answer

    −2

    The rise is 1 − 7 = −6 and the run is 4 − 1 = 3. The gradient is −6 ÷ 3 = −2.

    • If you chose A: The line goes down as you move right, so the gradient is negative. Check the sign of the rise. Go to M4.8.4.
    • If you chose B: You divided the run by the rise. The gradient is the rise divided by the run: −6 ÷ 3. Go to M4.8.4.
    • If you chose C: That is the rise alone. Divide it by the run, 3, to get the steepness for each 1 across. Go to M4.8.4.
  2. Find the equation of the line through (1, 4) and (3, 10).

    Tap your answer.
    1. Not this one. You used 4, the y of the first point, as c. The number c is where the line crosses the y axis. Put x = 1 and y = 4 into y = 3x + c to find it. Go to M4.8.4. Try another.

    2. Yes, that is right. The gradient is (10 − 4)/(3 − 1) = 6/2 = 3. Put in (1, 4): 4 = 3 × 1 + c, so c = 1. Check (3, 10): 3 × 3 + 1 = 10.

    3. Not this one. The rise is 6, but the gradient is the rise divided by the run, 6 ÷ 2 = 3. Go to M4.8.4. Try another.

    4. Not this one. From 4 = 3 + c you took 4 from 3. Take 3 from 4 instead: c = 1. Check (1, 4): 3 × 1 − 1 = 2, not 4. Go to M4.8.4. Try another.

    See the answer

    y = 3x + 1

    The gradient is (10 − 4)/(3 − 1) = 6/2 = 3. Put in (1, 4): 4 = 3 × 1 + c, so c = 1. Check (3, 10): 3 × 3 + 1 = 10.

    • If you chose A: You used 4, the y of the first point, as c. The number c is where the line crosses the y axis. Put x = 1 and y = 4 into y = 3x + c to find it. Go to M4.8.4.
    • If you chose C: The rise is 6, but the gradient is the rise divided by the run, 6 ÷ 2 = 3. Go to M4.8.4.
    • If you chose D: From 4 = 3 + c you took 4 from 3. Take 3 from 4 instead: c = 1. Check (1, 4): 3 × 1 − 1 = 2, not 4. Go to M4.8.4.
  3. Which line is parallel to y = 4x − 5?

    Tap your answer.
    1. Yes, that is right. Parallel lines have the same gradient. Only y = 4x + 7 has gradient 4. Its c is different, so the lines never meet.

    2. Not this one. This line has the same c, so it meets the first line on the y axis. Parallel lines need the same gradient, 4. Go to M4.8.4. Try another.

    3. Not this one. Its gradient times 4 is −1, so this line is perpendicular, not parallel. Go to M4.8.4. Try another.

    4. Not this one. The numbers are swapped. The gradient is now 5, not 4, so the lines are not parallel. Go to M4.8.4. Try another.

    See the answer

    y = 4x + 7

    Parallel lines have the same gradient. Only y = 4x + 7 has gradient 4. Its c is different, so the lines never meet.

    • If you chose B: This line has the same c, so it meets the first line on the y axis. Parallel lines need the same gradient, 4. Go to M4.8.4.
    • If you chose C: Its gradient times 4 is −1, so this line is perpendicular, not parallel. Go to M4.8.4.
    • If you chose D: The numbers are swapped. The gradient is now 5, not 4, so the lines are not parallel. Go to M4.8.4.
  4. Which line is perpendicular to y = 2x + 3?

    Tap your answer.
    1. Not this one. The gradients 2 and −2 multiply to −4. For perpendicular lines the product must be −1. Go to M4.8.4. Try another.

    2. Not this one. You turned the gradient upside down but kept the sign. 2 × 0.5 = 1, not −1. Go to M4.8.4. Try another.

    3. Yes, that is right. Perpendicular gradients multiply to −1. 2 × (−0.5) = −1, so y = −0.5x + 1 is perpendicular. The c can be any number.

    4. Not this one. The gradients 2 and −3 multiply to −6. The product must be −1. Go to M4.8.4. Try another.

    See the answer

    y = −0.5x + 1

    Perpendicular gradients multiply to −1. 2 × (−0.5) = −1, so y = −0.5x + 1 is perpendicular. The c can be any number.

    • If you chose A: The gradients 2 and −2 multiply to −4. For perpendicular lines the product must be −1. Go to M4.8.4.
    • If you chose B: You turned the gradient upside down but kept the sign. 2 × 0.5 = 1, not −1. Go to M4.8.4.
    • If you chose D: The gradients 2 and −3 multiply to −6. The product must be −1. Go to M4.8.4.
  5. Line P has gradient 2. Line Q is perpendicular to P. What is the gradient of Q?

    Tap your answer.
    1. Not this one. That is the gradient of a parallel line. Perpendicular lines have gradients that multiply to −1. Go to M4.8.4. Try another.

    2. Not this one. 2 × (−2) = −4, not −1. Turn 2 upside down as well as changing its sign. Go to M4.8.4. Try another.

    3. Not this one. 2 × 0.5 = 1, not −1. You turned the number upside down but kept the sign. Go to M4.8.4. Try another.

    4. Yes, that is right. The gradients multiply to −1, so 2 × m = −1 and m = −1 ÷ 2 = −0.5.

    See the answer

    −0.5

    The gradients multiply to −1, so 2 × m = −1 and m = −1 ÷ 2 = −0.5.

    • If you chose A: That is the gradient of a parallel line. Perpendicular lines have gradients that multiply to −1. Go to M4.8.4.
    • If you chose B: 2 × (−2) = −4, not −1. Turn 2 upside down as well as changing its sign. Go to M4.8.4.
    • If you chose C: 2 × 0.5 = 1, not −1. You turned the number upside down but kept the sign. Go to M4.8.4.
  6. The graph shows a line through A and B. Which is its equation?

    A graph with the x axis x and the y axis y. A falling straight line through the points A (0, 5) and B (2, 1).A (0, 5)B (2, 1)12341234560xy
    Tap your answer.
    1. Not this one. The line goes down as you move right, so its gradient is negative. Go to M4.8.4. Try another.

    2. Yes, that is right. The line crosses the y axis at A, so c = 5. The gradient is (1 − 5)/(2 − 0) = −4/2 = −2. So y = −2x + 5.

    3. Not this one. The number c is where the line crosses the y axis. That is at A, where y is 5, not 1. Go to M4.8.4. Try another.

    4. Not this one. You divided the run by the rise. The gradient is the rise divided by the run: −4 ÷ 2. Go to M4.8.4. Try another.

    See the answer

    y = −2x + 5

    The line crosses the y axis at A, so c = 5. The gradient is (1 − 5)/(2 − 0) = −4/2 = −2. So y = −2x + 5.

    • If you chose A: The line goes down as you move right, so its gradient is negative. Go to M4.8.4.
    • If you chose C: The number c is where the line crosses the y axis. That is at A, where y is 5, not 1. Go to M4.8.4.
    • If you chose D: You divided the run by the rise. The gradient is the rise divided by the run: −4 ÷ 2. Go to M4.8.4.
  7. Find the gradient of the line through (2, 3) and (6, 11).

    See the answer

    2

    The rise is 11 − 3 = 8 and the run is 6 − 2 = 4. The gradient is 8 ÷ 4 = 2.

  8. The line y = 3x + c passes through (2, 11). What is c?

    See the answer

    c = 5

    Put x = 2 and y = 11 in y = 3x + c: 11 = 3 × 2 + c, so 11 = 6 + c and c = 5.

  9. From an earlier chapter

    Solve 4x − 3 < 13.

    Tap your answer.
    1. Yes, that is right. Add 3 to both sides: 4x < 16. Divide both sides by 4. The sign stays, because 4 is positive: x < 4.

    2. Not this one. The sign flips only when you multiply or divide both sides by a negative number. Dividing by 4 keeps the sign. Go to M4.8.3. Try another.

    3. Not this one. Adding 3 to both sides gives 4x < 16, which is right. But 4 still multiplies x, so divide both sides by 4 as well. Go to M4.8.3. Try another.

    4. Not this one. You took 3 from the 13. The 3 is taken away on the left, so add 3 to both sides: 4x < 16. Go to M4.8.3. Try another.

    See the answer

    x < 4

    Add 3 to both sides: 4x < 16. Divide both sides by 4. The sign stays, because 4 is positive: x < 4.

    • If you chose B: The sign flips only when you multiply or divide both sides by a negative number. Dividing by 4 keeps the sign. Go to M4.8.3.
    • If you chose C: Adding 3 to both sides gives 4x < 16, which is right. But 4 still multiplies x, so divide both sides by 4 as well. Go to M4.8.3.
    • If you chose D: You took 3 from the 13. The 3 is taken away on the left, so add 3 to both sides: 4x < 16. Go to M4.8.3.

Keep it

Copy this into your exercise book.

Gradient m = rise ÷ run. Put one point in y = mx + c to find c. Parallel: same m. Perpendicular: the m values multiply to −1.

Draw: A line through two points with a dashed run and rise, and y = 2x + 1 written beside it.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (989 KB). It opens on any phone.