Equation of a straight line

Equation of a straight line

Spec 2.1 · Edexcel International A Level Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • The gradient through two points is m=y2−y1x2−x1m=\dfrac{y_2-y_1}{x_2-x_1}, using the same order top and bottom.
  • A line with gradient mm and yy-intercept cc is y=mx+cy=mx+c.
  • Given a point and a gradient, use y−y1=m(x−x1)y-y_1=m(x-x_1).
  • Given two points, find mm first, then use either point.
  • In the general form ax+by+c=0ax+by+c=0, the gradient is −ab-\dfrac ab.

Gradient and y = mx + c

The gradient is rise over run, and a line with gradient mm and yy-intercept cc has equation y=mx+cy=mx+c.

The gradient between (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) is y2−y1x2−x1\dfrac{y_2-y_1}{x_2-x_1}. Through A(2,5)A(2,5) and B(6,13)B(6,13): m=13−56−2=2m=\dfrac{13-5}{6-2}=2.

A positive gradient rises left to right, a negative one falls, and a horizontal line has m=0m=0. A vertical line has no gradient: write x=kx=k. The yy-intercept is where x=0x=0.

run = 4rise = 8A(2, 5)B(6, 13)
The gradient triangle for A(2,5)A(2,5) and B(6,13)B(6,13): the rise is 8 and the run is 4, so m=2m=2.
−5−4−3−2−112345−8−6−4−22468xyOy = mx + c
Change the gradient and the intercept to see how the line moves.

What is the gradient of the line through (1,7)(1,7) and (4,1)(4,1)?

Point and gradient

With gradient mm through (x1,y1)(x_1,y_1), the equation is y−y1=m(x−x1)y-y_1=m(x-x_1).

This is the quickest route when you are given a point and a gradient. Rearrange to y=mx+cy=mx+c only if the question asks.

−112345−22468xy(2, 3)y − 3 = 2(x − 2)
The line through (2, 3) with gradient 2: y − 3 = 2(x − 2), which is y = 2x − 1.
  • Point (x1,y1)(x_1,y_1) and gradient mmy−y1=m(x−x1)y-y_1=m(x-x_1)

Worked example

Find the equation of the line with gradient 22 through (2,5)(2,5).

Which is the equation of the line with gradient 33 through (−2,4)(-2,4)?

Line through two points

Find m=y2−y1x2−x1m=\dfrac{y_2-y_1}{x_2-x_1}, then use y−y1=m(x−x1)y-y_1=m(x-x_1) with either point.

Equivalently, use the two-point form y−y1y2−y1=x−x1x2−x1\dfrac{y-y_1}{y_2-y_1}=\dfrac{x-x_1}{x_2-x_1}.

Either point gives the same line, so use whichever has simpler numbers.

−4−2246−4−2246xyP(-3, 4)Q(5, -2)y = -¾x + 7/4
The line through P(−3,4)P(-3,4) and Q(5,−2)Q(5,-2).

Worked example

Find the equation of the line through P(−3,4)P(-3,4) and Q(5,−2)Q(5,-2).

The line through (0,3)(0,3) and (4,11)(4,11) has equation:

The form ax + by + c = 0

Clear fractions and move every term to one side, so aa, bb and cc are integers.

Many questions ask for general form with integer aa, bb, cc. Any integer multiple of the equation is also correct.

Rearrange to y=mx+cy=mx+c to read off the gradient: for b≠0b\ne0 it is −ab-\dfrac ab and the yy-intercept is −cb-\dfrac cb.

−2−112345−2−11234xy(0, 2)(3, 0)2x + 3y − 6 = 0
2x + 3y − 6 = 0: gradient −2/3, y-intercept (0, 2) and x-intercept (3, 0).
  • Gradient−ab-\dfrac{a}{b}
  • y-intercept−cb-\dfrac{c}{b}

Worked example

Write y−4=−34(x+3)y-4=-\frac34(x+3) in the form ax+by+c=0ax+by+c=0 with integer coefficients.

What is the gradient of 2x+5y−10=02x+5y-10=0?

Intercepts and midpoints

A line meets the xx-axis where y=0y=0 and the yy-axis where x=0x=0; the midpoint averages the coordinates.

For 3x+4y−7=03x+4y-7=0 the intercepts are (73,0)\left(\frac73,0\right) and (0,74)\left(0,\frac74\right). The triangle they form with the origin has area 12×73×74=4924\frac12\times\frac73\times\frac74=\frac{49}{24}.

The midpoint is often needed to build a line.

−2−11234−2−11234xy(7/3, 0)(0, 7/4)3x + 4y − 7 = 0
The line 3x+4y−7=03x+4y-7=0 and the triangle it makes with the axes (area 4924\frac{49}{24}).
  • Midpoint of (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2)(x1+x22,y1+y22)\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)

What is the midpoint of (2,−3)(2,-3) and (8,5)(8,5)?

Try an exam question

The line ll passes through A(−3,4)A(-3,4) and B(5,−2)B(5,-2). Find an equation for ll in the form ax+by+c=0ax+by+c=0, where aa, bb and cc are integers.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find the gradient of ll.

1 mark, marked against the mark scheme

Revision notes