The two point formula for the equation of a straight line involves calculating the equation of the line passing through two given points.

We know the gradient of any line is given by the formula –

m =

where (x_{1}, y_{1}) and (x_{2}, y_{2}) are the two given points.

We also know that the point gradient formula is –

y – y_{1} = m(x – x_{1}).

Substituting the formula for m in the above equation, we get

y – y_{1} = (x – x_{1})

So the equation of a straight line passing through two points (x_{1}, y_{1}) and (x_{2}, y_{2}) is –

=

**Note**: There are two alternate methods to find the equation of the straight line. Both involve first finding the gradient or slope of the line separately using the two points, and then

- use the point gradient formula to obtain the equation of the straight line.
- Alternatively, you can also use the gradient intercept form (by substituting one of the points) to get the equation of the straight line.

**Example 1**: Find the equation of the straight line passing through (-1, 2) and (3, 8).

The equation of a line passing through two points is given by –

y – y_{1} = (x – x_{1})

y – 2 = (x – (-1))

y – 2 = (x + 1)

4(y – 2) = 6(x + 1)

6x + 6 – 4y + 8 = 0

6x – 4y + 14 = 0 is the equation of the straight line.

**Example 2**: Find the equation of the straight line passing through A (-1, 3) and B (2, 6); and hence show that lies on the straight line.

The equation of a line passing through two points is given by –

y – y_{1} = (x – x_{1})

A (-1, 3), so x_{1} = -1 and y_{1} = 3

B (2, 6), so x_{2} = 2 and y_{2} = 6

So the equation of the line is –

y – 3 = (x – (-1))

y – 3 = (x + 1)

y – 3 = 1(x + 1)

y – 3 = x + 1

y = x + 4

Now to check lies on y = x + 4, we substitute the value of x in the equation –

y = + 4 =

This is the y coordinate of

Hence the point lies on the line y = x + 4.

Here are some more examples of two point formula for the equation of a straight line.