Equation of a Straight Line (AA HL)

A straight line has equation y=mx+cy=mx+c (gradient-intercept form), y−y1=m(x−x1)y-y_1=m(x-x_1) (point-gradient form) or ax+by+d=0ax+by+d=0 (general form). To build an equation, find the gradient from two points or use the one given, substitute a point into the point-gradient form, then rearrange into the form the question asks for. It's part of the broader Straight Lines topic.

18 questions on this sub-topic.

Syllabus

CodeSyllabus content
SL2.1Different forms of the equation of a straight line: y=mx+cy=mx+c (gradient-intercept form), ax+by+d=0ax+by+d=0 (general form), and y−y1=m(x−x1)y-y_1=m(x-x_1) (point-gradient form). Gradient and intercepts. Parallel lines m1=m2m_1=m_2. Perpendicular lines m1m2=−1m_1m_2=-1.

Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).

Skills practised on this page:

The three forms

None of these are printed in the formula booklet - they're treated as prior knowledge.

Gradient-intercept form

y=mx+cy=mx+c

Best when you know (or want) the gradient mm and the yy-intercept cc directly.

General form

ax+by+d=0ax+by+d=0

Whole-number coefficients; rearrange to y=mx+cy=mx+c to read off the gradient −ab-\tfrac{a}{b}.

Point-gradient form

y−y1=m(x−x1)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.

Key terms

What is gradient-intercept form?

The form y=mx+cy=mx+c shows the gradient mm and the yy-intercept (0,c)(0,c) directly.

e.g. y=−2x+5y=-2x+5 has gradient −2-2 and passes through (0,5)(0,5).

What is point-gradient form?

The form y−y1=m(x−x1)y-y_1=m(x-x_1) gives the line with gradient mm through the point (x1,y1)(x_1,y_1), so it is the quickest form to write down.

e.g. Gradient 33 through (2,−1)(2,-1): y+1=3(x−2)y+1=3(x-2), which gives y=3x−7y=3x-7.

What is general form?

General form is ax+by+d=0ax+by+d=0, usually with integer coefficients and all terms on one side.

e.g. y=23x+1y=\dfrac{2}{3}x+1 becomes 3y=2x+33y=2x+3, so 2x−3y+3=02x-3y+3=0.

How do you find the intercepts of a line?

For the yy-intercept set x=0x=0, and for the xx-intercept set y=0y=0.

e.g. For 2x+5y=102x+5y=10, the xx-intercept is (5,0)(5,0) and the yy-intercept is (0,2)(0,2).

Worked examples

1
Medium
No calc
[4 marks]

Find the equation of the line through (1,4)(1,4) and (3,10).(3,10).

(a)(i) State the gradient.

(a)(ii) State the y-intercept.

Worked solution

(a)(i) m=10−43−1m=\dfrac{10-4}{3-1} M1
=3.=3. A1

(a)(ii) y−4=3(x−1)⇒yy-4=3(x-1)\Rightarrow y M1
=3x+1.=3x+1. A1

M1 Gradient A1 m=3m=3 M1 Use a point A1 Equation
2
Hard
No calc
[4 marks]

Find the equation of the line through (4,1)(4,1) parallel to the segment joining (0,0)(0,0) and (2,3).(2,3).

(a)(i) State the gradient.

(a)(ii) State the y-intercept.

Worked solution

(a)(i) Gradient of segment =32.=\tfrac{3}{2}. M1 A1

(a)(ii) y−1=32(x−4)⇒yy-1=\tfrac32(x-4)\Rightarrow y M1
=32x−5.=\tfrac32x-5. A1

M1 Segment gradient A1 m=3/2m=3/2 M1 Point-gradient A1 Equation
3
Easy
No calc
[3 marks]

Find the equation of the line parallel to y=3x+1y=3x+1 passing through (0,4).(0,4).

(a)(i) State the gradient.

(a)(ii) State the y-intercept.

Worked solution

(a)(i) Parallel lines have equal gradient m=3.m=3. M1

(a)(ii) Through (0,4)(0,4): c=4.c=4. A1
y=3x+4.y=3x+4. A1

M1 Same gradient A1 Intercept A1 Equation
4
Medium
No calc
[4 marks]

Find the equation of the line perpendicular to 3x−y=23x-y=2 passing through (6,1).(6,1).

(a)(i) State the gradient.

(a)(ii) State the y-intercept.

Worked solution

(a)(i) Gradient of 3x−y=23x-y=2 is 3.3. Perpendicular gradient =−13.=-\tfrac13. M1A1

(a)(ii) y−1=−13(x−6)⇒yy-1=-\tfrac13(x-6)\Rightarrow y M1
=−13x+3.=-\tfrac13x+3. A1

M1 Negative reciprocal A1 −13-\tfrac13 M1 Point-gradient A1 Equation

Common mistakes

  • Sign errors rearranging general form. Dividing ax+by+d=0ax+by+d=0 through by bb to reach y=mx+cy=mx+c is a common place to lose a minus sign, especially when bb itself is negative.
  • Substituting the wrong point into point-gradient form. y−y1=m(x−x1)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+cy=mx+c. A question that asks for the equation "in the form y=mx+cy=mx+c" wants the final expanded and simplified line, not the point-gradient form left half-finished.

Quick questions

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

First find the gradient m=y2−y1x2−x1m=\dfrac{y_2-y_1}{x_2-x_1}, then substitute that gradient and either point into y−y1=m(x−x1)y-y_1=m(x-x_1) and rearrange into y=mx+cy=mx+c.

What's the difference between gradient-intercept and general form?

Gradient-intercept form, y=mx+cy=mx+c, shows the gradient and yy-intercept directly. General form, ax+by+d=0ax+by+d=0, uses whole-number coefficients and needs rearranging (gradient =−ab=-\tfrac{a}{b}) before either feature is visible. A GDC can also confirm a gradient graphically - see Straight Lines.

Which form should I give my answer in?

Give the form the question asks for. If no form is stated, any correct equation is valid, but y=mx+cy=mx+c is a clear choice. For example, y=2x−3y=2x-3 and 2x−y−3=02x-y-3=0 are the same line.

How do I check whether a point lies on a line?

Substitute its coordinates into the equation and see whether both sides are equal. For y=2x+1y=2x+1, the point (3,7)(3,7) lies on the line since 2⋅3+1=72\cdot3+1=7, but (2,6)(2,6) does not since 2⋅2+1=52\cdot2+1=5.

How do I find the equation of a line from its graph?

Read two clear points, calculate the gradient, and use the yy-intercept or point-gradient form. For points (0,1)(0,1) and (4,9)(4,9), m=9−14−0=2m=\dfrac{9-1}{4-0}=2, so y=2x+1y=2x+1.

Ready to practise properly?

18 equation-of-a-line questions, marked instantly like the real exam.