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
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 .
The slope-intercept form of a line is . We are told that the slope is 8, so , and the -intercept is , so . Substituting these values into the equation gives us
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,
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
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?
Remember that the equation of a straight line graph is . Here, we can read from the graph that the -intercept is 5, so . For the slope, it looks like an increase of one in the -direction corresponds to an increase of 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 which in this case would be which simplifies to . Therefore, the equation of the line is
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 . This is shown below:
Therefore, the equation of our line is
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 .
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 and , the value of has increased by three and the value of has decreased by eight. The slope can then be calculated using the formula
So, which doesn’t simplify. We then know that the equation of the line is
In order to calculate , we have to substitute a point into the equation that lies on the line. Let us use the point :
We then simplify the right-hand side and convert into a fraction with a denominator of 3:
We then add to both sides of the equation to find :
Finally, we can substitute this value into our equation to find the equation of the line: