Explainer: Equation of a Straight Line: Slope-Intercept Form

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

A linear graph, often called a β€œstraight line graph”, always has an equation that can be written in the form 𝑦=π‘šπ‘₯+𝑐, where π‘š is the slope of the line and 𝑐 is the 𝑦-intercept (the point where the line crosses the 𝑦-axis). This is also referred to as slope-intercept form. Therefore, we can identify the equation of a linear function with these two pieces of information.

Suppose you know that the slope of a line is 3 and its 𝑦-intercept is 4. Then, its equation would be 𝑦=3π‘₯+4.

We could also use this information to draw a graph of the function:

We know that the 𝑦-intercept is 4, and a slope of 3 tells us that the rate of change is 3. In other words, an increase of one in the π‘₯-direction corresponds to an increase of three in the 𝑦-direction.

Let us look at an example.

Example 1: Finding the Equation of a Line given Its Slope and 𝑦-Intercept

Determine, in slope-intercept form, the equation of the line which has a slope of 8 and a 𝑦-intercept of βˆ’4.

Answer

The slope-intercept form of a line is 𝑦=π‘šπ‘₯+𝑐. We are told that the slope is 8, so π‘š=8, and the 𝑦-intercept is βˆ’4, so 𝑐=βˆ’4. Substituting these values into the equation gives us 𝑦=8π‘₯βˆ’4.

Rather than being given the value of a line’s slope and 𝑦-intercept and asked to find its equation, we may be given its graph and asked to find its equation.

For example, we may be asked to find the equation of the following line:

The 𝑦-intercept is the point where the straight line crosses the 𝑦-axis. Here, we can identify the 𝑦-intercept (𝑐) by reading it from the graph:

The slope is the rate of change of the line, which is calculated by dividing the change in 𝑦 by the change in π‘₯. In other words, π‘š=changein𝑦changeinπ‘₯.

To calculate the slope from a graph, we identify two points on the line that clearly cross the corners of squares and calculate the change in π‘₯ and 𝑦 as follows:

Therefore, the equation of the line is 𝑦=2π‘₯βˆ’1.

Let us look at a more difficult example.

Example 2: Finding the Equation of a Line from a Graph

Which equation represents the line shown?

Answer

Remember that the equation of a straight line graph is 𝑦=π‘šπ‘₯+𝑐. Here, we can read from the graph that the 𝑦-intercept is 5, so 𝑐=5. For the slope, it looks like an increase of one in the π‘₯-direction corresponds to an increase of 12 in the 𝑦-direction. As the size of the graph is quite small, however, it is useful to check this over a greater distance. For example, an increase of 6 in the π‘₯-direction corresponds to an increase from 5 to 8, or 3, in the 𝑦-direction. That is consistent as π‘š=changein𝑦changeinπ‘₯, which in this case would be π‘š=36 which simplifies to 12. Therefore, the equation of the line is 𝑦=12π‘₯+5.

The working out for this question is shown below:

Another way to calculate the slope is to identify the change in 𝑦 for an increase of one in the π‘₯-direction. For example, in the question above, an increase of one in the π‘₯-direction corresponds to an increase of two in the 𝑦-direction so the slope is 2.

Let us have a look at another example but this time for a line with a negative slope. Consider the following graph:

As before, we can read off the 𝑦-intercept directly from the graph:

To calculate the slope, we need to work out the change in 𝑦 for an increase of one in the π‘₯-direction. Alternatively, like before, we can choose two points and work out the change in 𝑦 divided by the change in π‘₯. Here, for an increase of one in the π‘₯-direction the 𝑦 value decreases by three so the slope of the line is βˆ’3. This is shown below:

Therefore, the equation of our line is 𝑦=βˆ’3π‘₯+2.

You might wonder how you would work out the equation of a line when the 𝑦-intercept is not easily identified from the graph.

To do that you would need to employ an additional step of working out. We will demonstrate this through an example.

Example 3: Finding the Equation of a Line from a Graph Where the 𝑦-Intercept Is Not Clear

Find the equation of the straight line represented by the graph below in the form of 𝑦=π‘šπ‘₯+𝑐.

Answer

Here, we cannot easily identify the 𝑦-intercept so we will start by finding the slope. In this question, two points have been highlighted on the graph so we will use these to find the change in π‘₯ and 𝑦. Between the points (βˆ’2,7) and (1,βˆ’1), the value of π‘₯ has increased by three and the value of 𝑦 has decreased by eight. The slope can then be calculated using the formula π‘š=changein𝑦changeinπ‘₯.

So, π‘š=βˆ’83 which doesn’t simplify. We then know that the equation of the line is 𝑦=βˆ’83π‘₯+𝑐.

In order to calculate 𝑐, we have to substitute a point into the equation that lies on the line. Let us use the point (1,βˆ’1): βˆ’1=ο€Όβˆ’83(1)+𝑐.

We then simplify the right-hand side and convert βˆ’1 into a fraction with a denominator of 3: βˆ’33=βˆ’83+𝑐.

We then add 83 to both sides of the equation to find 𝑐: 53=𝑐.

Finally, we can substitute this value into our equation to find the equation of the line: 𝑦=βˆ’83π‘₯+53.

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