Skip to the formula

Gradient formula: m = (y₂ − y₁) / (x₂ − x₁)

The gradient formula is gradient m = (y₂ − y₁) / (x₂ − x₁).

What each letter means

When to use it

In IB Maths, for the gradient between two data points, for perpendicular lines and the perpendicular bisectors in AI's Voronoi diagrams, and as the average rate of change before the derivative in AA.

Worked example

Find the gradient of the line through \((-1,4)\) and \((3,-8)\), and the gradient of a line perpendicular to it.

  1. \(m=\dfrac{-8-4}{3-(-1)}=\dfrac{-12}{4}\)
  2. Perpendicular gradient \(=-\dfrac{1}{m}\)

Answer: \(m=-3\); perpendicular gradient \(\tfrac13\)

Common mistake

Leaving out the units in context. A gradient of 2.5 between (2, 10) and (6, 20) on a graph of cost in dollars against hours means 2.5 dollars per hour: say so.

Fix it with practice: Skill Builder: Coordinate Geometry (free account).

Try one yourself

One quick IB Maths question on the gradient formula. No sign-in needed.

Find the gradient of the line through \((-2, 7)\) and \((4, -5)\).
Choose your answer · keys 1–4

On your IB Maths course

CourseIn the exam
AA SL
All IB AA SL formulas by topic
In the IB formula booklet
AI SL
All IB AI SL formulas by topic
In the IB formula booklet
AA HL
All IB AA HL formulas by topic
In the IB formula booklet
AI HL
All IB AI HL formulas by topic
In the IB formula booklet

From our own IB Maths formula sheets, in our words. The IB gives its booklet to schools, so we checked against our own copy: your teacher has the official one. Official: IB DP Mathematics page.

Practise and revise

Gradient formula formula card: gradient m = (y₂ − y₁) / (x₂ − x₁). IB Math Revision
Gradient formula card for IB Maths: download (PNG).

IB Maths FAQ

Is the gradient formula in the IB formula booklet?

AA SL: in the IB formula booklet. AI SL: in the IB formula booklet. AA HL: in the IB formula booklet. AI HL: in the IB formula booklet.

How is the gradient formula linked to the derivative?

The gradient between two points on a curve is the average rate of change. As the second point moves towards the first, it tends to the gradient of the tangent, which is the derivative.

Our own wording, examples and card, checked by IB Math Revision. Not produced or endorsed by the International Baccalaureate Organization.