## Video Lesson: How to Find the Equation of a Line when Given Two Points

**The equation of a straight line can be calculated if two points it passes through are known. The equation can be written in the slope-intercept form, y = m𝑥 + c (sometimes written as y = m𝑥 + b) or the point-slope form, y – y _{1} = m(𝑥 – 𝑥_{1}).**

**Both of these forms can be rearranged to write the equation in the general form, a𝑥 + by = c.**

** ** The point-slope form of the equation of a line is easier to calculate as only the value of the slope (m) is required. This is either given to us or we can calculate it from two points.

The gradient can be easily seen from an equation in point-slope form as it is the number in front of the brackets.

For example, the gradient of is 3.

The slope-intercept form of the line requires both the value of the slope (m) and the y-intercept (c). However it is beneficial in that both of these values can be easily read from the equation. The slope is the coefficient of 𝑥 and the y-intercept is the constant term added to the 𝑥 term.

For example, the gradient of is 5 and the y-intercept is 3.

The slope-intercept form of the line is generally shorter and simpler to write. Since it conveys more information, it is the most common way to write the equation of a straight line.

## How to Find the Equation of a Line from Two Points

**To find the equation of a line given two points:**

- Label one point as (𝑥
_{1}, y_{1}) and the other point as (𝑥_{2}, y_{2}). - Calculate the slope using
*m = (y*._{2}– y_{1}) ÷ (𝑥_{2}– 𝑥_{1}) - Substitute
*m*and either (𝑥_{1}, y_{1}) or (𝑥_{2}, y_{2}) into*y = m𝑥 + c*. - Solve the resulting equation for
*c*. - Write the equation of the line as
*y = m𝑥 + c*using the calculated values of*m*and*c*.

For example, find the slope-intercept form of the equation of the line passing through the two points (5, 2) and (9, 6).

**Step 1. Label one point as (𝑥_{1}, y_{1}) and the other point as (𝑥_{2}, y_{2})**

The values must be labelled in the order: (𝑥_{1}, y_{1}) and (𝑥_{2}, y_{2}).

That is the 𝑥_{1} and y_{1} values are from the first point and the 𝑥_{2} and y_{2} values are from the second point.

Considering the points: (5, 2) and (9, 6), we obtain the following values:

- 𝑥
_{1}= 5 - y
_{1}= 2 - 𝑥
_{2}= 9 - y
_{2}= 6

**Step 2. Calculate the slope using m = (y _{2} – y_{1}) ÷ (𝑥_{2} – 𝑥_{1})**

Substituting the values listed above, we obtain:

This becomes

and so, .

**Step 3. Substitute m and either (𝑥_{1}, y_{1}) or (𝑥_{2}, y_{2}) into y = m𝑥 + c**

Either point can be chosen, so we will use the first point of (5, 2).

Therefore we will substitute:

- 𝑥 = 5
- y = 2
- m = 1

into the equation of a straight line:

Therefore, becomes

**Step 4. Solve the resulting equation for c**

becomes and so, .

**Step 5. Write the equation of the line as y = m𝑥 + c using the calculated values of m and c**

Now we have m = 1 and c = -3.

can be written as .

The equation of the line in slope-intercept form is .

We can write the steps to find the equation of a straight line in simple terms.

**The steps for the equation of a straight line given two points are:**

- Calculate the slope,
*m*. - Substitute
*m*into*y = m𝑥 + c*. - Substitute either coordinate to work out
*c*.

### Examples of Calculating the Slope-Intercept Equation of a Line when Given Two Points

Find the equation of the line between (1, 5) and (2, 8).

Here, 𝑥_{1} = 1, y_{1} = 5 and 𝑥_{2} = 2, y_{2} = 8.

**Step 1. Calculate the slope, m**

The gradient (or slope) of the line is found using the equation:

Therefore .

**Step 2. Substitute m into y = m𝑥 + c**

Now that we know that m = 3,

can be written as .

**Step 3. Substitute either coordinate to work out c**

We can choose either (1, 5) or (2, 8).

In this example, we will choose (2, 8).

Therefore we substitute 𝑥 = 2 and y = 8 into .

Therefore, we obtain .

and so, c = 2.

Having now calculated both *m* and *c*, we can write the equation of the straight line.

becomes .

## Formula for the Slope-Intercept Equation of a Line From Two Points

**Given any two points, (𝑥_{1}, y_{1}) and (𝑥_{2}, y_{2}),**

**the formula for the slope-intercept equation of a straight line is**

*y = m𝑥 + c*, where*m = (y*and_{2}– y_{1}) / (𝑥_{2}– 𝑥_{1})*c = y*_{1}– m𝑥_{1}.Slope-Intercept Equation of a Straight Line

Where: and .

**To use the formula for the equation of a line given two points:**

- Calculate
*m = (y*/._{2}– y_{1}) ÷ (𝑥_{2}– 𝑥_{1}) - Calculate
*c = y*._{1}– m𝑥_{1} - Substitute these values into
*y = m𝑥 + c*

### Examples of using the Formula for the Equation of a Line Given Two Points

Find the equation of the line passing through (3, 4) and (5, 8).

**Step 1. Label the coordinates**

Using the order (𝑥_{1}, y_{1}) and (𝑥_{2}, y_{2}), we have the following:

𝑥_{1} = 3 y_{1} = 4 𝑥_{2} = 5 y_{2} = 8

**Step 2. Calculate the slope (m)**

and so, and therefore .

**Step 3. Calculate the y-intercept (c)**

and so, and therefore .

**Step 4. Form the equation**

becomes .

## Formula for the Point-Slope Equation of a Line Given Two Points

**The formula for the point-slope equation of a straight line when given two points, (𝑥_{1}, y_{1}) and (𝑥_{2}, y_{2})**,

**can be written as**.

*y – y*_{1}= m(𝑥 – 𝑥_{1}), where m = (y_{2}– y_{1}) / (𝑥_{2}– 𝑥_{1})Point-Slope Equation of a line when Given Two Points

The point-slope form of the equation of a line is always written as y – y_{1} = m(𝑥 – 𝑥_{1}).

The point-slope equation is easy to obtain as only the gradient and one point is required. The disadvantage to the point-slope form is that the y-intercept is not obvious until the equation is rearranged.

For example, find the point-slope equation of the line passing through the points (7, 2) and (3, 0).

Therefore: 𝑥_{1} = 7 —- y_{1} = 2 —- 𝑥_{2} = 3 —- y_{2} = 0.

Firstly, the slope (m) is calculated:

Then the values of *m*, y_{1} and 𝑥_{1} are substituted into .

We obtain the point-slope form of the equation as .

**The formula for the equation of a straight line in slope-intercept form can be written as y = [ (y_{2} – y_{1}) / (𝑥_{2} – 𝑥_{1}) ] (𝑥 –𝑥_{1}) + y_{1}. **

## Equation of a Line From Two Points: Calculator

**This calculator calculates the equation of a line from two given points. Simply enter the two coordinates and the calculator will calculate the gradient (m) and y-intercept (c) for any straight line written in slope-intercept form (y = m𝑥 + c).**

To use this calculator, you must have two different coordinates.

Steps for using the calculator:

- Choose one point to be the
*first point*(𝑥_{1}, y_{1}) and the other point to be the*second point*(𝑥_{2}, y_{2}). It does not matter which one is which. - Enter both numbers from the first point (𝑥
_{1}, y_{1}) in the first row of the calculator. - Enter both numbers from the second point (𝑥
_{2}, y_{2}) in the second row of the calculator. - The calculator will then tell you the values of
*m*and*c*for the line. - Write y = m𝑥 + c but replace
*m*and*c*with the values given on the calculator to obtain your equation. Note, if*c*is negative, we write a subtraction instead of an addition as in the example below.

The numbers must be entered in the order: 𝑥_{1}, y_{1}, 𝑥_{2}, y_{2}.

𝑥_{1} = 2 —- y_{1} = 1 —- 𝑥_{2} = 4 —- y_{2} = 7

** **In the example above, the calculator calculated *m = 3* and *c = -5*.

Therefore we write *y = 3𝑥* *– 5*.

We don’t write *y = 3𝑥* *+* *– 5*.

We keep ‘*y’ and ‘𝑥’* as ‘

*y’ and*. We only substitute the values of

*‘𝑥’**m*and

*c*.

## How to Find the Slope from Two Points

**When given two points (𝑥 _{1}, y_{1}) and (𝑥_{2}, y_{2}), the slope is calculated using the formula: slope = (y_{2} – y_{1}) ÷ (𝑥_{2} – 𝑥_{1}). For example, the slope between (2, 1) and (4, 7) is calculated as slope = (7 – 1) ÷ (4 – 2). This is evaluated as slope = 6 ÷ 2 = 3.**

## How to Find the y-intercept from Two Points

**The formula for the y-intercept of a line passing through two points ****(𝑥 _{1}, y_{1}) and (𝑥_{2}, y_{2})**

**is c = y**

_{1}

**– m𝑥**

_{1}

**, where m =**.

*(y*_{2}– y_{1}) ÷ (𝑥_{2}– 𝑥_{1})where

Formula for the y-intercept from two points

For example, calculate the y-intercept of the line passing through the two points (2, 9) and (3, 13).

**Step 1. Label the coordinates**

Using the order (𝑥_{1}, y_{1}) and (𝑥_{2}, y_{2}):

- 𝑥
_{1}= 2 - y
_{1}= 9 - 𝑥
_{2}= 3 - y
_{2}= 13

**Step 2. Calculate m**

* m = (y _{2} – y_{1}) ÷ (𝑥_{2} – 𝑥_{1})*

Using the values of

- 𝑥
_{1}= 2 - y
_{1}= 9 - 𝑥
_{2}= 3 - y
_{2}= 13

We obtain, and so, .

**Step 3. Calculate the y-intercept**

The formula for the y-intercept given two points is .

Using the values of m = 4, 𝑥_{1} = 2 and y_{1} = 9:

Therefore, c = 1.

** **