Equations of Straight Lines

How to find gradients, write and draw line equations, use parallel and perpendicular lines, and find intersections.

What a gradient tells you

The gradient measures how much y changes for each unit increase in x. For two points, use the change in y divided by the change in x

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

Subtract in the same order in the numerator and denominator. Positive gradients rise from left to right; negative gradients fall. A horizontal line has gradient 0. A vertical line has no finite gradient.

Worked example 1

Find the gradient of the line through A(-3,7) and B(5,-5). Give your answer as a fraction.

  1. Use the change from A to B: y changes by -5-7=-12
  2. Your turn. What is 5-(-3)?

    The change in x is 8

  3. m=\frac{-12}{8}=-\frac32
  4. Answer: -\frac32. The line falls 3 units for every 2 units moved to the right.

Two useful forms of a line

y=mx+c

Here, m is the gradient and c is the y-intercept. The line crosses the y-axis at (0,c)

If you know a point (x_1,y_1) and a gradient m, use:

y-y_1=m(x-x_1)

Rearrange afterwards if a different form is requested.

In a form such as ax+by=c, rearrange to make y the subject before reading the gradient. It is not usually the coefficient of x as first written.

Explore a line

Move the sliders to change m and c. The marked points are (0,c) and (2,2m+c), so the horizontal change between them is always 2

Try it: keep m fixed and move c. The lines stay parallel. Then set m=0: the line is horizontal, with equation y=c

Worked example 2

Find the equation of the line with gradient 3 through (2,-5). Give your answer in the form y=mx+c.

  1. Use y-(-5)=3(x-2), so y+5=3x-6
  2. Your turn. Subtract 5 from both sides. What is the constant term in y=3x+c?

    y=3x-11

  3. Answer: y=3x-11. Check the given point: 3(2)-11=-5

Drawing a line and finding intercepts

Find two points that satisfy the equation, plot them and join them with a straight line. A third point is a useful check. For a requested segment, stop at its stated endpoints.

On the x-axis, y=0. On the y-axis, x=0. Intercepts are often convenient points to plot.

A horizontal line through height b has equation y=b. A vertical line through x=a has equation x=a; it cannot be written as y=mx+c

Worked example 3

Find the line through (-2,6) and (4,-3) in the form ax+by=c. Find its intercepts so that you could draw it.

  1. m=\frac{-3-6}{4-(-2)}=-\frac96=-\frac32
  2. Use (-2,6): y-6=-\frac32(x+2). Multiply by 2: 2y-12=-3x-6
  3. Rearrange to get 3x+2y=6
  4. Your turn. Set y=0 in 3x+2y=6. What is x?

    The x-intercept is (2,0)

  5. Set x=0: 2y=6, so the y-intercept is (0,3)
  6. Answer: 3x+2y=6. Plot (2,0) and (0,3) and draw the straight line through them.

Parallel and perpendicular lines

Parallel lines have equal gradients. For perpendicular lines with finite gradients:

m_1m_2=-1

Take the negative reciprocal. A horizontal line and a vertical line are also perpendicular.

Worked example 4

Find the line through (2,5) perpendicular to 4x-3y=9. Give your answer in the form ax+by=c.

  1. Rearrange the given line: y=\frac43x-3. Its gradient is \frac43
  2. Your turn. What is the perpendicular gradient?

    The required gradient is -\frac34

  3. Use the point: y-5=-\frac34(x-2). Multiply by 4: 4y-20=-3x+6
  4. Answer: 3x+4y=26. The gradients multiply to -1, and 3(2)+4(5)=26

Worked example 5

Find the line through (-5,1) parallel to 2x+5y=10.

  1. The given line is y=-\frac25x+2, so the required gradient is -\frac25
  2. Write y=-\frac25x+c and substitute (-5,1): 1=2+c
  3. Your turn. Solve 1=2+c for c

    c=-1

  4. Answer: y=-\frac25x-1, or 2x+5y=-5. The intercept changes; the gradient stays the same.

Worked example 6

Find the point where y=2x-7 and 3x+2y=7 intersect.

  1. At the intersection, both equations are true. Substitute y=2x-7 into the second equation: 3x+2(2x-7)=7
  2. Simplify: 7x-14=7, so x=3
  3. Your turn. Use y=2x-7 to find the intersection as a coordinate pair.

    Write your answer as (x, y)

    y=2(3)-7=-1, so the point is (3,-1)

  4. Answer: (3,-1). Check: 3(3)+2(-1)=7

Common mistakes

  • Reversing only one subtraction. Use the same point order in both coordinate differences.
  • Turning the gradient fraction upside down. Use change in y divided by change in x.
  • Reading a gradient before rearranging. Write the line as y=mx+c first; vertical lines have no finite gradient.
  • Only changing the sign for a perpendicular gradient. Take the negative reciprocal; horizontal and vertical lines form a separate case.
  • Using the wrong intercept condition. For an x-axis intercept set y=0; for a y-axis intercept set x=0.
  • Giving only one intersection coordinate. Find and state both coordinates as (x,y).