Lesson Explainer: Slope of a Line through Two Points | Nagwa Lesson Explainer: Slope of a Line through Two Points | Nagwa

Lesson Explainer: Slope of a Line through Two Points Mathematics • Second 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 slope of a line that goes through two given points.

The slope of a straight line in a coordinate plane is a number that allows us to exactly describe the steepness of the line. One possibility would be to describe the steepness of a line with the angle between the straight line and, for instance, the positive 𝑥-axis. However, as straight lines are described by an equation giving the relationship between the 𝑥- and 𝑦-coordinates of the points lying on the line, the definition of the slope that we will use is based on the coordinates of the points of the line. Let us see how.

Definition: Slope of a Straight Line

Consider two points on a straight that are one unit apart horizontally. The slope of the line, 𝑚, is then given by the change in the 𝑦-coordinate between the point on the left and that on the right.

From this definition, we first see that the slope is positive when the straight line goes up from left to right and negative when it goes down from left to right.

Second, we see that the larger the absolute value of 𝑚, the steeper the line (the more inclined it is with respect to the horizontal).

The two extreme cases are

  • when the line is horizontal (no steepness),
  • when the line is vertical (maximum steepness).

For the first case, we note that all points lying on a horizontal line have the same 𝑦-coordinate. Hence, there is no change in the 𝑦-coordinate from one point to another when they are one unit apart horizontally; the slope of a horizontal line is zero.

For the second case, the vertical line, all points lying on the line have the same 𝑥-coordinate. It is therefore impossible to apply the definition of the slope since there are no two points lying one unit apart horizontally (that is, with a difference between their 𝑥-coordinates equal to 1). The slope of a vertical line is thus undefined.

Let us test our understanding of the slope of a line with our first two examples.

Example 1: Finding the Sign of the Slope of a Straight Line

Fill in the blank: In this figure, the slope of 𝐴𝐵 is .

  1. negative
  2. zero
  3. positive
  4. undefined

Answer

We are given a triangle 𝐴𝐵𝐶, but the question asks only about line 𝐴𝐵. We only have the line segment here, but it is enough to see that the line goes down from left to right.

Recall that the slope of a straight line is positive when the line goes up from left to right and negative when it goes down from left to right. Hence, the slope here is negative, which is answer A.

Now, let us try finding the slope of a straight line parallel to an axis.

Example 2: Using the Known Properties of Horizontal and Vertical Lines to Find Unknown Coordinates

𝐴𝐵 is parallel to the 𝑦-axis. If the coordinates of the points 𝐴 and 𝐵 are (𝑚,2) and (8,6), respectively, find the value of 𝑚.

Answer

If 𝐴𝐵 is parallel to the 𝑦-axis, then it is a vertical line. All the points lying on a vertical line have the same 𝑥-coordinate. So, if the 𝑥-coordinate of 𝐵 is 8, then the 𝑥-coordinate of 𝐴, 𝑚, must be 8 as well. Hence, the value of 𝑚 is 8.

Let us come back to the definition of the slope. Suppose that two given points on a line are 1 unit apart horizontally. Then, we can draw a right triangle where its hypotenuse is the part of the line between the points and the other two sides are parallel to the 𝑥- and 𝑦-axes respectively. The side parallel to the 𝑥-axis will be 1 unit long, and the side parallel to the 𝑦-axis will be |𝑚| units long, as shown.

Consider now several points evenly spaced horizontally by 1 unit so that our right triangle can be drawn between each pair of adjacent points. (Note that the angle between a horizontal line and the line is the same at any point of the line; think of the angle relationships between a pair of parallel lines and a transversal.) Thus, we can work out that two points 2 units apart horizontally are 2𝑚 units apart vertically, and two points 3 units apart horizontally are 3𝑚 units apart vertically, and so on.

We can generalize this observation: if two points 𝐴 and 𝐵 lie on a nonvertical line with slope 𝑚, then the change in 𝑦 when going from 𝐴 to 𝐵, given by 𝑦𝑦, is 𝑚 times the change in 𝑥 when going from 𝐴 to 𝐵, given by 𝑥𝑥. Hence, we have 𝑦𝑦=𝑚(𝑥𝑥).

By dividing both sides of the equation by 𝑥𝑥 (we have 𝑥𝑥0 since the line is not vertical), we find 𝑚=𝑦𝑦𝑥𝑥.

Let us note this expression for the slope of a straight line in terms of the change in 𝑦 and the change in 𝑥 when going from one point of a line to another.

Relationship: Slope of a Straight Line and Coordinates of Two Points on the Line

The slope of a straight line passing through 𝐴(𝑥,𝑦) and 𝐵(𝑥,𝑦) is given by 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥.changeinchangein

It is worth noting that it does not matter whether 𝐴 is left from 𝐵 or not; if we swapped 𝐴 and 𝐵 in the equation above, we would change the signs of both 𝑦𝑦 and 𝑥𝑥, which would therefore not change 𝑚: 𝑚=𝑦𝑦𝑥𝑥=𝑦𝑦𝑥𝑥.

We have now established a relationship between the slope of a straight line, 𝑚, and the coordinates of any two points lying on the line. In our next example, we will use this relationship to find the slope of a line passing through two given points.

Example 3: Finding the Slope of a Straight Line When Given Two Points

Determine the slope of the line that passes through the points 𝐴(2,5) and 𝐵(4,5).

Answer

Recall that the slope of a straight line passing through points 𝐴 and 𝐵 is given by 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥.changeinchangein

Substituting in the values 𝑥=2, 𝑦=5, 𝑥=4, and 𝑦=5, we find 𝑚=5(5)42=102=5.

Therefore, the slope of the line is 5.

We can also check it graphically.

We see that when going from 𝐴 to 𝐵, we move horizontally +2 and vertically +10, which corresponds to two moves of +1 horizontally and +5 vertically, that is, a slope of 5.

The relationship between the slope and the coordinates of two points on the line is valid for any two points on the line. In other words, all the points lying on a line are linked by this relationship: the ratio of their change in 𝑦 to their change in 𝑥 is a constant, called the slope of the line. We say that points are collinear when they lie on the same straight line.

Let us use this property to solve our next example.

Example 4: Finding the 𝑦-Coordinate of a Point Given That It Is Collinear with Two Other Given Points

What is the value of 𝑦 so that 𝐴(9,6), 𝐵(3,3), and 𝐶(1,𝑦) are collinear?

Answer

We are given the coordinates of two points, 𝐴 and 𝐵, and only the 𝑥-coordinate of point 𝐶. We need to find the 𝑦-coordinate of 𝐶 so that the three points are collinear, which means that they all lie on a same straight line.

Recall that the ratio of the change in 𝑦 to the change in 𝑥 between any two points on a line equals the slope of the line. Since we have the coordinates of 𝐴 and 𝐵, we can find the slope of the line passing through 𝐴 and 𝐵. Then, we can write that the ratio of the change in 𝑦 to the change in 𝑥 between 𝐵 (or 𝐴) and 𝐶 must equal the slope of the line if 𝐶 lies on it, which will allow us to find the corresponding value of 𝑦.

Let us first calculate the slope of the line passing though 𝐴 and 𝐵. We have 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥.changeinchangein

Substituting in the values 𝑥=9, 𝑦=6, 𝑥=3, and 𝑦=3, we find 𝑚=363(9)=912.

Dividing the numerator and the denominator by 3 gives 𝑚=34.

If point 𝐶 lies on the line passing through 𝐴 and 𝐵, then we have 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥.changeinchangein

Substituting in the values 𝑚=34, 𝑥=3, 𝑦=3, 𝑥=1, and 𝑦=𝑦, we find 34=𝑦(3)1334=𝑦+3434=𝑦+34.

Multiplying both sides by 4 gives 3=𝑦+3, which means that 𝑦=0.

Thus, the 𝑦-coordinate of point 𝐶 must be 0 for 𝐴, 𝐵, and 𝐶 to be collinear.

So far, we have used the concept of slope in purely mathematical examples. However, the variables 𝑥 and 𝑦 may represent real quantities. For instance, 𝑦 can represent the volume of water in a bathtub while it is being emptied and 𝑥 the time, as shown in the following diagram.

The diagram shows us that the bathtub went from containing 100 litres of water to being empty within 5 minutes. This corresponds to a change in 𝑦 of 100 L and a change in 𝑥 of 5 min, giving a slope of 𝑚=𝑦𝑥=1005=20.changeinchangein

The value of 20 for the slope means that the volume of water in the bathtub decreased by 20 litres every minute.

In our last example, we will have to find the slopes of different line segments in a real-life situation and understand their meanings.

Example 5: Finding the Slope between Two Points in a Real-World Situation

The following graph represents a journey by car. It is made of 3 parts. Part 1 is represented by 𝐴𝐵, part 2 is represented by 𝐵𝐶, and part 3 is represented by 𝐶𝐷.

  1. Find the slope of 𝐴𝐵.
  2. Find the slope of 𝐶𝐷.
  3. Which of the following statements is not true?
    1. The same distance is covered in part 1 and in part 3 of the journey, but it takes half the time in part 3 compared to part 1.
    2. The slope gives the distance covered in one hour.
    3. The slope in part 1 of the journey is half that in part 3, which means that the speed in part 1 is half that in part 3.
    4. The change in distance is greater for part 1 of the journey than for part 3, which means that the speed is higher during part 1 than during part 3.
  4. Which of the following statements is true for part 2 of the journey?
    1. The slope of 𝐵𝐶 is positive, meaning the car is moving forward.
    2. The slope of 𝐵𝐶 is negative, meaning the car is moving backward.
    3. The slope of 𝐵𝐶 is zero, meaning the car is not moving.

Answer

Part 1

We need to find the slope of 𝐴𝐵. We read on the graph that 𝐴=(1,50) and 𝐵=(2,100). Recall that the slope is given by 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥=1005021=50.changeinchangein

This is also illustrated in the graph below.

Hence, the slope of 𝐴𝐵 is 50.

Part 2

We proceed in the same way as for question 1 to find the slope of 𝐶𝐷. We read on the graph the coordinates of 𝐶(3,100) and 𝐷(3.5,150). The slope is 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥=1501003.53=500.5=100.changeinchangein

Graphically, this can be shown as follows.

Thus, the slope of 𝐶𝐷 is 100.

Part 3

Let us look at each of the given statements to find out which one is false.

  1. The same distance was covered in part 1 and in part 3 of the journey, but it took half the time in part 3 than in part 1.
    The distance covered in part 1 is 10050=50km, and that covered in part 3 is 150100=50km, so the first part of this statement is true.
    The time taken in part 1 is 21=1hour, and the time taken in part 3 is 3.53=0.5hours. So, it is true that the time taken in part 3 is half the time taken in part 1.
  2. The slope gives the distance covered in one hour.
    The slope is the change in distance when the change in hours is 1 hour. It is therefore the distance covered in one hour.
  3. The slope in part 1 of the journey is half that in part 3, which means that the speed in part 1 is half that in part 3.
    We found that the slope in part 1 is 50 and that in part 3 is 100, so the slope in part 1 is half that in part 3. The second part of the statement refers to the speed; recall that speed is measured in distance per unit of time (e.g., kilometres per hour or metres per second). Since the slope gives us the distance covered in one hour, it is therefore equivalent to the speed of the car. So, the speed in part 1 is 50 km/h and that in part 3 is 100 km/h. So, it is true that the speed in part 1 is half that in part 3.
  4. The change in time is larger for part 1 of the journey than for part 3 for the same distance covered, which means that the speed is higher during part 1 than during part 3.
    We have seen that the change in time in part 1 (that is, the duration of part 1) is 21=1hour and that the change in time in part 3 is 3.53=0.5hours. We have also found above that the distance covered is the same. However, this means that the speed was higher in part 3 since the 50 km were covered in only half an hour, while they were covered in one hour in part 1. At its speed in part 3, the car would have traveled 100 km in one hour, which is double the distance covered in part 1 in one hour.

Hence, the false statement is answer D.

Part 4

We need to find the true statement regarding the slope of line segment 𝐵𝐶. Since 𝐵𝐶 is horizontal, its slope is zero. It means that the distance does not change during part 2 of the journey. The car is stationary, that is, it is not moving. Hence, answer C is the true statement.

Let us now recap the key points of this explainer.

Key Points

  • The slope of a straight line, 𝑚, gives the change in the 𝑦-coordinate from left to right between any two points lying on the line that are 1 unit apart horizontally.
  • For any two points lying on a straight line, the ratio of the difference in their 𝑦-coordinates to the difference in their 𝑥-coordinates is constant and equal to the slope of the line.
  • The slope of a straight line passing through 𝐴(𝑥,𝑦) and 𝐵(𝑥,𝑦) is given by 𝑚=𝑦𝑥=𝑦𝑦𝑥𝑥.changeinchangein
  • In a real-world context, if two quantities 𝑦 and 𝑥 are in a linear relationship, the graph representing 𝑦 as a function of 𝑥 is a straight line and its slope represents the change in 𝑦 for a change in 𝑥 of one unit of 𝑥.

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