Skip to content

Slope of a Line

By the end of this section, you will be able to: find the slope of a line, graph a line given a point and the slope, graph a line using its slope and intercept, choose the most convenient method to graph a line, graph and interpret applications of slope-intercept, and use slopes to identify parallel and perpendicular lines.

Find the slope of a line

When you graph linear equations, you may notice that some lines tilt up as they go from left to right and some lines tilt down. Some lines are very steep and some lines are flatter.

In mathematics, the measure of the steepness of a line is called the slope of the line. The concept of slope has many applications in the real world. In construction, the pitch of a roof, the slant of the plumbing pipes, and the steepness of the stairs are all applications of slope, and as you ski or jog down a hill, you definitely experience slope.

We can assign a numerical value to the slope of a line by finding the ratio of the rise and run. The rise is the amount the vertical distance changes while the run measures the horizontal change. Slope is a rate of change.

Slope of a line. The slope of a line is m=riserunm = \tfrac{\text{rise}}{\text{run}}. The rise measures the vertical change and the run measures the horizontal change.

To find the slope of a line, we locate two points on the line whose coordinates are integers. Then we sketch a right triangle where the two points are vertices and one side is horizontal and one side is vertical. We measure the distance along the vertical and horizontal sides of the triangle. The vertical distance is called the rise and the horizontal distance is called the run.

Find the slope of a line from its graph using m=riserunm = \tfrac{\text{rise}}{\text{run}}.

  1. Locate two points on the line whose coordinates are integers.
  2. Starting with one point, sketch a right triangle, going from the first point to the second point.
  3. Count the rise and the run on the legs of the triangle.
  4. Take the ratio of rise to run to find the slope: m=riserunm = \tfrac{\text{rise}}{\text{run}}.

Example. Find the slope of the line shown.

xy(0, 5)(3, 3)rise = −2run = 3

Locate two points on the graph whose coordinates are integers: (0,5)(0,5) and (3,3)(3,3). Starting at (0,5)(0,5), sketch a right triangle to (3,3)(3,3). Count the rise—since it goes down, it is negative. The rise is 2-2. Count the run. The run is 33. Use the slope formula and substitute the values:

Use the slope formula.m=riserunSubstitute the values.m=23Simplify.m=23 \begin{array}{lrcl} \text{Use the slope formula.} & m &=& \tfrac{\text{rise}}{\text{run}} \\[4pt] \text{Substitute the values.} & m &=& \tfrac{-2}{3} \\[4pt] \text{Simplify.} & m &=& -\tfrac{2}{3} \end{array}

The slope of the line is 23-\tfrac{2}{3}. So yy decreases by 22 units as xx increases by 33 units.

Find the slope of the line through the points (2,1)(-2,1) and (1,3)(1,-3).

Find the slope of the line through the points (3,3)(-3,3) and (2,0)(2,0).

How do we find the slope of horizontal and vertical lines? For the horizontal line y=4y=4, the rise is 00 and the run is 33, so m=03=0m=\tfrac{0}{3}=0. For the vertical line x=3x=3, the rise is 22 and the run is 00. Its slope is undefined since division by zero is undefined.

Slope of a horizontal and vertical line. The slope of a horizontal line, y=by=b, is 00. The slope of a vertical line, x=ax=a, is undefined.

Example. Find the slope of each line: (a) x=8x=8 (b) y=5y=-5.

(a) x=8x=8 is a vertical line. Its slope is undefined.

(b) y=5y=-5 is a horizontal line. It has slope 00.

Find the slope of the line x=4x=-4.

Find the slope of the line y=7y=7.

Sometimes we’ll need to find the slope of a line between two points when we don’t have a graph to count out the rise and the run. We could plot the points on grid paper, then count out the rise and the run, but there is a way to find the slope without graphing.

We use (x1,y1)(x_1,y_1) to identify the first point and (x2,y2)(x_2,y_2) to identify the second point. The rise can be found by subtracting the yy-coordinates, and the run can be found by subtracting the xx-coordinates.

Slope of a line between two points. The slope of the line between two points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) is

m=y2y1x2x1.m=\frac{y_2-y_1}{x_2-x_1}.

The slope is yy of the second point minus yy of the first point, over xx of the second point minus xx of the first point.

Example. Use the slope formula to find the slope of the line through the points (2,3)(-2,-3) and (7,4)(-7,4).

We’ll call (2,3)(-2,-3) point #1 and (7,4)(-7,4) point #2. Use the slope formula, substitute the values, and simplify:

Use the slope formula.m=y2y1x2x1Substitute the values.m=4(3)7(2)Simplify.m=75=75 \begin{array}{lrcl} \text{Use the slope formula.} & m &=& \tfrac{y_2-y_1}{x_2-x_1} \\[10pt] \text{Substitute the values.} & m &=& \tfrac{4-(-3)}{-7-(-2)} \\[10pt] \text{Simplify.} & m &=& \tfrac{7}{-5} \\[10pt] &&=& -\tfrac{7}{5} \end{array}

Use the slope formula to find the slope through (3,4)(-3,4) and (2,1)(2,-1).

Use the slope formula to find the slope through (2,6)(-2,6) and (3,4)(-3,-4).

Graph a line given a point and the slope

Up to now, in this chapter, we have graphed lines by plotting points, by using intercepts, and by recognizing horizontal and vertical lines. We can also graph a line when we know one point and the slope of the line. We will start by plotting the point and then use the definition of slope to draw the graph of the line.

Example. How to graph a line given a point and the slope. Graph the line passing through the point (1,1)(1,-1) whose slope is m=34m=\tfrac{3}{4}.

Plot (1,1)(1,-1). Identify the rise and run: m=34m=\tfrac{3}{4}, so rise =3=3 and run =4=4. Start at (1,1)(1,-1) and count up 33 units and right 44 units. Connect the two points with a line.

xy(1, −1)(5, 2)34

You can check your work by finding a third point. Since the slope is m=34m=\tfrac{3}{4}, it can also be written as m=34m=\tfrac{-3}{-4} (negative divided by negative is positive!). Go back to (1,1)(1,-1) and count out the rise, 3-3, and the run, 4-4.

Graph the line through (2,2)(2,-2) with slope m=43m=\tfrac{4}{3}. Starting at the given point and using the rise and run, enter the second point.

Graph a line given a point and the slope.

  1. Plot the given point.
  2. Use m=riserunm=\tfrac{\text{rise}}{\text{run}} to identify the rise and the run.
  3. Starting at the given point, count out the rise and run to mark the second point.
  4. Connect the points with a line.

Graph a line using its slope and intercept

We have graphed linear equations by plotting points, using intercepts, recognizing horizontal and vertical lines, and using one point and the slope of the line. Once we see how an equation in slope-intercept form and its graph are related, we’ll have one more method we can use to graph lines.

Let’s look at the graph of y=12x+3y=\tfrac{1}{2}x+3 and find its slope and yy-intercept.

xy(0, 3)(4, 5)y = ½x + 3

The red lines in the source graph show us the rise is 11 and the run is 22. Substituting into the slope formula gives m=12m=\tfrac{1}{2}. The yy-intercept is (0,3)(0,3).

When a linear equation is solved for yy, the coefficient of the xx term is the slope and the constant term is the yy-coordinate of the yy-intercept. We say that y=12x+3y=\tfrac{1}{2}x+3 is in slope-intercept form. Sometimes the slope-intercept form is called the “yy-form.”

Slope-intercept form of an equation of a line. The slope-intercept form of an equation of a line with slope mm and yy-intercept (0,b)(0,b) is

y=mx+b.y=mx+b.

Example. Identify the slope and yy-intercept of the line from each equation: (a) y=47x2y=-\tfrac{4}{7}x-2 (b) x+3y=9x+3y=9.

(a) Compare y=47x2y=-\tfrac{4}{7}x-2 to y=mx+by=mx+b. The slope is m=47m=-\tfrac{4}{7} and the yy-intercept is (0,2)(0,-2).

(b) When an equation of a line is not given in slope-intercept form, our first step will be to solve the equation for yy:

Solve for y.x+3y=9Subtract x from each side.3y=x+9Divide both sides by 3.3y3=x+93Simplify.y=13x+3 \begin{array}{lrcl} \text{Solve for }y. & x+3y &=& 9 \\[4pt] \text{Subtract }x\text{ from each side.} & 3y &=& -x+9 \\[10pt] \text{Divide both sides by }3. & \tfrac{3y}{3} &=& \tfrac{-x+9}{3} \\[10pt] \text{Simplify.} & y &=& -\tfrac{1}{3}x+3 \end{array}

The slope is m=13m=-\tfrac{1}{3} and the yy-intercept is (0,3)(0,3).

Identify the slope of x+4y=8x+4y=8.

Example. Graph y=x+4y=-x+4 using its slope and yy-intercept.

The equation is in slope-intercept form. Identify m=1m=-1 and the yy-intercept (0,4)(0,4). Plot the yy-intercept. Write m=11m=\tfrac{-1}{1}, so the rise is 1-1 and the run is 11. Count out the rise and run to mark the second point. Draw the line.

xy

Graph y=x3y=-x-3 using its slope and y-intercept. Enter the y-intercept.

Choose the most convenient method to graph a line

Now that we have seen several methods we can use to graph lines, how do we know which method to use for a given equation? While we could plot points, use the slope-intercept form, or find the intercepts for any equation, if we recognize the most convenient way to graph a certain type of equation, our work will be easier. Generally, plotting points is not the most efficient way to graph a line.

EquationMethod
x=2x=2Vertical line
y=1y=-1Horizontal line
x+2y=6-x+2y=6Intercepts
4x3y=124x-3y=12Intercepts
y=x+4y=-x+4Slope-intercept

Strategy for choosing the most convenient method to graph a line. Consider the form of the equation.

  • If it only has one variable, it is a vertical or horizontal line.
    • x=ax=a is a vertical line passing through the xx-axis at aa.
    • y=by=b is a horizontal line passing through the yy-axis at bb.
  • If yy is isolated on one side of the equation, in the form y=mx+by=mx+b, graph by using the slope and yy-intercept.
    • Identify the slope and yy-intercept and then graph.
  • If the equation is of the form Ax+By=CAx+By=C, find the intercepts.
    • Find the xx- and yy-intercepts, a third point, and then graph.

Example. Determine the most convenient method to graph each line: (a) y=5y=5 (b) 4x5y=204x-5y=20 (c) x=3x=-3 (d) y=59x+8y=-\tfrac{5}{9}x+8.

(a) This equation has only one variable, yy. Its graph is a horizontal line crossing the yy-axis at 55.

(b) This equation is of the form Ax+By=CAx+By=C. The easiest way to graph it will be to find the intercepts and one more point.

(c) There is only one variable, xx. The graph is a vertical line crossing the xx-axis at 3-3.

(d) Since this equation is in y=mx+by=mx+b form, it will be easiest to graph this line by using the slope and yy-intercept.

What is the most convenient method to graph 4x3y=14x-3y=-1?

Graph and interpret applications of slope-intercept

Many real-world applications are modeled by linear equations. We will take a look at a few applications here so you can see how equations written in slope-intercept form relate to real world situations. Usually, when a linear equation models uses real-world data, different letters are used for the variables, instead of using only xx and yy. The variable names remind us of what quantities are being measured. Also, we often will need to extend the axes in our rectangular coordinate system to bigger positive and negative numbers to accommodate the data in the application.

Example. The equation F=95C+32F=\tfrac{9}{5}C+32 is used to convert temperatures, CC, on the Celsius scale to temperatures, FF, on the Fahrenheit scale.

(a) Find the Fahrenheit temperature for a Celsius temperature of 00.

F=95(0)+32=32F=\tfrac{9}{5}(0)+32=32

(b) Find the Fahrenheit temperature for a Celsius temperature of 2020.

F=95(20)+32=36+32=68F=\tfrac{9}{5}(20)+32=36+32=68

(c) Interpret the slope and FF-intercept of the equation. Even though this equation uses FF and CC, it is still in slope-intercept form. The slope, 95\tfrac{9}{5}, means that the temperature Fahrenheit (FF) increases 99 degrees when the temperature Celsius (CC) increases 55 degrees. The FF-intercept means that when the temperature is 0° on the Celsius scale, it is 32°32° on the Fahrenheit scale.

(d) Graph the equation. Start at the FF-intercept (0,32)(0,32), and then count out the rise of 99 and the run of 55 to get a second point.

CF

The equation h=2s+50h=2s+50 estimates a woman's height in inches from shoe size ss. Estimate the height when s=8s=8.

The cost of running some types of business has two components—a fixed cost and a variable cost. The fixed cost is always the same regardless of how many units are produced. The variable cost depends on the number of units produced. It is for the material and labor needed to produce each item.

Example. Sam drives a delivery van. The equation C=0.5m+60C=0.5m+60 models the relation between his weekly cost, CC, in dollars and the number of miles, mm, that he drives.

(a) Find Sam’s cost for a week when he drives 00 miles: C=0.5(0)+60=60C=0.5(0)+60=60. Sam’s costs are $60 when he drives 00 miles.

(b) Find the cost for a week when he drives 250250 miles: C=0.5(250)+60=185C=0.5(250)+60=185. Sam’s costs are $185 when he drives 250250 miles.

(c) Interpret the slope and CC-intercept. The slope, 0.50.5, means that the weekly cost, CC, increases by $0.50 when the number of miles driven, mm, increases by 11. The CC-intercept means that when the number of miles driven is 00, the weekly cost is $60.

(d) Graph the equation. Start at the CC-intercept (0,60)(0,60). To count out the slope m=0.5m=0.5, rewrite it as an equivalent fraction: m=0.5=0.51=50100m=0.5=\tfrac{0.5}{1}=\tfrac{50}{100}. Go up 5050 from the intercept of 6060 and then right 100100. The second point is (100,110)(100,110).

mC

Stella's weekly cost is C=4p+25C=4p+25. Find her cost when she sells 1515 pizzas.

Use slopes to identify parallel and perpendicular lines

Two lines that have the same slope are called parallel lines. Parallel lines have the same steepness and never intersect. Two lines that have the same slope and different yy-intercepts are called parallel lines.

xy

What about vertical lines? The slope of a vertical line is undefined, so vertical lines don’t fit in the definition above. We say that vertical lines that have different xx-intercepts are parallel.

Parallel lines. Parallel lines are lines in the same plane that do not intersect.

  • Parallel lines have the same slope and different yy-intercepts.
  • If m1m_1 and m2m_2 are the slopes of two parallel lines then m1=m2m_1=m_2.
  • Parallel vertical lines have different xx-intercepts.

Example. Use slopes and yy-intercepts to determine if the lines are parallel: (a) 3x2y=63x-2y=6 and y=32x+1y=\tfrac{3}{2}x+1 (b) y=2x3y=2x-3 and 6x+3y=9-6x+3y=-9.

(a) Solve the first equation for yy:

3x2y=6,2y=3x+6,y=32x3.3x-2y=6,\quad -2y=-3x+6,\quad y=\frac{3}{2}x-3.

The second line is already y=32x+1y=\tfrac{3}{2}x+1. The lines have the same slope and different yy-intercepts and so they are parallel.

(b) Solving 6x+3y=9-6x+3y=-9 gives y=2x3y=2x-3. The lines have the same slope, but they also have the same yy-intercepts. Their equations represent the same line and we say the lines are coincident. They are not parallel; they are the same line.

Example. Use slopes and yy-intercepts to determine if the lines are parallel: (a) y=4y=-4 and y=3y=3 (b) x=2x=-2 and x=5x=-5.

(a) These are horizontal lines and so their slopes are both 00. Their yy-intercepts are (0,4)(0,-4) and (0,3)(0,3). The lines have the same slope and different yy-intercepts and so they are parallel.

(b) These are vertical lines and their slopes are undefined. They cross the xx-axis at x=2x=-2 and x=5x=-5. The lines are vertical and have different xx-intercepts and so they are parallel.

Are the lines y=8y=8 and y=6y=-6 parallel?

The lines y=14x1y=\tfrac{1}{4}x-1 and y=4x+2y=-4x+2 lie in the same plane and intersect in right angles. We call these lines perpendicular. Their slopes are negative reciprocals of each other, and their product is 1-1:

m1m2=14(4)=1.m_1\cdot m_2=\frac{1}{4}(-4)=-1.
xyy = ¼x − 1y = −4x + 2

Perpendicular lines. Perpendicular lines are lines in the same plane that form a right angle.

  • If m1m_1 and m2m_2 are the slopes of two perpendicular lines, then their slopes are negative reciprocals, m1=1m2m_1=-\tfrac{1}{m_2}, and the product of their slopes is 1-1, m1m2=1m_1\cdot m_2=-1.
  • A vertical line and a horizontal line are always perpendicular to each other.

Example. Use slopes to determine if the lines are perpendicular: (a) y=5x4y=-5x-4 and x5y=5x-5y=5 (b) 7x+2y=37x+2y=3 and 2x+7y=52x+7y=5.

(a) The first equation is in slope-intercept form. Solve the second equation for yy: x5y=5x-5y=5, 5y=x+5-5y=-x+5, y=15x1y=\tfrac{1}{5}x-1. The slopes are m1=5m_1=-5 and m2=15m_2=\tfrac{1}{5}. They are negative reciprocals, so the lines are perpendicular. Since 5(15)=1-5(\tfrac{1}{5})=-1, it checks.

(b) Solve the equations for yy: y=72x+32y=-\tfrac{7}{2}x+\tfrac{3}{2} and y=27x+57y=-\tfrac{2}{7}x+\tfrac{5}{7}. The slopes are reciprocals of each other, but they have the same sign. Since they are not negative reciprocals, the lines are not perpendicular.

Are y=3x+2y=-3x+2 and x3y=4x-3y=4 perpendicular?

Key terms

slope — the measure of the steepness of a line; the ratio of rise to run. slope formulam=y2y1x2x1m=\tfrac{y_2-y_1}{x_2-x_1}, used to find the slope between two points. slope-intercept formy=mx+by=mx+b, where mm is the slope and (0,b)(0,b) is the yy-intercept. fixed cost — a business cost that does not change with the number of units produced. variable cost — a business cost that changes with the number of units produced. parallel lines — lines in the same plane that do not intersect. perpendicular lines — lines in the same plane that form a right angle.


This section is adapted from Intermediate Algebra 2e, Section 3.2: Slope of a Line by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated coordinate-plane figures as accessible interactive graphs; omitted the Be Prepared quiz, Media links, self-check, and section exercises; and converted the source Try Its into interactive exercises with instant feedback.