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

To write the equation of a line from its gradient and one point, or from two points (find the gradient first). Use y − y₁ = m(x − x₁) when the point is not on the y-axis.

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

Sign slips with a negative coordinate: through (−3, 4) the equation is y − 4 = m(x + 3), not m(x − 3).

On your course

CourseIn the exam
AA SLIn the IB formula booklet
AI SLIn the IB formula booklet
AA HLIn the IB formula booklet
AI HLIn 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 formula card. Download the card (PNG) to save or print it.

Questions

What is the equation of a straight line formula?

The equation of a straight line is y = mx + c, or y − y₁ = m(x − x₁) through the point (x₁, y₁). m: the gradient (slope); c: the y-intercept: where the line crosses the y-axis; (x₁, y₁): a point on the line.

Is the equation of a straight line given in the exam?

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. This comes from our own IB Maths formula sheets; your teacher has the official booklet.

How do I find the equation of a line through two points?

Find the gradient m = (y₂ − y₁) ÷ (x₂ − x₁), then put m and either point into y − y₁ = m(x − x₁) and rearrange.

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