How to find the gradient of a line from two points

The gradient of a straight line tells you how much y changes for each unit increase in x. Two distinct points on the line are enough to calculate it, provided the line is not vertical. Most mistakes come from mixing the coordinate order or dropping a minus sign during subtraction.

Keep the coordinates in pairs

Write the points as A = (x₁, y₁) and B = (x₂, y₂). In each pair, x is the horizontal coordinate and y is the vertical coordinate. For A = (−2, 7) and B = (4, −5), record x₁ = −2, y₁ = 7, x₂ = 4 and y₂ = −5 before calculating.

The gradient is m = (y₂ − y₁)/(x₂ − x₁). The numerator is the change in y, often called rise. The denominator is the change in x, or run. Use the same journey in both: if the numerator goes from A to B, the denominator must also go from A to B.

Subtract with brackets around negative coordinates

For A = (−2, 7) and B = (4, −5), the change in y is −5 − 7 = −12. The change in x is 4 − (−2) = 6. Divide to get m = −12/6 = −2.

This means that each time x increases by 1, y decreases by 2. Moving from x = −2 to x = 4 increases x by 6, so a total decrease of 12 in y is consistent with the gradient.

You can reverse both subtractions. Starting at B gives 7 − (−5) = 12 and −2 − 4 = −6, so m = 12/(−6) = −2 again. Reversing only one subtraction would give positive 2, which describes a different direction.

Check the direction and keep exact fractions

On ordinary Cartesian axes, a line that rises as you move right has a positive gradient. A line that falls as you move right has a negative gradient. Make a rough sketch of the two points before accepting a sign that conflicts with their positions.

For points (1, 2) and (5, 5), the change in y is 3 and the change in x is 4. The gradient is 3/4. This says y increases by 3 for every increase of 4 in x, or by 0.75 for every increase of 1.

Keep a fraction such as 2/3 exact unless the question asks for a decimal or a stated precision. Do not turn it into 0.67 halfway through a calculation and then treat that rounded value as exact.

Separate horizontal, vertical and repeated points

For (−3, 4) and (5, 4), y does not change. The gradient is (4 − 4)/(5 − (−3)) = 0/8 = 0. A horizontal line has zero gradient because y stays constant while x changes.

For (2, −1) and (2, 6), x does not change. The calculation would require 7/0, which is undefined. This is the vertical line x = 2. Its gradient is undefined, not zero. Division by zero cannot produce an ordinary numerical gradient.

If the two supplied points are identical, both differences are zero. One point alone cannot determine a unique line: many different lines pass through it. Check that you copied two distinct points before using the formula.

Use axis values rather than counting squares alone

When the points come from a graph, read their coordinates from the numbered scales. A vertical square might represent 5 units while a horizontal square represents 2 units. Counting squares without converting them to axis values would give the wrong gradient.

For a straight line, choose two clearly readable points that are reasonably far apart. If the question asks for the gradient of a straight line of best fit, use points on that drawn line; individual data points may sit above or below it.

For measured quantities, carry the units through the division. If the vertical axis is distance in metres and the horizontal axis is time in seconds, the gradient has units of metres per second. Two points on a curved graph give the average rate between those points; they do not automatically give the gradient at a single point.

Check by rebuilding the line

A nonvertical straight line can be written as y = mx + c. Use one point and your calculated m to find c, then check the other point. For m = −2 and A = (−2, 7), substitute to get 7 = (−2)(−2) + c, so c = 3. The line is y = −2x + 3.

At B = (4, −5), the equation gives y = −2(4) + 3 = −5, matching the supplied coordinate. If the second point fails this check, return to the coordinate labels and subtractions.

Copy this working record: point A; point B; change in y with brackets; change in x with brackets; quotient simplified; sign checked against a sketch; units where relevant; second-point check.

Try a pair before reading the answer

Find the gradient through (−4, −3) and (2, 6). The change in y is 6 − (−3) = 9. The change in x is 2 − (−4) = 6. Therefore m = 9/6 = 3/2. Both coordinates increase when moving between these points, so the positive sign makes sense.

As a final check, y = (3/2)x + c and the point (2, 6) give 6 = 3 + c, so c = 3. At x = −4, this equation gives y = −6 + 3 = −3. Both points lie on the reconstructed line.

Keep your plan, progress and deadlines in one place.Open Vithi