Login
📚 Elementary Algebra 2e
Chapters ▾
⇩ Download ▾

4.6 Find the Equation of a Line

How do online retailers know that ‘you may also like’ a particular item based on something you just ordered? How can economists know how a rise in the minimum wage will affect the unemployment rate? How do medical researchers create drugs to target cancer cells? How can traffic engineers predict the effect on your commuting time of an increase or decrease in gas prices? It’s all mathematics.

You are at an exciting point in your mathematical journey as the mathematics you are studying has interesting applications in the real world.

The physical sciences, social sciences, and the business world are full of situations that can be modeled with linear equations relating two variables. Data is collected and graphed. If the data points appear to form a straight line, an equation of that line can be used to predict the value of one variable based on the value of the other variable.

To create a mathematical model of a linear relation between two variables, we must be able to find the equation of the line. In this section we will look at several ways to write the equation of a line. The specific method we use will be determined by what information we are given.

Find an Equation of the Line Given the Slope and y-Intercept

We can easily determine the slope and intercept of a line if the equation was written in slope–intercept form, y=mx+b. Now, we will do the reverse—we will start with the slope and y-intercept and use them to find the equation of the line.

Sometimes, the slope and intercept need to be determined from the graph.

Find an Equation of the Line Given the Slope and a Point

Finding an equation of a line using the slope–intercept form of the equation works well when you are given the slope and y-intercept or when you read them off a graph. But what happens when you have another point instead of the y-intercept?

We are going to use the slope formula to derive another form of an equation of the line. Suppose we have a line that has slope m and that contains some specific point (x1,y1) and some other point, which we will just call (x,y). We can write the slope of this line and then change it to a different form.

Table 4.47
m=yy1xx1
Multiply both sides of the equation by xx1. m(xx1)=(yy1xx1)(xx1)
Simplify. m(xx1)=yy1
Rewrite the equation with the y terms on the left. yy1=m(xx1)

This format is called the point–slope form of an equation of a line.

We can use the point–slope form of an equation to find an equation of a line when we are given the slope and one point. Then we will rewrite the equation in slope–intercept form. Most applications of linear equations use the the slope–intercept form.

Find an Equation of the Line Given Two Points

When real-world data is collected, a linear model can be created from two data points. In the next example we’ll see how to find an equation of a line when just two points are given.

We have two options so far for finding an equation of a line: slope–intercept or point–slope. Since we will know two points, it will make more sense to use the point–slope form.

But then we need the slope. Can we find the slope with just two points? Yes. Then, once we have the slope, we can use it and one of the given points to find the equation.

We have seen that we can use either the slope–intercept form or the point–slope form to find an equation of a line. Which form we use will depend on the information we are given. This is summarized in Table 4.48.

Find an Equation of a Line Parallel to a Given Line

Suppose we need to find an equation of a line that passes through a specific point and is parallel to a given line. We can use the fact that parallel lines have the same slope. So we will have a point and the slope—just what we need to use the point–slope equation.

First let’s look at this graphically.

The graph shows the graph of y=2x3. We want to graph a line parallel to this line and passing through the point (−2,1).

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 7 to 7. The line whose equation is y equals 2x minus 3 intercepts the y-axis at (0, negative 3) and intercepts the x-axis at (3 halves, 0). Elsewhere on the graph, the point (negative 2, 1) is plotted.

We know that parallel lines have the same slope. So the second line will have the same slope asy=2x3. That slope ism=2. We’ll use the notation m to represent the slope of a line parallel to a line with slope m. (Notice that the subscript looks like two parallel lines.)

The second line will pass through (−2,1) and have m=2. To graph the line, we start at(−2,1) and count out the rise and run. With m=2 (or m=21), we count out the rise 2 and the run 1. We draw the line.

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 7 to 7. The line whose equation is y equals 2x minus 3 intercepts the y-axis at (0, negative 3) and intercepts the x-axis at (3 halves, 0). The points (negative 2, 1) and (negative 1, 3) are plotted. A second line, parallel to the first, intercepts the x-axis at (negative 5 halves, 0), passes through the points (negative 2, 1) and (negative 1, 3), and intercepts the y-axis at (0, 5).

Do the lines appear parallel? Does the second line pass through (−2,1)?

Now, let’s see how to do this algebraically.

We can use either the slope–intercept form or the point–slope form to find an equation of a line. Here we know one point and can find the slope. So we will use the point–slope form.

Find an Equation of a Line Perpendicular to a Given Line

Now, let’s consider perpendicular lines. Suppose we need to find a line passing through a specific point and which is perpendicular to a given line. We can use the fact that perpendicular lines have slopes that are negative reciprocals. We will again use the point–slope equation, like we did with parallel lines.

The graph shows the graph of y=2x3. Now, we want to graph a line perpendicular to this line and passing through (−2,1).

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 7 to 7. The line whose equation is y equals 2x minus 3 intercepts the y-axis at (0, negative 3) and intercepts the x-axis at (3 halves, 0). Elsewhere on the graph, the point (negative 2, 1) is plotted.

We know that perpendicular lines have slopes that are negative reciprocals. We’ll use the notation m to represent the slope of a line perpendicular to a line with slope m. (Notice that the subscript ⊥ looks like the right angles made by two perpendicular lines.)

y=2x3perpendicular line m=2m=12

We now know the perpendicular line will pass through (−2,1) with m=12.

To graph the line, we will start at (−2,1) and count out the rise −1 and the run 2. Then we draw the line.

Graph of two lines in x y-plane. The first line, y equals 2x minus 3, intersects the y-axis at negative 3 and the x-axis at one and a half, zero. A second line passes through negative 2, 1, forming a right triangle with the first line.

Do the lines appear perpendicular? Does the second line pass through (−2,1)?

Now, let’s see how to do this algebraically. We can use either the slope–intercept form or the point–slope form to find an equation of a line. In this example we know one point, and can find the slope, so we will use the point–slope form.

In Example 11, we used the point–slope form to find the equation. We could have looked at this in a different way.

We want to find a line that is perpendicular to x=5 that contains the point (3,−2). The graph shows us the linex=5 and the point (3,−2).

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 7 to 7. The line whose equation is x equals 5 intercepts the x-axis at (5, 0) and runs parallel to the y-axis. Elsewhere on the graph, the point (3, negative 2) is plotted.

We know every line perpendicular to a vetical line is horizontal, so we will sketch the horizontal line through (3,−2).

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 7 to 7. The line whose equation is x equals 5 intercepts the x-axis at (5, 0) and runs parallel to the y-axis. Elsewhere on the graph, the points (negative 2, negative 2), (0, negative 2), (3, negative 2), and (6, negative 2) are plotted. A line perpendicular to the previous line passes through those points and runs parallel to the x-axis.

Do the lines appear perpendicular?

If we look at a few points on this horizontal line, we notice they all have y-coordinates of −2. So, the equation of the line perpendicular to the vertical line x=5 is y=−2.

Key Concepts

  • To Find an Equation of a Line Given the Slope and a Point
    1. Identify the slope.
    2. Identify the point.
    3. Substitute the values into the point-slope form, yy1=m(xx1).
    4. Write the equation in slope-intercept form.
  • To Find an Equation of a Line Given Two Points
    1. Find the slope using the given points.
    2. Choose one point.
    3. Substitute the values into the point-slope form, yy1=m(xx1).
    4. Write the equation in slope-intercept form.
  • To Write and Equation of a Line
    • If given slope and y-intercept, use slope–intercept form y=mx+b.
    • If given slope and a point, use point–slope form yy1=m(xx1).
    • If given two points, use point–slope form yy1=m(xx1).
  • To Find an Equation of a Line Parallel to a Given Line
    1. Find the slope of the given line.
    2. Find the slope of the parallel line.
    3. Identify the point.
    4. Substitute the values into the point-slope form, yy1=m(xx1).
    5. Write the equation in slope-intercept form.
  • To Find an Equation of a Line Perpendicular to a Given Line
    1. Find the slope of the given line.
    2. Find the slope of the perpendicular line.
    3. Identify the point.
    4. Substitute the values into the point-slope form, yy1=m(xx1).
    5. Write the equation in slope-intercept form.

Practice Makes Perfect

Find an Equation of the Line Given the Slope and y-Intercept

In the following exercises, find the equation of a line with given slope and y-intercept. Write the equation in slope–intercept form.

slope 3 and y-intercept (0,5)

slope 4 and y-intercept (0,1)

y=4x+1

slope 6 and y-intercept (0,−4)

slope 8 and y-intercept (0,−6)

y=8x6

slope −1 and y-intercept (0,3)

slope −1 and y-intercept (0,7)

y=x+7

slope −2 and y-intercept (0,−3)

slope −3 and y-intercept (0,−1)

y=−3x1

slope 35 and y-intercept (0,−1)

slope 15 and y-intercept (0,−5)

y=15x5

slope 34 and y-intercept (0,−2)

slope 23 and y-intercept (0,−3)

y=23x3

slope 0 and y-intercept (0,−1)

slope 0 and y-intercept (0,2)

y=2

slope −3 and y-intercept (0,0)

slope −4 and y-intercept (0,0)

y=−4x

In the following exercises, find the equation of the line shown in each graph. Write the equation in slope–intercept form.

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (1, negative 2) is plotted. A line intercepts the y-axis at (0, negative 5), passes through the point (1, negative 2), and intercepts the x-axis at (5 thirds, 0).
The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (2, 0) is plotted. A line intercepts the y-axis at (0, 4) and intercepts the x-axis at (2, 0).

y=−2x+4

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (6, 0) is plotted. A line intercepts the y-axis at (0, negative 3) and intercepts the x-axis at (6, 0).
The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (4, 5) is plotted. A line intercepts the x-axis at (negative 8 thirds, 0), intercepts the y-axis at (0, 2), and passes through the point (4, 5).

y=34x+2

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (3, negative 1) is plotted. A line intercepts the y-axis at (0, 2), intercepts the x-axis at (9 fourths, 0), and passes through the point (3, negative 1).
The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (2, negative 4) is plotted. A line intercepts the x-axis at (negative 2 thirds, 0), intercepts the y-axis at (0, negative 1), and passes through the point (2, negative 4).

y=32x1

The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (2, negative 2) is plotted. A line running parallel to the x-axis intercepts the y-axis at (0, negative 2) and passes through the point (2, negative 2).
The graph shows the x y-coordinate plane. The x and y-axes each run from negative 9 to 9. The point (negative 3, 6) is plotted. A line running parallel to the x-axis passes through (negative 3, 6) and intercepts the y-axis at (0, 6).

y=6

Find an Equation of the Line Given the Slope and a Point

In the following exercises, find the equation of a line with given slope and containing the given point. Write the equation in slope–intercept form.

m=58, point (8,3)

m=38, point (8,2)

y=38x1

m=16, point (6,1)

m=56, point (6,7)

y=56x+2

m=34, point (8,−5)

m=35, point (10,−5)

y=35x+1

m=14, point (−12,−6)

m=13, point (−9,−8)

y=13x11

Horizontal line containing (−2,5)

Horizontal line containing (−1,4)

y=4

Horizontal line containing (−2,−3)

Horizontal line containing (−1,−7)

y=−7

m=32, point (−4,−3)

m=52, point (−8,−2)

y=52x22

m=−7, point (−1,−3)

m=−4, point (−2,−3)

y=−4x11

Horizontal line containing (2,−3)

Horizontal line containing (4,−8)

y=−8

Find an Equation of the Line Given Two Points

In the following exercises, find the equation of a line containing the given points. Write the equation in slope–intercept form.

(2,6) and (5,3)

(3,1) and (2,5)

y=−4x+13

(4,3) and (8,1)

(2,7) and (3,8)

y=x+5

(−3,−4) and (52)

(−5,−3) and (4,−6)

y=13x143

(−1,3) and (−6,−7)

(−2,8) and (−4,−6)

y=7x+22

(6,−4) and (−2,5)

(3,−2) and (−4,4)

y=67x+47

(0,4) and (2,−3)

(0,−2) and (−5,−3)

y=15x2

(7,2) and (7,−2)

(4,2) and (4,−3)

x=4

(−7,−1) and (−7,−4)

(−2,1) and (−2,−4)

x=−2

(6,1) and (0,1)

(6,2) and (−3,2)

y=2

(3,−4) and (5,−4)

(−6,−3) and (−1,−3)

y=−3

(4,3) and (8,0)

(0,0) and (1,4)

y=4x

(−2,−3) and (−5,−6)

(−3,0) and (−7,−2)

y=12x+32

(8,−1) and (8,−5)

(3,5) and (−7,5)

y=5

Find an Equation of a Line Parallel to a Given Line

In the following exercises, find an equation of a line parallel to the given line and contains the given point. Write the equation in slope–intercept form.

line y=4x+2, point (1,2)

line y=3x+4, point (2,5)

y=3x1

line y=−2x3, point (−1,3)

line y=−3x1, point (2,−3)

y=−3x+3

line 3xy=4, point (3,1)

line 2xy=6, point (3,0)

y=2x6

line 4x+3y=6, point (0,−3)

line 2x+3y=6, point (0,5)

y=23x+5

line x=−3, point (−2,−1)

line x=−4, point (−3,−5)

x=−3

line x2=0, point (1,−2)

line x6=0, point (4,−3)

x=4

line y=5, point (2,−2)

line y=1, point (3,−4)

y=−4

line y+2=0, point (3,−3)

line y+7=0, point (1,−1)

y=−1

Find an Equation of a Line Perpendicular to a Given Line

In the following exercises, find an equation of a line perpendicular to the given line and contains the given point. Write the equation in slope–intercept form.

line y=−2x+3, point (2,2)

line y=x+5, point (3,3)

y=x

line y=34x2, point (−3,4)

line y=23x4, point (2,−4)

y=32x1

line 2x3y=8, point (4,−1)

line 4x3y=5, point (−3,2)

y=34x14

line 2x+5y=6, point (0,0)

line 4x+5y=−3, point (0,0)

y=54x

line y3=0, point (−2,−4)

line y6=0, point (−5,−3)

x=−5

line y-axis, point (3,4)

line y-axis, point (2,1)

y=1

Mixed Practice

In the following exercises, find the equation of each line. Write the equation in slope–intercept form.

Containing the points (4,3) and (8,1)

Containing the points (2,7) and (3,8)

y=x+5

m=16, containing point (6,1)

m=56, containing point (6,7)

y=56x+2

Parallel to the line 4x+3y=6, containing point (0,−3)

Parallel to the line 2x+3y=6, containing point (0,5)

y=23x+5

m=34, containing point (8,−5)

m=35, containing point (10,−5)

y=35x+1

Perpendicular to the line y1=0, point (−2,6)

Perpendicular to the line y-axis, point (−6,2)

y=2

Containing the points (4,3) and (8,1)

Containing the points (−2,0) and (−3,−2)

y=2x+4

Parallel to the line x=−3, containing point (−2,−1)

Parallel to the line x=−4, containing point (−3,−5)

x=−3

Containing the points (−3,−4) and (2,−5)

Containing the points (−5,−3) and (4,−6)

y=13x143

Perpendicular to the line x2y=5, containing point (−2,2)

Perpendicular to the line 4x+3y=1, containing point (0,0)

y=34x

Everyday Math

Cholesterol. The age, x, and LDL cholesterol level, y, of two men are given by the points (18,68) and (27,122). Find a linear equation that models the relationship between age and LDL cholesterol level.

Fuel consumption. The city mpg, x, and highway mpg, y, of two cars are given by the points (29,40) and(19,28). Find a linear equation that models the relationship between city mpg and highway mpg.

y=1.2x+5.2

Writing Exercises

Why are all horizontal lines parallel?

Explain in your own words why the slopes of two perpendicular lines must have opposite signs.

Answers will vary.

Self Check

ⓐ After completing the exercises, use this checklist to evaluate your mastery of the objectives of this section.

Table assessing student understanding of finding linear equations. Columns: "I can...", "confidently", "with some help", "no-I don’t get it!". Rows describe skills, including finding equations from slope/intercept, slope/point, two points, parallel lines, and perpendicular lines.

ⓑ On a scale of 1-10, how would you rate your mastery of this section in light of your responses on the checklist? How can you improve this?