Skip to the formula

Equation of a straight line: y = mx + c

The equation of a straight line is y = mx + c, or y − y₁ = m(x − x₁) through the point (x₁, y₁).

What each letter means

When to use it

In IB Maths, for tangents and normals in AA, for perpendicular bisectors in AI's Voronoi diagrams, and in the form ax + by + d = 0. A line fitted to data in AI is a linear model: read m as a rate in context.

Worked example

Find the equation of the line through \((2,-1)\) and \((5,8)\) in the form \(y=mx+c\).

  1. \(m=\dfrac{8-(-1)}{5-2}=\dfrac{9}{3}=3\)
  2. \(y-(-1)=3(x-2)\), so \(y+1=3x-6\)

Answer: \(y=3x-7\)

Common mistake

Using the original gradient for a perpendicular bisector in a Voronoi question. Its gradient is −1/m, through the midpoint of the two sites.

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

Try one yourself

One quick IB Maths question on the equation of a straight line. No sign-in needed.

A line has gradient \(3\) and passes through \((2, 5)\). Find its \(y\)-intercept.
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

Equation of a straight line formula card: y = mx + c, or y − y₁ = m(x − x₁) through the point (x₁, y₁). IB Math Revision
Equation of a straight line card for IB Maths: download (PNG).

IB Maths FAQ

Is the equation of a straight line 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.

What do m and c mean in a linear model?

m is the change in y for each increase of 1 in x, with units, and c is the value of y when x = 0, which may mean nothing if x = 0 is outside the data.

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