Skip to content

Straight line graphs: y = mx + c, gradient, intercept and parallel and perpendicular lines

TutorAura guide · Updated

Every straight line on a graph can be written as

y=mx+cy = mx + c

where mm is the gradient (how steep it is) and cc is the y-intercept (where it crosses the y-axis). Read those two numbers off an equation and you can sketch the line; read them off a graph and you can write the equation. This guide covers both directions, plus finding a line through two points and the rules for parallel and perpendicular lines.

Key takeaways

  • Gradient m = change in y ÷ change in x (rise over run); c is where the line crosses the y-axis.
  • Rearrange to y = mx + c before reading off m and c.
  • Parallel lines have the same gradient; perpendicular gradients multiply to −1.
  • Equation through two points: find m, then substitute a point to find c.

Reading the gradient and intercept

y=2x+3y = 2x + 3: gradient 2, y-intercept 3. For every 1 across, the line goes up 2, and it passes through (0,3)(0, 3).

y=−12x+1y = -\tfrac{1}{2}x + 1: gradient −12-\tfrac{1}{2} (down 1 for every 2 across), y-intercept 1.

y=4xy = 4x: gradient 4, intercept 0 (through the origin). y=5y = 5: gradient 0, a horizontal line. x=3x = 3 is a vertical line and can't be written as y=mx+cy = mx + c.

Rearranging first

Equations aren't always given in the right form. Rearrange to y=…y = \ldots before reading off anything.

2y=6x−4  ⇒  y=3x−22y = 6x - 4 \;\Rightarrow\; y = 3x - 2: gradient 3, intercept −2.

3x+4y=12  ⇒  4y=−3x+12  ⇒  y=−34x+33x + 4y = 12 \;\Rightarrow\; 4y = -3x + 12 \;\Rightarrow\; y = -\tfrac{3}{4}x + 3: gradient −34-\tfrac{3}{4}, intercept 3.

Reading the gradient as 3 from 3x+4y=123x + 4y = 12 is a common error.

Finding the gradient from two points

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

Through (1,3)(1, 3) and (4,15)(4, 15): m=15−34−1=123=4m = \dfrac{15 - 3}{4 - 1} = \dfrac{12}{3} = 4.

Keep the order the same on top and bottom. A line going down from left to right has a negative gradient. Our gradient calculator shows the working.

The equation of a line through two points

  1. Find the gradient mm.
  2. Substitute mm and one point into y=mx+cy = mx + c to find cc.
  3. Write the equation.

Through (1,3)(1, 3) and (4,15)(4, 15): m=4m = 4. Using (1,3)(1, 3): 3=4(1)+c3 = 4(1) + c, so c=−1c = -1. Equation: y=4x−1y = 4x - 1. Check with the other point: 4(4)−1=154(4) - 1 = 15 ✓.

Alternatively use y−y1=m(x−x1)y - y_1 = m(x - x_1): y−3=4(x−1)y - 3 = 4(x - 1), which rearranges to the same thing. Our line equation calculator does both forms.

Parallel and perpendicular lines

Parallel lines have the same gradient. A line parallel to y=2x+3y = 2x + 3 through (0,−5)(0, -5) is y=2x−5y = 2x - 5.

Perpendicular lines have gradients that multiply to −1: the perpendicular gradient is the negative reciprocal, −1m-\tfrac{1}{m}.

GradientPerpendicular gradient
2−12-\tfrac{1}{2}
−34-\tfrac{3}{4}43\tfrac{4}{3}
1−1

A line perpendicular to y=2x+3y = 2x + 3 through (4,1)(4, 1): gradient −12-\tfrac{1}{2}, so 1=−12(4)+c1 = -\tfrac{1}{2}(4) + c, c=3c = 3, equation y=−12x+3y = -\tfrac{1}{2}x + 3.

Plotting a line

Make a table of three xx-values (three, so a mistake shows up as a point off the line), work out yy for each, plot and join with a ruler. For y=2x−1y = 2x - 1: x=0,1,2x = 0, 1, 2 gives y=−1,1,3y = -1, 1, 3.

To sketch quickly, mark the y-intercept, then use the gradient to step to a second point: from (0,−1)(0, -1), gradient 2 means 1 across and 2 up to (1,1)(1, 1).

Practice questions

  1. State the gradient and y-intercept of y=5−3xy = 5 - 3x.
  2. Rearrange 2x+5y=102x + 5y = 10 and state the gradient.
  3. Find the equation of the line through (2,7)(2, 7) and (5,16)(5, 16).
  4. Find the equation of the line parallel to y=−x+4y = -x + 4 through (3,2)(3, 2).
  5. Find the gradient of a line perpendicular to y=25x+1y = \tfrac{2}{5}x + 1.

Answers: 1. Gradient −3, intercept 5. 2. y=−25x+2y = -\tfrac{2}{5}x + 2, gradient −25-\tfrac{2}{5}. 3. y=3x+1y = 3x + 1. 4. y=−x+5y = -x + 5. 5. −52-\tfrac{5}{2}.

More practice in our straight line graphs questions.

Frequently asked questions

What do m and c stand for in y = mx + c?

m is the gradient, the steepness of the line (how much y changes for each 1 increase in x). c is the y-intercept, the value of y where the line crosses the y-axis.

How do I find the gradient between two points?

Divide the difference in the y-coordinates by the difference in the x-coordinates, keeping the points in the same order top and bottom.

What is the gradient of a perpendicular line?

The negative reciprocal: flip the fraction and change the sign. Perpendicular to gradient 3 is −1/3, and the two gradients multiply to −1.

Sources

  1. GCSE mathematics: subject content and assessment objectives. Department for Education.
  2. Cambridge IGCSE Mathematics 0580 syllabus. Cambridge International.