In this explainer, we will learn how to find the equation of a straight line in slopeβintercept form given particular information, including its slope, its -intercept, points on it, or its graph.

In order to do this, we need to be familiar with the standard equation of a straight line graph and be confident in how to calculate the slope and -intercept of a line.

To start, let us recap a couple of concepts.

### Definition: Slope-Intercept Equation of a Line

The slope-intercept equation of a straight line is where is the slope and is the -intercept. The slope is calculated using the formula The -intercept, , can be calculated by substituting a point on the line into the equation once you have worked out the slope.

Let us demonstrate this in a series of examples.

### Example 1: Finding the Equation of a Line through Two Points

Find the equation of the line that passes through the points and .

### Answer

First, we will sketch a diagram and calculate the difference in and the difference in by drawing a slope triangle.

The difference in is and the difference in is . Thus, the slope is

Therefore, this means that the equation of the line must be

Now, to calculate the -intercept, , we need to substitute one of the points from our line. Let us substitute the point . We know that when is 5, is 11, so we can use these values to find : If we simplify, we get and subtracting 10 from each side we find that

Therefore, the equation of the line through and is

We can check this equation by substituting the coordinate of and checking that we get the correct -coordinate: which is correct.

### Example 2: Finding the Equation of a Line through Two Points Given in a Table of Values

Write the equation of the line that passes through the points indicated in the table of values.

3 | 7 | |

12 | 0 |

### Answer

We need to calculate the slope of the line through the two points. It is worth noting that the points presented in the table are and . Now, it is not essential to draw a diagram, but it can be helpful to visualize what is happening, so let us do that first.

Notice in this example that the slope of the line is going from top to bottom. Therefore, the slope is negative. So, the difference in is and the difference in is . Thus, the slope is

The equation of the line is

If we then substitute the point , we get Simplifying, and adding 9 to both sides we find that

Therefore, the equation of the line is

### Example 3: Finding the Equation of a Line through Two Points Giving Your Answer in a Specified Form

Find the equation of the line that passes through the points and , giving your answer in the form .

### Answer

We start by calculating the slope of the line through the two points. We can do this without the aid of a diagram. The difference in is and the difference in is . Therefore, the slope is .

The equation of the line is, therefore,

We then substitute the coordinate : Simplifying, we get and adding 3 to both sides we find that .

Therefore, the equation of the line is

Now, the question asks us to leave the equation in a specified form, so we need to do some rearranging. First we need to get the equation on one level so we multiply both sides through by 10:

Now, we need to move the and 50 terms to the other side of the equation, so we subtract from both sides and subtract 50 from both sides, which gives us

### Example 4: Finding the Equation of a Line given Its Intercepts

What is the equation of the line with -intercept and -intercept 4?

### Answer

We have been given the two intercepts of the line. This is equivalent to having been given two points the line goes through. In particular, the -intercept is which means the line passes through the point . Similarly, since the -intercept is 4, the line passes through .

We can now calculate the slope of the line through the two points. The difference in is and the difference in is . Therefore, the slope is

Therefore, the equation of the line is

Since represents the -intercept, we can immediately jump to the conclusion that . Therefore, the equation of the line is

We can also express this in another form. By multiplying by 3, we can rewrite this as

Then, subtracting from both sides, we have

Interestingly, we can generalize the result of the last example. If a line has intercepts and , where , using the same idea above, we can state that it passes through the points and . Therefore, the slope is given by

Hence, given that is the -intercept, the equation of the line is

By multiplying by , we can rewrite this as

Adding to both sides yields

Alternatively, we can divide through by which gives

These are special forms of the equation of a line called the (two-) intercept from.

In our final example, we will find the equation of a straight line using a graph.

### Example 5: Finding the Equation of a Line from a Graph

Write the equation represented by the graph shown. Give your answer in the form .

### Answer

We begin by identifying two points the line passes through. From the graph, we can identify a number of points with integer coordinates that the line passes through: , , , and . We can use any pair of points to find the equation of the line. We will chose to use the two intercepts and .

We can now calculate the slope of the line: the difference in is and the difference in is . Therefore, the slope is

The equation of the line is, therefore, where is the -intercept. Since we know the -intercepts is 4, we can conclude that the equation of the line is

Alternatively, since we knew both of the intercept values, we could have used the intercept form of the line with and to write

We could then multiply by 4 to get

Finally, we could add to both sides and arrive at the same answer:

Using the method of finding the equation of a line from two points, we can derive a general formula as follows. Given a line that passes through two distinct points, and , the slope can be calculated in the same way as example 1 by calculating the change in and , so

The equation of the line is, therefore, where can be found by substituting in one of the coordinates:

The equation of the line is then which is usually simplified to the following:

### Key Points

- To find the equation of a line through two points, we use the following method:
- Generally, it is best to start by drawing a diagram to check if the slope is positive or negative.
- Calculate the slope which is
- Using one pair of coordinates, find the -intercept by substituting them into your equation.
- Check your answer by substituting in the second pair of coordinates.
- If necessary, rearrange your formula to match the form requested in the question.

- A general formula for the equation of a line through the points and is given by