In this explainer, we will learn how to calculate the slope of a line given two points on it and determine whether the slope is positive, negative, zero, or undefined.
Key Information: The Slope of a Line
The general form of a straight line in the -plane is
In this form, the slope (or gradient) of the line is represented by the coefficient and the -axis intercept is represented by the constant .
For this explainer, we will be focusing on the slope.
The equation of a straight line describes all points that lie on it. When given a set of two points on a line, and , we can write out two equations using the given information:
Let us illustrate how these two equations can be used to find . Our first step is to subtract from :
On the right-hand side of the new equation, our terms cancel out:
We can now take out a factor of from the right-hand side of our equation, and divide both sides by to find , expressed in terms of the four known coordinates:
This expression can be understood more intuitively when we realize the following:
We can therefore see that, for any straight line, dividing the change in by the change in over two points will give us the slope:
Key Information: Determining the Slope of a Line given Two Points
When given two points, and , that lie on a straight line, the slope of the line can be calculated using the following formula:
To put this expression in words,
It is worth noting that the order in which we label our two points from left to right is not important. Choosing the left-hand point as and the right-hand point as will still output the correct slope.
To further explore this, let us imagine a simple case where two points on a line are 1 unit apart in the -direction. In this situation, the following is true:
We can now substitute this into the formula for the slope of a line, which gives
In this simple case, we can see that the formula for reduces to the following:
The slope can therefore be understood as the change in the -position when a point is moved 1 unit along the line in the positive -direction (from left to right).
By thinking of the slope in this way, we can see that a larger will give rise to a larger change in , and the line we observe can be considered “steeper.”
When looking at the slopes of one or more lines, you may be asked to compare the “steepness.”
In cases of both positive and negative values of , a line may be considered steep despite the differing directions of the incline.
In order to quantify the steepness, it will be useful to think of the absolute value of . Absolute value is denoted by two vertical lines.
The absolute value of a number can be thought of as its distance from 0. Since distance is scalar, the absolute value of any negative number is positive and its numerical value is maintained.
The line with the steepest slope can therefore be found by identifying the largest absolute value of .
Finally, let us continue with our simple case where the following is true:
Since is equal to the change in , we can see that a positive value of will correspond to an increase in and a negative value of will correspond to a decrease in (as we move in the positive -direction).
In other words, the sign of tells us whether our line goes up or down as we move from left to right.
Let us summarize these two properties of .
Key Information: Understanding the Properties of a Slope
The absolute value of represents the steepness of the slope.
In general, line 1 (slope: ) is steeper than line 2 (slope: ) if
The sign of the denotes the direction of the incline as you move in the positive -direction:
We can now look at a few examples that use the slope formula to find of a line given at least two points that lie on the line.
Example 1: Finding the Slopes of Straight Lines
Determine the slope of the line that passes through the points and .
Taking point to be and point to be , we can input the and coordinates into the formula for the slope of a line:
Performing the substitution which gives the following equation: we can then simplify our fraction to reach the solution:
We have now found that the line has a slope of positive 5. In practical terms, this means that for every 1 unit we move to the right in the -direction, the line will rise by 5 units in the -direction.
Example 2: Finding the Slope of a Line Drawn in Coordinate Axes
Find the slope of the line shown.
The graph above shows two points marked on a straight line. One thing that we may notice is that the line shown in the diagram goes down as we move from left to right. This “visual check” can immediately tell us that the slope of the line will be negative.
To find the slope, we can first determine the coordinates of the two points and then use the formula for the slope of a straight line.
We can see that the first point lies at the coordinates . Let us take this point to be . The second point lies at the coordinates , and we can take this to be .
We can input the - and -coordinates into the formula for the slope of a line to give us the following equation:
We can then simplify the right-hand side of our equation to solve for the slope, :
Finally, we can note that the slope of the line is negative, and this agrees with our initial “visual check” based on the diagram.
Example 3: Comparing the Slopes of Two Straight Lines given the Coordinates of Two Points Lying on Them
Line 1 passes through point and point and Line 2 passes through the points and . Which of the two lines has a steeper slope?
We can first determine the slope of line 1 by taking point to be and point to be . As with the previous example, we can input the - and -coordinates into the formula for the slope of a line:
We can now simplify our fraction to find the slope of line 1, giving
For this question, we will use an accuracy of three decimal places:
Let us now calculate the slope of line 2 using the same method and assigning point to be and point to be :
Again, we can now simplify our fraction to find the slope of line 2, giving
For consistency with , we use an accuracy of three decimal places:
To find which line is steeper, we compare the absolute value of the two slopes:
When comparing slopes, the number with the largest absolute value corresponds to a steeper slope. We can therefore say that line 2 is steeper than line 1.
The equation for the slope of a line can also be used to find information about coordinates that lie on the line. Let us look at a few examples of this.
Example 4: Determining the 𝑦-Coordinates for Two Points Lying on Two Parallel Lines
If the line passing through points and is parallel to the line passing through points and , what is the value of ?
Let us say that line 1 passes through points and and has a slope . Similarly, line 2 passes through points and and has a slope . We can define our points as follows:
We can recall that parallel lines always remain equidistant (and will therefore never meet). In the -plane, this can only be true if the slopes of the lines are equal. Since the question tells us that line 1 and line 2 are parallel, we can conclude that
We can now substitute the coordinate values into our slope equation:
Simplifying the fractions, we find the following:
We can multiply both sides of our equation by the denominators 9 and 33, and collect the -terms to solve:
To finish off, we know that and are equal to the -value we have just found. We can therefore complete the information for points and :
Note: We now have a complete set of two coordinates. This information could be used to find the slopes of both lines. In this case, the question does not require us to find , but you may wish to complete this step in similar questions to check that .
Example 5: Finding the 𝑦-Coordinate of a Point Lying on a Straight Line given the Slope and the Coordinates of Another Point on the Line
Given that the slope of a straight line passing through the points and is , find the value of .
Let us substitute the known values into the equation for the slope of a straight line, taking our first point to be and our second point to be .
We also substitute as the given value for the slope:
We can then simplify the right-hand side of the equation and multiply both sides by :
In doing this, we find that the denominator of the left-hand side of our equation can be eliminated:
This allows us to solve for :
The coordinates of the second point given in the question are .
Finally, we can use our formula to determine the coordinates of a point on a line with a given slope.
Example 6: Determining the 𝑦-Coordinate of a Point on a Straight Line
What is the value of so that , , and are collinear?
First, we can recall that collinear points all lie on the same line. This means that the slope of line is the same as that of line :
We can determine the slope of line by using the formula for the slope of a line, taking to be and to be :
We now simplify our fraction:
Since we know that the slope of line is equal to the slope of line , we also can say that
Let us substitute the values for points and into our formula and solve for :
Multiplying both sides by gives us our solution:
To finish, we can now write point in full, using the information we have found:
- The general form of a straight line in the -plane is
- When given two points, and , that lie on a straight line, the slope of the line can be calculated using the following formula:
- The slope can be understood as the change in the -position when a point is moved 1 unit along a line in the positive -direction.
- The slope can be positive or negative. You can visually identify the sign of by checking whether the line goes up or down as you move from left to right.
- The absolute value of , denoted as , represents the steepness of the slope.
- In general, one slope is considered “steeper” than another if it has a greater .