Finding the Equation of a Line Through Two Points
Find the equation of a straight line from its gradient and one point on it, or from two points on it; check it with the other point; decide whether a point lies on a line; and find where a line meets the axes.
Before you start
- In lesson 4.3 you wrote from the gradient and the -intercept , reading where the line cuts the -axis at . In lesson 4.1 you found the gradient of the line through and as
- In Secondary 2 you used a point on a line to find an unknown number in its equation: the coordinates of a point on the line make the equation true. For example, if the line passes through , then , so and .
- In this lesson the unknown number is , and the point is usually not on the -axis.
A Gradient and One Point
Through a given point there is exactly one line with a given gradient. So a gradient and one point fix a line that is not vertical, and we can find its equation even when the point is not on the -axis.
Every point on the line satisfies the equation . Put in the gradient for and the coordinates of the point for and : the only unknown left is , and a simple equation gives it.
The equation from a gradient and a point
1. Write with the given gradient in place of .
2. Substitute the coordinates of the given point: its -coordinate for and its -coordinate for . Solve the equation for .
3. Write the equation with both numbers in place.
Example 1: A whole-number gradient
Find the equation of the straight line with gradient that passes through the point .
Solution
The gradient is , so the equation is for some number .
The point is on the line, so and satisfy the equation: .
, so .
The equation is . The line cuts the -axis at : from there a step of across and up reaches , and , the given gradient.
The equation of the line is .
Example 2: A fractional gradient
Find the equation of the straight line with gradient that passes through the point .
Solution
The equation is .
Substitute and :
Subtract from both sides. Write as :
So .
Keep the fractions exact. Do not write as : that line would miss by a little. If you prefer an equation without fractions, multiply every term by : . It is the same line.
Check: at , and .
The equation of the line is (or ).
A Line Through Two Points
Two points also fix a line. First find its gradient from the two points, as in lesson 4.1. Then you have a gradient and a point, and is found as before, with either of the two points.
Finish by checking with the other point. The point you used for can only check your arithmetic for : it fits whenever was worked out correctly, even if the gradient is wrong. The other point checks the gradient as well as .
The equation of the line through two points
1. Find the gradient:
2. Substitute and the coordinates of one of the points into , and solve for .
3. Write .
4. Check with the other point: its coordinates must satisfy the equation.
Example 3: Two points
Find the equation of the straight line through the points and .
Solution
Step 1:
Step 2: use : , so and .
Step 3: .
Step 4: check with :
The equation of the line is .
Example 4: Negative coordinates and fractions
Find the equation of the straight line through and .
Solution
Step 1: take as and as :
Step 2: use : , so .
Add to both sides:
Step 3:
Step 4: check with :
Using in Step 2 gives the same : so
Multiplying every term by gives , which is : the same line, and easier to check. At :
The equation of the line is (or ).
This is also the way to find the equation of a drawn line whose -intercept cannot be read exactly: read two points where the line passes exactly through corners of the grid, and work from their coordinates.
Example 5: When the y-intercept cannot be read
The straight line drawn below passes through and . Find its equation.
Solution
The line cuts the -axis between and , so cannot be read from the graph. Use the two points.
Step 1:
Step 2: use : so .
Step 3: .
Step 4: check with :
The -intercept is , between and , as the graph shows.
The equation of the line is (or ).
Does a Point Lie on the Line?
The equation of a line is a rule that the coordinates of every point on it obey, and that the coordinates of no other point obey. So to test a point, substitute its -coordinate into the equation and compare the result with its -coordinate.
A point on a line
A point lies on a line when its coordinates satisfy the equation of the line. If they do not, the point is not on the line.
For the line : the point is on it, since ; the point is not, since .
Example 6: Testing points
The line passes through and . (a) Find the equation of . (b) Determine whether the points and lie on . (c) The point lies on . Find the value of .
Solution
(a) Use : , so . The equation is . Check with :
(b) : which is the -coordinate of . So lies on .
: but the -coordinate of is . Since , does not lie on : it is unit above the line.
(c) is on , so its coordinates satisfy : .
Add to both sides: , so . Check: .
(a) (b) lies on ; does not. (c)
This gives a second test for collinear points (points on one straight line), besides comparing gradients as in lesson 4.1: find the equation of the line through two of the points, then see whether the third point satisfies it. In Example 6, , and are collinear, and , and are not.
Where a Line Meets the Axes
Every point on the -axis has -coordinate , and every point on the -axis has -coordinate . So, as in Secondary 2, put to find where a line meets the -axis, and to find where it meets the -axis.
For a line written as , putting gives at once: the line cuts the -axis at , and its -intercept is . The -axis needs a short equation.
Example 7: Meeting the axes
The line through and meets the -axis at and the -axis at . Find the equation of the line and the coordinates of and .
Solution
Use : so . The equation is .
Check with :
is on the -axis: put . , so is .
is on the -axis: put . , so .
Multiply both sides by : , so . is .
The equation is ; is and is .
Common Mistakes
- Taking from the given point. The line with gradient through is not : is the -coordinate only of the point on the -axis. Substitute and solve.
- Putting the coordinates in the wrong places. For the point , and : write , not .
- Checking only with the point used to find . It can only check your arithmetic for , not the gradient. Check with the other point.
- Losing a sign: . Put negative coordinates in brackets when you substitute them.
- Rounding a fraction to a decimal, such as to . The equation is then a slightly different line. Keep fractions exact, or multiply every term by the denominator.
- Mixing up the axes. Where a line meets the -axis, , so the point is , not .
Practice Questions
Work each question on paper before you open its solution. Give each equation in the form (in a real setting, with the setting's own letters), and check it. The questions get harder as you go.
Question 1
Find the equation of the straight line with (a) gradient , through , (b) gradient , through , (c) gradient , through .
ShowHide solution
(a) , so : .
(b) so : .
(c) so : .
(a) (b) (c)
Question 2
Find the equation of the straight line with gradient that passes through .
ShowHide solution
So . Multiplying every term by : .
Check at : and .
(or )
Question 3
Find the equation of the straight line through each pair of points. (a) and (b) and (c) and
ShowHide solution
(a) , so : . Check with : .
(b) , so : . Check with : .
(c) so : . Check with : .
(a) (b) (c)
Question 4
Find the equation of the straight line through and .
ShowHide solution
Use : so
, or .
Check with :
(or )
Question 5
Hui Min finds the equation of the line through and . She works out correctly, then writes , so and . Explain her mistake, find the correct equation, and use the point to show which equation is right.
ShowHide solution
She put the -coordinate in place of and the -coordinate in place of . For , and .
Correctly: , so and .
At : , which fits; which does not.
She swapped and when she substituted. The equation is : satisfies it and does not satisfy .
Question 6
The line passes through and . (a) Find the equation of . (b) Determine whether the points and lie on . (c) The point lies on . Find the value of .
ShowHide solution
(a) Use : , so : . Check with : .
(b) : , so it lies on . : so it does not.
(c) , so and . Check: .
(a) (b) lies on ; does not. (c)
Question 7
The line through and meets the -axis at and the -axis at . Find the equation of the line and the coordinates of and .
ShowHide solution
Use : so : .
Check with : .
: put , so : .
: put , so , and : .
; ,
Question 8
Find the equation of the line through and . Hence show that , and are collinear.
ShowHide solution
Use : so : .
Check with : .
: so lies on the line through and .
The line is , and satisfies it, so , and lie on one straight line.
Question 9
A map is drawn with axes in kilometres, and a river runs along the -axis. A straight road passes the bus interchange at and the sports hall at . (a) Find the equation of the road. (b) Does the road pass the library at ? (c) Where does the road cross the river?
ShowHide solution
(a) Use : so
. Check with :
(b) At : So is on the road.
(c) The river is the -axis, : .
(a) (b) Yes, the road passes the library. (c) At .
Question 10
At a bicycle rental kiosk, the cost of hiring a bicycle is dollars for hours, and the graph of against is a straight line. Hiring for hours costs $ and hiring for hours costs $. (a) Find the gradient of the line, with its unit, and say what it means. (b) Find an equation connecting and . (c) What is the value of when , and what does it mean? (d) Find the cost of hiring for hours.
ShowHide solution
(a) The points are and . Gradient dollars per hour: each extra hour costs $.
(b) for some number . Use : , so : . Check with : .
(c) When , : a fixed charge of $ on top of the hourly charge.
(d) .
(a) dollars per hour: $ for each hour. (b) (c) : a fixed charge of $. (d) $
Question 11
A car uses petrol at a steady rate. After it has travelled km, there are litres of petrol in its tank; after km, there are litres. The volume litres left after km lies on a straight line. (a) Find an equation connecting and . (b) How much petrol was in the tank at the start? (c) How far can the car travel, from the start, before the tank is empty?
ShowHide solution
(a) The points are and . Gradient litres per km.
for some number . Use : so : . Check with : .
(b) At the start , so .
(c) Empty: , so , and .
(a) (b) litres (c) km
Key Points
- A gradient and one point: write with the gradient, substitute the coordinates of the point, and solve for .
- Two points: find find with either point, then check with the other point.
- A point lies on a line when its coordinates satisfy the equation of the line.
- A line meets the -axis where (at for ) and the -axis where .
- Keep fractions exact; to remove them, multiply every term by the denominator.