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
- \(m\) the gradient (slope)
- \(c\) the y-intercept: where the line crosses the y-axis
- \((x_1,\ y_1)\) a point on the line
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\).
- \(m=\dfrac{8-(-1)}{5-2}=\dfrac{9}{3}=3\)
- \(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
| Course | 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 |
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
- Practise AA SL equations of straight lines questions
- Practise AI SL coordinate geometry questions
- Revise Linear functions (AI SL)
- Print AA SL one-page formula sheet
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.