Lesson Explainer: Equation of a Straight Line: Slope–Intercept Form | Nagwa Lesson Explainer: Equation of a Straight Line: Slope–Intercept Form | Nagwa

Lesson Explainer: Equation of a Straight Line: Slope–Intercept Form Mathematics • Third Year of Preparatory School

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

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 (0,𝑏). 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 βˆ’15π‘₯+3π‘¦βˆ’12=0. 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 βˆ’15π‘₯+3π‘¦βˆ’12=0 and then seek to isolate the 𝑦-term. We can do this by adding 15π‘₯+12 to both sides of the equation, giving us 3𝑦=15π‘₯+12.

Now, we can divide both sides of the equation by 3, which gives us 3𝑦3=15π‘₯+123.

The term on the left-hand side simplifies to leave 𝑦, and the right-hand side will also simplify. The π‘₯ term has a coefficient of 153=5, and the unit term is 123=4. This allows us to write the equation of the line in the slope–intercept form: 𝑦=5π‘₯+4.

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 βˆ’2π‘₯+3π‘¦βˆ’2=0 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 βˆ’2π‘₯+3π‘¦βˆ’2=0, we would like to isolate the 𝑦 term on the left-hand side. We will do this by adding 2π‘₯+2 to both sides of the equation: 3𝑦=2π‘₯+2.

The final step will be to divide both sides of the equation by 3, which gives us 𝑦=23π‘₯+23.

The line is now in slope–intercept form, and the slope is the coefficient of the π‘₯ term, which is 23. The 𝑦-intercept is the rightmost term, which, coincidentally, is also 23.

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 (2,βˆ’3) lie on the line 𝑦=5π‘₯βˆ’7?

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 π‘₯=2 and 𝑦=βˆ’3 into the equation 𝑦=5π‘₯βˆ’7. 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 βˆ’3=5Γ—2βˆ’7=10βˆ’7=3.

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 𝑦=π‘šπ‘₯+𝑏𝑦=π‘šπ‘₯+𝑏.or

We will demonstrate this method with an example. Consider the two points 𝐴(3,βˆ’4) and 𝐡(βˆ’2,1) 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 (0,βˆ’1), meaning that the 𝑦-intercept should be equal to βˆ’1.

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 (π‘₯,𝑦)=(3,βˆ’4) and (π‘₯,𝑦)=(βˆ’2,1). We will then calculate the slope of this line by using the formula π‘š=π‘¦βˆ’π‘¦π‘₯βˆ’π‘₯=1βˆ’(βˆ’4)βˆ’2βˆ’3=βˆ’1.

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 (π‘₯,𝑦)=(3,βˆ’4) or (π‘₯,𝑦)=(βˆ’2,1). We arbitrarily choose the point (π‘₯,𝑦)=(3,βˆ’4) and the known slope π‘š=βˆ’1, meaning that we must now solve 𝑦=π‘šπ‘₯+𝑏.

Substituting in the given values, we find that βˆ’4=βˆ’1Γ—3+𝑏.

We can then isolate 𝑏 by adding 4 to both sides of the equation, giving us 0=𝑏+1, which allows us to rearrange and find that 𝑏=βˆ’1. Now that we know the gradient is π‘š=βˆ’1 and that the 𝑦-intercept is 𝑏=βˆ’1, we can form the equation of the straight line: 𝑦=βˆ’π‘₯βˆ’1.

This is the equation of the straight line when written in slope–intercept form. We can see that the slope is π‘š=βˆ’1, which is negative, as expected. Also the value of the 𝑦-intercept is precisely as expected, having the value 𝑏=βˆ’1.

Note that we could use the point (π‘₯,𝑦)=(βˆ’2,1) 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 (π‘₯,𝑦)=(βˆ’2,1) into the line in slope–intercept form as 𝑦=βˆ’π‘₯βˆ’1, we would obtain the equation βˆ’2=βˆ’(1)βˆ’1, 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 𝐴(0,16) and 𝐡(1,βˆ’9) 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 (π‘₯,𝑦)=(0,16) and (π‘₯,𝑦)=(1,βˆ’9) into the known formula for the slope of a straight line: π‘š=π‘¦βˆ’π‘¦π‘₯βˆ’π‘₯=βˆ’9βˆ’161βˆ’0=βˆ’25.

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 (π‘₯,𝑦)=(0,16) or (π‘₯,𝑦)=(1,βˆ’9). 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 16=25Γ—0+𝑏.

This immediately gives the value of the 𝑦-intercept as 𝑏=16. The equation of the line in slope–intercept form is then 𝑦=βˆ’25π‘₯+16.

If we are ever given a coordinate in the form (0,𝑦), 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 π‘₯=0. This was the case in the previous example, and we could have immediately stated that the 𝑦-intercept had the value 𝑏=16 because we were given one of the points (0,16).

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 𝑦=βˆ’5π‘₯βˆ’2?

Answer

The slope–intercept form of the line gives a slope π‘š=βˆ’5 and an intercept 𝑏=βˆ’2, 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 𝑏=βˆ’2, we can also exclude option c because this graph has a 𝑦-intercept that is βˆ’5.

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 𝑦=0, which we can substitute into the slope–intercept form 𝑦=βˆ’5π‘₯βˆ’2. This leaves 0=βˆ’5π‘₯βˆ’2, and solving this equation gives π‘₯=βˆ’25.

This corresponds to option d, which is the only straight line to have an π‘₯-intercept between βˆ’1 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 π‘š=βˆ’5. 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 βˆ’4 and the π‘₯-intercept occurs at 6. This allows us to define two points that lie on the line. We will call these points (π‘₯,𝑦) and (π‘₯,𝑦): (π‘₯,𝑦)=(0,βˆ’4),(π‘₯,𝑦)=(6,0).

With this information, we can now calculate the slope of the line using the formula π‘š=π‘¦βˆ’π‘¦π‘₯βˆ’π‘₯=0βˆ’(βˆ’4)6βˆ’0=46=23.

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 (π‘₯,𝑦)=(0,βˆ’4) is the point at which our line crosses the 𝑦-axis, we can directly state that 𝑐=βˆ’4.

It might be useful to demonstrate the equivalent result via the substitution method: 𝑦=π‘šπ‘₯+π‘βˆ’4=23(0)+π‘βˆ’4=𝑐.

Now that we have found the values of π‘š and 𝑐, we can now express the equation of the straight line in slope–intercept form: 𝑦=23π‘₯βˆ’4.

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 (π‘₯,𝑦)=(π‘Ž,0) and (π‘₯,𝑦)=(0,𝑏). Then, we can find the slope in the normal way: π‘š=π‘¦βˆ’π‘¦π‘₯βˆ’π‘₯=π‘βˆ’00βˆ’π‘Ž=βˆ’π‘π‘Ž.

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 π‘Ž=3 and the 𝑦-intercept as 𝑏=7. 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 𝑦=βˆ’73π‘₯+7.

Looking at the coefficient on the π‘₯ term, we see that the slope of this straight line is βˆ’73. 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 areabaseheight=Γ—2=3Γ—72=212, 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 𝑦=βˆ’π‘π‘Žπ‘₯+𝑏.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy