Skip to content
IGCSE·Tuition
Mathematics · Lessons

Calculate a gradient from two points

You can read a gradient off a drawn line, but a question that gives only two coordinates leaves you unsure where to start.

On this page
  1. What does the gradient formula say?
  2. How do you work it out, step by step?
  3. Worked example
  4. The mistake to watch for
  5. Check yourself
  6. Where this leads next

The gradient of a line measures how steeply it rises or falls: change in y divided by change in x. It appears whenever a question gives two points and asks about the line joining them, and it feeds every other lesson in coordinate geometry.

What does the gradient formula say?

For two points (x₁, y₁) and (x₂, y₂), the gradient is m = (y₂ − y₁) / (x₂ − x₁). The numerator is how far you go up or down. The denominator is how far you go across.

A positive gradient means the line rises as you move right. A negative gradient means it falls. A gradient of 0 is a flat line, and a line with no gradient value at all is vertical.

How do you work it out, step by step?

  1. Label the points. Call one (x₁, y₁) and the other (x₂, y₂). It does not matter which is which.
  2. Subtract the y-values in that order to get the rise.
  3. Subtract the x-values in the same order to get the run.
  4. Divide rise by run and simplify the fraction.
  5. Sense-check the sign by sketching both points: does the line go up or down as you move right?

Worked example

Find the gradient of the line through P(−3, 4) and Q(5, −8).

Step 1, label: (x₁, y₁) = (−3, 4) and (x₂, y₂) = (5, −8).

Step 2, rise: y₂ − y₁ = −8 − 4 = −12.

Step 3, run: x₂ − x₁ = 5 − (−3) = 5 + 3 = 8.

Step 4, divide: m = −12/8 = −3/2.

Step 5, sense-check: P is on the left and high up, Q is on the right and low down. The line falls as you move right, so a negative gradient is correct.

Independent check: swap the labels. Then the rise is 4 − (−8) = 12 and the run is −3 − 5 = −8, giving 12/(−8) = −3/2. Same answer.

The mistake to watch for

The usual slip is handling the minus signs badly in the run.

Mistaken working: run = 5 − 3 = 2, so m = −12/2 = −6.

The student dropped the negative sign of the x-value −3 and wrote 3 instead.

Subtracting a negative means adding: 5 − (−3) = 8, not 2. Put brackets round every negative coordinate before you subtract, and the slip disappears. The sketch also helps, because a gradient of −6 would be far steeper than the picture shows.

A second slip is mixing the order, for example −8 − 4 on top but 3 − 5 on the bottom. Keep both subtractions in the same direction.

Check yourself

Try these without a calculator, then open each answer.

1. Find the gradient through (1, 2) and (4, 11).

Show answer

Rise = 11 − 2 = 9. Run = 4 − 1 = 3. Gradient = 9/3 = 3.

2. Find the gradient through (−2, 5) and (6, 1).

Show answer

Rise = 1 − 5 = −4. Run = 6 − (−2) = 8. Gradient = −4/8 = −1/2.

3. What happens when you try to find the gradient through (3, −1) and (3, 7)?

Show answer

Run = 3 − 3 = 0, so you would divide by 0. The gradient is undefined: the line is vertical, with equation x = 3.

Where this leads next

Once gradients feel secure, move on to finding a midpoint and a segment length, then use a gradient to write the equation of a line. The non-calculator working trainer is handy for practising fraction simplification without a calculator, and the coordinate geometry practice set mixes all the skills together.

Some students understand the formula but still lose marks on signs once the coordinates turn negative. That is the kind of pattern our teachers look for in online one-to-one Mathematics tuition.

Questions people ask

Does it matter which point I call point 1?

No, as long as you stay consistent. Subtract the y-values and the x-values in the same order. If you take y2 minus y1 on top, you must take x2 minus x1 on the bottom. Swapping both gives the same gradient, but swapping only one flips the sign.

What is the gradient of a vertical line?

It is undefined. Both points have the same x-value, so the bottom of the fraction is 0, and you cannot divide by 0. A vertical line has an equation like x = 3, not y = mx + c.

Should I leave a gradient as a fraction or a decimal?

Leave it as a fraction in lowest terms unless the question asks for a decimal. A gradient such as −3/2 is exact, and so is −1.5. A gradient like 4/3 should stay a fraction, because 1.33 is only an approximation.

Updated:

Your next step

If gradient questions go well on graphs but fall apart with negative coordinates, a one-to-one teacher can watch your subtraction step by step and fix the exact habit that flips the sign.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service