Slope of a Line

On this page, the following topics are covered:

What is a Slope?

A slope is the steepness, or the gradient of a straight line. Often, it is described as the ratio between the “rise” (vertical distance from the origin) and the “run” (horizontal distance from the origin), which is why its formula is sometimes called “rise over run”.

Consider the line passing through the points A (1, 2) and B (3, 5) as shown in the figure.

Slope of a Line Image 1

The straight line makes an angle Q with the positive direction of the x-axis and this angle is a measure of the slope/steepness of the line with respect to the horizontal x-axis. This is known as the slope.

In geometry, specifically coordinate geometry, the slope m is given by:

m = {Delta y}/{Delta x}

To make it clearer, the slope of a line passing through the points A (x_1, y_1) and B (x_2, y_2) is given by:

m =  {y_2 - y_1}/{x_2 - x_1}

So, we can now solve for the slope of the line in the figure above.

m =  {5 - 2}/{3 - 1}
m =  3/2

Sample Problems

Now let’s work out some samples.

Find the slope of the line passing through each of the following pairs of points.

  1. A (2, 3) and B (3, 6)
  2. C (2, 1) and D (-1, 4)

Solutions:

  1. A (2, 3) and B (3, 6)
    For Point A, y = 3 and x = 2. For Point B, y = 6 and x = 3.

    So, we now have:

    x_1 = 2, y_1 = 3
    x_2 = 3, y_2 = 6

    Solving for the slope using the formula:

    m =  {6 - 3}/{3 - 2}
    m =  3

  2. C (2, 1) and D (-1, 4)
    For Point C, y = 1 and x = 2. For Point D, y = 4 and x = -1.

    x_1 = 2, y_1 = 1
    x_2 = -1, y_2 = 4

    Solving for the slope using the formula, rise over run:

    m =  {4 - 1}/{-1 - 2}
    m =  3/{-3}
    m =  -1

Important Reminder

y_2 and y_1 are interchangeable, as well as x_2 and x_1. The slope of a line would be undefined if x_2 = x_1.

Slope of One Line

In general, equations of straight lines are in the form of y = mx + b where m is the slope of the line and b is the y-intercept. This is also called the slope-intercept form.

Equations of vertical lines are in the form x = k and those of horizontal lines are of the form y = h.

The slope of straight lines can be easily determined if we arrange the equation of the line in the y = mx + b format. We just have to look down for the value of m and jot it down.

We can also do it using graphical methods which take more time; we graph the line on a piece of graphing paper and we take at least two values of y and the corresponding x values, and we just have to replace the values in the formula:

m =  {y_2 - y_1}/{x_2 - x_1}

It will give the same value as the first method.

Important Reminder

The slope of a vertical line is always undefined, and the slope of a horizontal line is always zero.

Sample Problems

Let’s try to work some examples on getting the slope of a straight line.

Find the slope of each of the following lines:

  1. y + 2x = 3
  2. 3x - 2y = 1
  3. y = 5
  4. x = 17

Solutions:

  1. y + 2x = 3
    Rearranging this equation into the slope-intercept form, we get:
    y = -2x + 3
    m = -2
  2. 3x - 2y = 1
    -2y = -3x + 1

    y = {-3x + 1}/-2 right { {-3x} /-2} + { 1/{-2} }

    m = 3/2

  3. y = 5
    This is already in the slope-intercept form, so all we have to do is look where m is. y = 5 doesn’t appear to have any x in the equation, so this means that m is zero.m = 0
  4. x = 17
    This equation means that for all real values of y, x will still be 17. So, we must have a vertical line right here. As stated above, the slope of a vertical line is undefined.
    m = undefined

Slope of Parallel Lines

Parallel lines have the same slope, because their changes in y and in x are the same.

Let’s say lines A and B are parallel.

A: y = {m_1}x + b_1
B: y = {m_2}x + b_2

A and B have the same slopes since they are parallel. So, m_1 = m_2

Sample Problems

  1. Determine if line A, passing through (2, 1) and (3, 3) and line B, passing through (1, 7) and (2, 9) are parallel.
  2. Determine if line C, passing through (7, 4) and (0, 9) and line D, passing through (6, 2) and (3, 4) are parallel.

Solutions:

  1. Determine if line A, passing through (2, 1) and (3, 3) and line B, passing through (1, 7) and (2, 9) are parallel.First, we have to get the slope of line A. Let’s call it m_1.m_1 =  {3 - 1}/{3 - 2}
    m_1=  2

    Then, the slope of line B. Let us call it m_2.

    m_2 =  {9 - 7}/{2 - 1}
    m_2 =  2

    Since m_1 = m_2, lines A and B are parallel.

  2. Determine if line C, passing through (7, 4) and (0, 9) and line D, passing through (6, 2) and (3, 4) are parallel.Let us solve for the slopes of lines C and D first. Let’s call line C’s slope m_1, and line D’s slope m_2.Solving for line C’s slope:m_1 =  {9 - 4}/{0 - 7}
    m_1 =  -5/7

    Solving for line D’s slope:

    m_2 =  {4 - 2}/{3 - 6}
    m_2 =  2/3

    Since -5/7 and 2/3 are not equal, these lines are NOT parallel.

Slope of Perpendicular Lines

In the figure below, two straight lines, A and B, with slopes m_1 and m_2 intersect at right angles.

It follows that one of the lines has a positive slope (line A), whereas the other one that is perpendicular to it has a negative slope.

Therefore we can say that perpendicular lines’ slopes are negative reciprocals of each other.

m_2 = -1/{m_1}

One example:

If the slope of line L_1 is 3, then it follows that the slope of line L_2 which is perpendicular to line L_1 has a slope of -1/3.

Useful Facts:

  • Two non-vertical lines with slopes m_1 and m_2 are perpendicular if m_1*m_2 = -1.
  • A line which is perpendicular to another line with slope 0 has an undefined slope.

Sample Problem

Determine if line X, passing through the points A (0, -4) and B (-1, -7) and line Y passing through C (3, 0) and D (-3, 2) are parallel or perpendicular.

Solution:

Let us solve for line X’s slope first. Let’s call it m_1.
m_1 =  {-7 - (-4)}/{-1 - 0}
m_1 =  3

Now, let’s solve for line Y’s slope, which we’ll call m_2.

m_2 =  {2 - 0}/{-3 - 3}
m_2 =  2/-6
m_2 = -1/3

Since 3*{-1/3} = -1, then lines X and Y are perpendicular.