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.

When looking to define a straight line, it is sufficient to understand two distinct pieces of information about the line. For example, one common way to precisely define a straight line is when we have knowledge of two distinct points through which the line passes. These points could be anywhere in the -plane, or could be in certain convenient regions of this plane such as the or the axis. Alternatively, it is possible to give a precise definition of a straight line when given its slope and the value of one of the two axis intercepts. It is this latter classification method that we will explore during this explainer—in particular focusing on mathematical problems where we would like to calculate the slope and the -intercept.

The most common way of understanding a straight line would be to write it in “slope–intercept” form, whereby the slope and the -intercept are given explicitly. Although this choice is to some extent arbitrary, the slope–intercept form is convenient for a number of reasons. Before discussing these, we will give the precise definition.

### Definition: Slope–Intercept Form

Consider a straight line in the -plane with a known slope of that intercepts the -axis at the point . Then, the equation of the line can be written in the “slope–intercept” form as

The equation of a straight line may not be immediately attainable in the neatest slope–intercept form. However, it will usually be the goal to take whatever information we are given and to use this to derive the equation of a straight line in this way. In some cases, this will involve nothing more than simple algebraic manipulation, but, in other cases, it will be helpful to state more general results. The following two examples will demonstrate this, and then we will progress to more complicated examples.

### Example 1: Finding the Slope of a Line given Its Equation

A straight line has the equation . What is the slope of this line?

### Answer

We will write this line in slope–intercept form, which will allow us to determine the slope. We will take the given equation and then seek to isolate the -term. We can do this by adding to both sides of the equation, giving us

Now, we can divide both sides of the equation by 3, which gives us

The term on the left-hand side simplifies to leave , and the right-hand side will also simplify. The term has a coefficient of , and the unit term is . This allows us to write the equation of the line in the slope–intercept form:

The slope of the line is the coefficient of the term, which, in this case, is 5.

### Example 2: Finding the Slope of a Line

Find the slope of the line and the -intercept of this line.

### Answer

We will take the given equation and solve this for , which will achieve the slope–intercept form that we desire. Given the initial equation we would like to isolate the term on the left-hand side. We will do this by adding to both sides of the equation:

The final step will be to divide both sides of the equation by 3, which gives us

The line is now in slope–intercept form, and the slope is the coefficient of the term, which is . The -intercept is the rightmost term, which, coincidentally, is also .

At the beginning of this explainer, we stated that it would always be possible to use two distinct given points and in order to find the equation of a straight line. One related skill that we should practice is determining whether or not a given point lies on a given line.

### Example 3: Determining Whether a Point Lies on a Given Straight Line

Does the point lie on the line ?

### Answer

If the given point lies on the given line, then it should satisfy the equation as given in slope–intercept form (or, indeed, any equivalent form). We will substitute and into the equation . If the resulting statement is true, then the point lies on the line, whereas if the statement is false, then the point does not lie on the line.

Making the substitutions, we obtain

This statement is clearly false and, therefore, the point does not lie on the line.

At the beginning of this explainer, we said that the slope–intercept form would usually be the main goal when trying to understand the properties of a straight line. However, we also said that it was possible to reach the slope–intercept form in a number of different ways. As long as we have the coordinates of two distinct points that lie on a particular straight line, we will normally be able to derive the slope–intercept form as a result. Perhaps the most common route is to start with information about two distinct points that the line passes through, then use this to reach the slope–intercept form. We will summarize this process with the following result, which we will then discuss before giving several examples.

### Definition: The Equation of a Straight Line given Two Points That Are on the Line

Consider a straight line in the -plane that is known to pass through the two distinct points and . Then, the equation of the straight line can be found using the following technique. First, the slope of the straight line is calculated using the known formula

We can then find the equation in slope–intercept form by taking the equation where has already been calculated, and we would like to find the -intercept . The equation passes through the two points and , and either of these pairs of values can be substituted into the equation above to find . In other words, we could find by solving either of the equations

We will demonstrate this method with an example. Consider the two points and and the straight line that passes through these two points, all of which are plotted below. We can see that the straight line moves downward from left to right, which means that the slope must be negative. Furthermore, it appears as though the line passes through the -axis at the point , meaning that the -intercept should be equal to .

To know any of this precisely, we must determine the exact equation of the line. We will do this by using the given two coordinates that the line is known to pass through, combined with the result in the definition given above. We begin by labeling the given points as and . We will then calculate the slope of this line by using the formula

We have found that the slope of the straight line is negative, as expected.

Now, we can find the -intercept by solving the equation after substituting in either of the two points or . We arbitrarily choose the point and the known slope , meaning that we must now solve

Substituting in the given values, we find that

We can then isolate by adding 4 to both sides of the equation, giving us which allows us to rearrange and find that . Now that we know the gradient is and that the -intercept is , we can form the equation of the straight line:

This is the equation of the straight line when written in slope–intercept form. We can see that the slope is , which is negative, as expected. Also the value of the -intercept is precisely as expected, having the value .

Note that we could use the point to verify that the equation of the straight line is correct. This means that we have found the correct values for the slope and the -intercept . If we were to substitute into the line in slope–intercept form as we would obtain the equation , which is correct. This confirms that the we completed the example correctly. Checks like this are not necessary, but are certainly encouraged.

We will now apply the previous principles to two examples. If we are ever given two distinct coordinates and asked to find the slope–intercept form of the straight line passing through them, then it will usually be helpful to plot a diagram. This will give a better understanding of the problem but will also give an estimate to the values of the slope and the -intercept, which will be a helpful check when the question has been completed. We have used this approach in the next example.

### Example 4: Finding the Equation of a Straight Line

Determine the equation of the line passing through and in slope–intercept form.

### Answer

We will start with a plot of the coordinates and , as shown below.

The first step to finding the equation of the straight line is to find the slope of the line. We do this by substituting the two points and into the known formula for the slope of a straight line:

The slope is large and negative, as shown in the plot. Now we can find the -intercept by taking the slope–intercept form and substituting in the slope , as well as either of the two known points or . We arbitrarily choose to use the first point, which gives us the equation where all quantities but are known. Substituting in these known quantities gives us

This immediately gives the value of the -intercept as . The equation of the line in slope–intercept form is then

If we are ever given a coordinate in the form , then we do not need to perform the substitution method as demonstrated above. This is because we have effectively already been given the value of the -intercept as . This is true because the -intercept of a straight line is defined as the point where that line meets the -axis, which is defined to be the vertical line where . This was the case in the previous example, and we could have immediately stated that the -intercept had the value because we were given one of the points .

In the following example, we see how the relationship between a straight line and its equation can be applied to identify the graph of a straight line when directly given the equation itself.

### Example 5: Identifying Graphs of Linear Equations in Slope–Intercept Form

Which of the following graphs represents the equation ?

### Answer

The slope–intercept form of the line gives a slope and an intercept , both of that are negative. Now, inspecting the available options, we can immediately remove any that have a positive slope. This allows us to discard option b. We can also reject any option where there is a positive -intercept, which, in this case, removes option a. Since we know the -intercept is , we can also exclude option c because this graph has a -intercept that is .

There are two remaining candidates: options d and e. Note that these both have different -intercepts (i.e., the point where the graph crosses the -axis). This distinguishing feature will allow us to find the correct option from those that are remaining. Just as the -intercept is where the straight line crosses the -axis, the -intercept is where the straight line crosses the -axis. This happens when , which we can substitute into the slope–intercept form . This leaves and solving this equation gives

This corresponds to option d, which is the only straight line to have an -intercept between and 0.

A further way of confirming that option d is the correct choice is to consider that the slope of the straight line is . This corresponds to a relatively steep negative slope, which is indeed the case when looking at option d. Comparatively, option e has a relatively shallow negative slope, and we would expect the slope to be closer to zero as a result.

Often we will be given graphs where the - and -axis intercepts are given or are integer values that can easily be identified by inspection. In such cases, the same general method can be applied for finding the equation of a straight line, given two points that lie on the line.

### Example 6: Determining the Slope–Intercept Form of the Equation of a Straight-Line Graph

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

### Answer

For this question, we have helpfully been given a graph from which we can deduce that the slope of the line is positive. Although we do not directly have two points marked on the graph, we can see that the line appears to intersect the - and -axis at integer values.

By inspection, we can see that the -intercept occurs at and the -intercept occurs at 6. This allows us to define two points that lie on the line. We will call these points and :

With this information, we can now calculate the slope of the line using the formula

The slope of the straight line is positive, as we correctly observed from the given graph. Since our goal is to find the equation of the straight line in slope–intercept form, , we now move on to calculating the value of . It is worth noting that this constant is often represented as instead of .

The general method for finding this constant involves substituting the values from one of our points, or , alongside the known value of the slope into the equation in slope–intercept form

In this instance, we can avoid these calculations by recalling that the constant represents the -intercept of our line, which we already have identified! Since is the point at which our line crosses the -axis, we can directly state that .

It might be useful to demonstrate the equivalent result via the substitution method:

Now that we have found the values of and , we can now express the equation of the straight line in slope–intercept form:

As demonstrated in the previous example, it will occasionally be the case that both the -intercept and the -intercept are given as two distinct points that lie on a particular line, which is a simpler problem than when two generic points are given. Let us observe a more formal method to reduce our calculations in this situation. Suppose we were given two points that lie on the straight line and also on the two axes. In other words, assume that and . Then, we can find the slope in the normal way:

With the slope now calculated, we can find the general equation of the straight line by considering the slope–intercept form

Substituting the known value for the slope , we get

### Definition: The Equation of a Straight Line given the Two Intercepts

Consider a straight line in the -plane that has an -intercept of and a -intercept of . The equation of the straight line is

The equation above give us a useful way to find the equation of a straight line in “slope–intercept” form when given both the - and -intercepts. Performing a simple substitution of both of these values, we can reach our equation directly. To demonstrate this result, we will give the following short example.

### Example 7: Finding the Equation of a Line with Given 𝑥𝑦-Intercepts and Calculating the Area of a Triangle

Find the equation of the line with -intercept 3 and -intercept 7, and calculate the area of the triangle on this line and the two coordinate axes.

### Answer

We will begin by plotting the diagram of the two points and the straight line. On the diagram below, the two intercepts are marked in blue and the straight line is in black. The question requires that we find the area trapped between this straight line and the two coordinate axes, which make the triangle that we have outlined in red.

Now, we will begin finding the equation of the straight line in slope–intercept form. We first label the -intercept as and the -intercept as . We can then substitute these values directly into the equation:

Performing a substitution with the given values for and will give the equation of the straight line in slope–intercept form as

Looking at the coefficient on the term, we see that the slope of this straight line is . This negative slope matches our observation of the negative slope shown on the diagram above.

It is well-known that the area of the triangle is half the base times the height. In this case, we can see that the base of the triangle is 3 units, whereas the height is 7 units. Therefore, we can calculate that the area is given by which means that the bound area is 10.5 units squared.

Although we will usually seek to achieve the slope–intercept form of a straight line, there can be many avenues toward this outcome. It is helpful to understand all of the routes that we have covered in this explainer and to be fully confident in the algebraic manipulation that is required.

Where possible, one should focus on information about either of the two intercepts, but if this is not available, then more general methods can be used. In any case, it is always wise to plot a diagram if it is not provided, both as a means of understanding the problem and also to help verify that the slope–intercept form appears to be accurate when compared to the graph.

### Key Points

- For a straight line in the -plane with known slope and a -intercept of , the equation of the line can be written in the “slope–intercept” form as
- A straight line passing through the distinct points and has the slope
- Following this, the -intercept can then be found by substituting the and values of either of the two points into the equation of a line in slope–intercept form. In other words, once the value for is known, can be found by solving either of the equations
- For a straight line in the -plane with an -intercept of and a -intercept of , the equation of the line in slope–intercept form can be found directly using the equation