# The Equation of a Straight Line – A Level Maths Revision

Plot your path to success in A Level Maths with a little help from Beyond Revision and supportive posts like this one on the equation of a straight line.

To make this post even more pleasurable than it already (undoubtedly) is, feel free to use these jump links for easy navigation:

### Contents

There is no new content on the equations of straight lines at A Level, but you will have to be able to apply what you know quickly and confidently alongside new topics. If you’d like to see the following content in PDF or presentable formats, alongside a wider range of questions and answers, click here.

To check your prior knowledge with some multiple-choice questions, click here. If you think you’ve got a good grip of the equations of straight lines, as well as quadratic graphs and the equations of circles, try these Coordinate Geometry Exam Style Questions.

### Getting Started

Any straight line can be written in the form: $y = mx + c$

where m is the gradient and c is the y-intercept. Writing the equation in this form allows the line to be easily plotted, either using a table of values or the y-intercept and gradient.

The equation of a straight line can also be written in the forms: $ax + by = c$

or: $ax + by + c = 0$

These are seen more commonly when solving simultaneous equations. This form can be neater than y = mx + c as you can often manipulate the equation so that a, b and c are integers. However, the gradient and y-intercept are not easily visible.

It is important to be able to efficiently work with straight lines and line segments as they are often part of a larger problem. As well as finding the equation of a straight line in both formats (you may be told in a question which format to use), you need to be able to find the length of a line segment.

Consider the line segment below, passing through the points (x1, y1) and (x2, y2):

The line segment, along with the base x2x1 and height y2y1, form a right-angled triangle. Using Pythagoras’ theorem, you can find the length of the line segment: $length = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}$

### The Equation of a Straight Line Example Questions

#### Example Question 1

Consider the points A(-2, 1) and B(3, -3). Find the exact distance between A and B.

Say (x1, y1) = (-2, 1) and (x2, y2) = (3, -3): \begin{aligned} AB &= \sqrt{(3--2)^2+(-3-1)^2} \\ &= \sqrt{(5)^2+(-4)^2} \\ &=\sqrt{25 + 16} \\ &= \sqrt{41} \end{aligned}

The exact distance between A and B is $\sqrt{41}$.

You also need to be able to find the gradient of a line. Consider the line segment again. It passes through two points (x1, y1) and (x2, y2).

To find the gradient of this line segment, divide the change in y by the change in x, using this formula: $m = \frac{y_2\,-\,y_1}{x_2\,-\,x_1}$

#### Example Question 2

Find the equation of the line which passes through the points (-2, 3) and (7, -3).

Define (x1, y1) as (-2, 3) and (x2, y2) as (7, -3), then find the gradient: \begin{aligned} m &= \frac{y_2\,-\,y_1}{x_2\,-\,x_1} \\ &= \frac{-3\,-\,3}{7\,-\,-2} \\ &= \frac{-6}{9} \\ &= -\frac{2}{3} \end{aligned}

Once you have the gradient, you can choose a pair of coordinates to find the equation of the straight line. In this case, you can use either (-2, 3) or (7, -3). You know the equation of a straight line can take the form y = mx + c. You can therefore substitute the values of x, y and m to find the y-intercept, c: $y = mx+c$ $3 = -\frac{2}{3} \times -2 + c$ $c = 3 - \frac{4}{3}$ $c = \frac{5}{3}$

This gives an equation of: $y = -\frac{2}{3}x + \frac{5}{3}$

or: $2x + 3y = 5$

Alternatively, consider the formula for the gradient: $m = \frac{y_2\,-\,y_1}{x_2\,-\,x_1}$

Rearrange, replacing x2 and y2 with x and y: $y - y_1 = m(x-x_1)$

Now, you can substitute the gradient, m, of a line that passes through a point (x1, y1) to get the equation of the line.

#### Example Question 3

Find the x– and y-intercepts of the line with gradient 5 that passes through the point (1, -4).

Start by finding the equation of the line. The gradient is an integer, so write it in the form y = mx + c. $y - y_1 = m(x - x_1)$ $y --4 = 5(x-1)$ $y + 4 = 5x - 5$ $y = 5x - 9$

With the equation in this form, it is easy to see the y-intercept as -9. To find the x-intercept, consider the case where y = 0: $0 = 5x - 9$ $5x = 9$ $x = \frac{9}{5}$

You will often be asked to use the properties of parallel and perpendicular lines.

Two lines are parallel if their gradients are equal. The two lines in the diagram are parallel – they will never meet. This can only happen if they have the same gradient: if one is steeper than the other then they will eventually meet.

Two lines are perpendicular if their gradients multiply to give -1. Consider the lines in the diagram below. You can see the two triangles are congruent and therefore have the same lengths.

You can find the gradient for each of the lines:

For line 1: $m = \frac{-b}{a}$

For line 2: $m = \frac{a}{b}$

If you multiply these two gradients, you get: $\frac{-b}{a} \times \frac{a}{b} = \frac{-ab}{ab} = -1$

This also means that, to find the gradient (mp) of the line perpendicular to the line y = mx + c, you take the negative reciprocal: $m_p = -\frac{1}{m}$

#### Example Question 4

Find the equation of the line, l1, that passes through the origin and is parallel to 3x + 2y – 4 = 0
Give your answer in the form ax + by + c = 0 where a, b and c are integers.

Start by finding the gradient of 3x + 2y – 4 = 0. To do this, rewrite it in the form
y = mx + c: $3x + 2y - 4 = 0$ $2y = -3x - 4$ $y = -\frac{3}{2}x + 2$

From this, you can see that m = $- \frac{3}{2}$. As the two lines are parallel, the gradient of l1 will be the same. The question also states that the line passes through the origin: the point (0, 0). This is enough information to write the equation of l1 in the required form: $y - y_1 = m(x - x_1)$ $y - 0 = -\frac{3}{2}(x - 0)$ $2y = -3x$ $3x + 2y = 0$

#### Example Question 5

The points (2, -7) and (4, -2) are labelled A and B respectively. Find the equation of the perpendicular bisector of AB, giving your answer in the form ax + by + c = 0 where a, b and c are integers.

To be able to find the equation of a line, you need the gradient and a point that it passes through. You can find both of these, given that the line is a perpendicular bisector of AB. This means it passes through the midpoint of AB at a right angle. Start by finding the midpoint of AB: $\text{midpoint} = (\frac{2\,+\,4}{2},\frac{-7\,+\,-2}{2}) = (3, -\frac{9}{2})$

Now, find the gradient of AB: \begin{aligned}\text{gradient} &= \frac{y_2\,-\,y_1}{x_2\,-\,x_1} \\\ &= \frac{-2\,-\,-7}{4\,-\,2}\\\ &= \frac{5}{2} \end{aligned}

The gradient of the perpendicular bisector will be the negative reciprocal of this: $m = -\frac{2}{5}$

You now have all the information you need to find the equation of the line: $y - y_1 = m(x - x_1)$ $y - -\frac{9}{2} = -\frac{2}{5}(x - 3)$ $5(y + \frac{9}{2}) = -2(x - 3)$ $5y + \frac{45}{2} = -2x + 6$ $10y + 45 = -4x + 12$ $4x + 10y + 33 = 0$

### Practice Questions

1. Find the distance between point A(-4, 2) and the origin.

2. Consider the points P(2, 3), Q(5, 1) and R(-1, 1). By considering the lengths PQ, QR and PR, show that triangle PQR is isosceles.

3. Find the gradient of the line through points (2, 9) and (-2, 7).

4. Find the equation of the line with gradient 7 through the point (3, 4), giving your answer in the form y = mx + c.

5. Find the equation of the line that goes through the points (3, -2) and (6, -1), giving your answer in the form ax + by + c = 0 where a, b and c are integers.

1. $\sqrt{(-4)^2 + 2^2} = \sqrt{20} = 2\sqrt{5}$

2. $\text{PQ} = \sqrt{(5-2)^2 + (1-3)^2} = \sqrt{13}$ $\text{QR} = \sqrt{(-1-5)^2+(1-1)^2} = 6$ $\text{PR} = \sqrt{(-1 -2)^2 + (1-3)^2} = \sqrt{13}$

3. $m = \frac{9\,-\,7}{2\,-\,-2} = \frac{2}{4} = \frac{1}{2}$

4. $y = mx + c$ $4 = 7 \times 3 + c$ $c = 4 - 21 = -17$ $y = 7x - 17$

5. $m =\frac{-1\,-\,-2}{6\,-\,3} = \frac{1}{3}$ $y - y_1 = m(x - x_1)$ $y --2 = \frac{1}{3}(x-3)$ $3y + 6 = x - 3$ $x - 3y - 9 = 0$

The equation of a straight line is not where the fun ends and you can read even more of our blogs here! You can also subscribe to Beyond for access to thousands of secondary teaching resources. You can sign up for a free account here and take a look around at our free resources before you subscribe too.