Equation of a Straight Line (AA HL)
Every straight line can be written three different ways, and choosing the right one for the information you're given saves a lot of algebra. This page focuses on those three forms and on building an equation from two points or from a gradient and a point, as one narrow slice of the wider Straight Lines topic.
17 questions on this sub-topic.
The three forms
Covered under IB syllabus reference SL2.1: the gradient-intercept, general, and point-gradient forms of a line, plus gradient and intercepts. None of these are printed in the formula booklet - they're treated as prior knowledge.
Gradient-intercept form
\[y=mx+c\]
Best when you know (or want) the gradient \(m\) and the \(y\)-intercept \(c\) directly.
General form
\[ax+by+d=0\]
Whole-number coefficients; rearrange to \(y=mx+c\) to read off the gradient \(-\tfrac{a}{b}\).
Point-gradient form
\[y-y_1=m(x-x_1)\]
The fastest route from "a gradient and a point" to a full equation - expand and simplify from there.
Need the full syllabus wording and formula-booklet reference table? See Straight Lines.
Worked examples
Find the equation of the line through \((1,4)\) and \((3,10).\)
(a)(i) State the gradient.
(a)(ii) State the y-intercept.
Worked solution
(a)(i) \(m=\dfrac{10-4}{3-1}\) M1
\(=3.\) A1
(a)(ii) \(y-4=3(x-1)\Rightarrow y\) M1
\(=3x+1.\) A1
Find the equation of the line through \((4,1)\) parallel to the segment joining \((0,0)\) and \((2,3).\)
(a)(i) State the gradient.
(a)(ii) State the y-intercept.
Worked solution
(a)(i) Gradient of segment \(=\tfrac{3}{2}.\) M1 A1
(a)(ii) \(y-1=\tfrac32(x-4)\Rightarrow y\) M1
\(=\tfrac32x-5.\) A1
Find the equation of the line parallel to \(y=3x+1\) passing through \((0,4).\)
(a)(i) State the gradient.
(a)(ii) State the y-intercept.
Worked solution
(a)(i) Parallel lines have equal gradient \(m=3.\) M1
(a)(ii) Through \((0,4)\): \(c=4.\) A1
\(y=3x+4.\) A1
Find the equation of the line perpendicular to \(3x-y=2\) passing through \((6,1).\)
(a)(i) State the gradient.
(a)(ii) State the y-intercept.
Worked solution
(a)(i) Gradient of \(3x-y=2\) is \(3.\) Perpendicular gradient \(=-\tfrac13.\) M1A1
(a)(ii) \(y-1=-\tfrac13(x-6)\Rightarrow y\) M1
\(=-\tfrac13x+3.\) A1
Common mistakes
- Sign errors rearranging general form. Dividing \(ax+by+d=0\) through by \(b\) to reach \(y=mx+c\) is a common place to lose a minus sign, especially when \(b\) itself is negative.
- Substituting the wrong point into point-gradient form. \(y-y_1=m(x-x_1)\) works with either given point, but mixing coordinates from two different points in the same substitution gives a completely wrong line.
- Stopping before rearranging into \(y=mx+c\). A question that asks for the equation "in the form \(y=mx+c\)" wants the final expanded and simplified line, not the point-gradient form left half-finished.
Ready to practise properly?
17 equation-of-a-line questions, marked instantly like the real exam.
Quick answers
How do I find the equation of a line through two points?
First find the gradient \(m=\dfrac{y_2-y_1}{x_2-x_1}\), then substitute that gradient and either point into \(y-y_1=m(x-x_1)\) and rearrange into \(y=mx+c\).
What's the difference between gradient-intercept and general form?
Gradient-intercept form, \(y=mx+c\), shows the gradient and \(y\)-intercept directly. General form, \(ax+by+d=0\), uses whole-number coefficients and needs rearranging (gradient \(=-\tfrac{a}{b}\)) before either feature is visible. A GDC can also confirm a gradient graphically - see Straight Lines.