maths.freeAlgebra › 3. Graphs and Functions › Find the Equation of a Line

Find the Equation of a Line

Find an equation of the line given the slope and

Find an Equation of the Line Given the Slope and

We can easily determine the slope and intercept of a line if the equation is 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.

Example

Try it.

Find the equation of a line with slope \(-9\) and y-intercept \((0,-4).\)

Solution

Since we are given the slope and y-intercept of the line, we can substitute the needed values into the slope-intercept form, \(y=mx+b.\)

Name the slope.
Name the y-intercept.
Substitute the values into \(y=mx+b.\)

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

Example

Try it.

Find the equation of the line shown in the graph.

Solution

We need to find the slope and y-intercept of the line from the graph so we can substitute the needed values into the slope-intercept form, \(y=mx+b.\)

To find the slope, we choose two points on the graph.

The y-intercept is \((0,-4)\) and the graph passes through \((3,-2).\)

Find the slope, by counting the rise and run.
Find the y-intercept.
Substitute the values into \(y=mx+b.\)

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 \(({x}_{1},{y}_{1})\) 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.

\(\ m=\frac{y-{y}_{1}}{x-{x}_{1}}\)
Multiply both sides of the equation by \(x-{x}_{1}.\)\(m(x-{x}_{1})=(\frac{y-{y}_{1}}{x-{x}_{1}})(x-{x}_{1})\)
Simplify.\(m(x-{x}_{1})=y-{y}_{1}\)
Rewrite the equation with the \(y\) terms on the left.\(\ y-{y}_{1}=m(x-{x}_{1})\)

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 know the slope and at least one point. Then, we will rewrite the equation in slope-intercept form. Most applications of linear equations use the the slope-intercept form.

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

Try it.

Find an equation of a line with slope \(m=-\frac{1}{3}\) that contains the point \((6,-4).\) Write the equation in slope-intercept form.

Solution

We list the steps for easy reference.

Example

Try it.

Find an equation of a horizontal line that contains the point \((-2,-6).\) Write the equation in slope-intercept form.

Solution

Every horizontal line has slope 0. We can substitute the slope and points into the point-slope form, \(y-{y}_{1}=m(x-{x}_{1}).\)

Identify the slope.
Identify the point.
Substitute the values into \(y-{y}_{1}=m(x-{x}_{1}).\)
Simplify.
Write in slope-intercept form.It is in y-form, but could be written \(y=0x-6.\)

Did we end up with the form of a horizontal line, \(y=b?\)

Condensed — the full section is in OpenStax Intermediate Algebra 2e.

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.

So far, we have two options for finding an equation of a line: slope-intercept or point-slope. When we start with two points, it makes 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.

How to Find the Equation of a Line Given Two Points

Try it.

Find an equation of a line that contains the points \((-3,-1)\) and \((2,-2)\) Write the equation in slope-intercept form.

Solution

The steps are summarized here.

Example

Try it.

Find an equation of a line that contains the points \((-3,5)\) and \((-3,4).\) Write the equation in slope-intercept form.

Solution

Again, the first step will be to find the slope.

Find the slope of the line through \((-3,5)\) and \((-3,4).\)\(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\)
\(m=\frac{4-5}{-3-(-3)}\)
\(m=\frac{-1}{0}\)
The slope is undefined.

This tells us it is a vertical line. Both of our points have an x-coordinate of \(-3.\) So our equation of the line is \(x=-3.\) Since there is no y, we cannot write it in slope-intercept form.

You may want to sketch a graph using the two given points. Does your graph agree with our conclusion that this is a vertical line?

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.

To Write an Equation of a Line
If given:Use:Form:
Slope and y-interceptslope-intercept\(y=mx+b\)
Slope and a pointpoint-slope\(y-{y}_{1}=m(x-{x}_{1})\)
Two pointspoint-slope\(y-{y}_{1}=m(x-{x}_{1})\)

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.

This graph shows \(y=2x-3.\) We want to graph a line parallel to this line and passing through the point \((-2,1).\)

We know that parallel lines have the same slope. So the second line will have the same slope as \(y=2x-3.\) That slope is \({m}_{∥}=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=\frac{2}{1}\)), we count out the rise 2 and the run 1. We draw the line, as shown in the graph.

How to Find the Equation of a Line Parallel to a Given Line and a Point

Try it.

Find an equation of a line parallel to \(y=2x-3\) that contains the point \((-2,1).\) Write the equation in slope-intercept form.

Solution

Look at graph with the parallel lines shown previously. Does this equation make sense? What is the y-intercept of the line? What is the slope?

Condensed — the full section is in OpenStax Intermediate Algebra 2e.

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.

This graph shows \(y=2x-3.\) Now, we want to graph a line perpendicular to this line and passing through \((-2,1).\)

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.)

\[\begin{array}{llll}y=2x-3 & & & \text{perpendicular line} \\ m=2 & & & {m}_{⊥}=-\frac{1}{2}\end{array}\]

We now know the perpendicular line will pass through \((-2,1)\) with \({m}_{⊥}=-\frac{1}{2}.\)

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.

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

How to Find the Equation of a Line Perpendicular to a Given Line and a Point

Try it.

Find an equation of a line perpendicular to \(y=2x-3\) that contains the point \((-2,1).\) Write the equation in slope-intercept form.

Solution

Condensed — the full section is in OpenStax Intermediate Algebra 2e.

Key Concepts

  • How 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, \(y-{y}_{1}=m(x-{x}_{1}).\)
    4. Write the equation in slope-intercept form.



  • How to find an equation of a line given two points.
    1. Find the slope using the given points. \(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\)
    2. Choose one point.
    3. Substitute the values into the point-slope form: \(y-{y}_{1}=m(x-{x}_{1}).\)
    4. Write the equation in slope-intercept form.
      To Write an Equation of a Line
      If given:Use:Form:
      Slope and y-interceptslope-intercept\(y=mx+b\)
      Slope and a pointpoint-slope\(y-{y}_{1}=m(x-{x}_{1})\)
      Two pointspoint-slope\(y-{y}_{1}=m(x-{x}_{1})\)
  • How 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: \(y-{y}_{1}=m(x-{x}_{1}).\)
    5. Write the equation in slope-intercept form
  • How 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, \(y-{y}_{1}=m(x-{x}_{1})\)
    5. Write the equation in slope-intercept form.

Find the Equation of a Line

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.

Try it.

slope 3 and
\(y\)-intercept \((0,5)\)

Solution

\(y=3x+5\)

Try it.

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

Try it.

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

Solution

\(y=-3x-1\)

Try it.

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

Try it.

slope \(\frac{1}{5}\) and
\(y\)-intercept \((0,-5)\)

Solution

\(y=\frac{1}{5}x-5\)

Try it.

slope \(-\frac{3}{4}\) and
\(y\)-intercept \((0,-2)\)

Try it.

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

Solution

\(y=-1\)

Try it.

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

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

Try it.


Solution

\(y=3x-5\)

Try it.


Try it.


Solution

\(y=\frac{1}{2}x-3\)

Try it.


Try it.


Solution

\(y=-\frac{4}{3}x+3\)

Try it.


Try it.


Solution

\(y=-2\)

Try it.


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.

Try it.

\(m=\frac{5}{8},\) point \((8,3)\)

Solution

\(y=\frac{5}{8}x-2\)

Try it.

\(m=\frac{5}{6},\) point \((6,7)\)

Try it.

\(m=-\frac{3}{5},\) point \((10,-5)\)

Solution

\(y=-\frac{3}{5}x+1\)

Try it.

\(m=-\frac{3}{4},\) point \((8,-5)\)

Try it.

\(m=-\frac{3}{2},\) point \((-4,-3)\)

Solution

\(y=-\frac{3}{2}x-9\)

Try it.

\(m=-\frac{5}{2},\) point \((-8,-2)\)

Try it.

\(m=-7,\) point \((-1,-3)\)

Solution

\(y=-7x-10\)

Try it.

\(m=-4,\) point \((-2,-3)\)

Try it.

Horizontal line containing \((-2,5)\)

Solution

\(y=5\)

Try it.

Horizontal line containing \((-2,-3)\)

Try it.

Horizontal line containing \((-1,-7)\)

Solution

\(y=-7\)

Try it.

Horizontal line containing \((4,-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.

Try it.

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

Solution

\(y=\text{-}x+8\)

Try it.

\((4,3)\) and \((8,1)\)

Try it.

\((-3,-4)\) and \((5,-2)\)

Solution

\(y=\frac{1}{4}x-\frac{13}{4}\)

Try it.

\((-5,-3)\) and \((4,-6)\)

Try it.

\((-1,3)\) and \((-6,-7)\)

Solution

\(y=2x+5\)

Try it.

\((-2,8)\) and \((-4,-6)\)

Try it.

\((0,4)\) and \((2,-3)\)

Solution

\(y=-\frac{7}{2}x+4\)

Try it.

\((0,-2)\) and \((-5,-3)\)

Try it.

\((7,2)\) and \((7,-2)\)

Solution

\(x=7\)

Try it.

\((-2,1)\) and \((-2,-4)\)

Try it.

\((3,-4)\) and \((5,-4)\)

Solution

\(y=-4\)

Try it.

\((-6,-3)\) and \((-1,-3)\)

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.

Try it.

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

Solution

\(y=4x-2\)

Try it.

line \(y=-3x-1,\)
point \((2,-3).\)

Try it.

line \(2x-y=6,\)
point \((3,0).\)

Solution

\(y=2x-6\)

Try it.

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

Try it.

line \(x=-4,\)
point \((-3,-5).\)

Solution

\(x=-3\)

Try it.

line \(x-2=0,\)
point \((1,-2)\)

Try it.

line \(y=5,\)
point \((2,-2)\)

Solution

\(y=-2\)

Try it.

line \(y+2=0,\)
point \((3,-3)\)

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.

Try it.

line \(y=-2x+3,\)
point \((2,2)\)

Solution

\(y=\frac{1}{2}x+1\)

Try it.

line \(y=\text{-}x+5,\)
point \((3,3)\)

Try it.

line \(y=\frac{3}{4}x-2,\)
point \((-3,4)\)

Solution

\(y=-\frac{4}{3}x\)

Try it.

line \(y=\frac{2}{3}x-4,\)
point \((2,-4)\)

Try it.

line \(2x-3y=8,\)
point \((4,-1)\)

Solution

\(y=-\frac{3}{2}x+5\)

Try it.

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

Try it.

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

Solution

\(y=\frac{5}{2}x\)

Try it.

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

Try it.

line \(x=3,\)
point \((3,4)\)

Solution

\(y=4\)

Try it.

line \(x=-5,\)
point \((1,-2)\)

Try it.

line \(x=7,\)
point \((-3,-4)\)

Solution

\(y=-4\)

Try it.

line \(x=-1,\)
point \((-4,0)\)

Try it.

line \(y-3=0,\)
point \((-2,-4)\)

Solution

\(x=-2\)

Try it.

line \(y-6=0,\)
point \((-5,-3)\)

Try it.

line y-axis,
point \((3,4)\)

Solution

\(y=4\)

Try it.

line y-axis,
point \((2,1)\)

Mixed Practice

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

Try it.

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

Solution

\(y=-\frac{1}{2}x+5\)

Try it.

Containing the points \((-2,0)\) and \((-3,-2)\)

Try it.

\(m=\frac{1}{6},\) containing point \((6,1)\)

Solution

\(y=\frac{1}{6}x\)

Try it.

\(m=\frac{5}{6},\) containing point \((6,7)\)

Try it.

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

Solution

\(y=-\frac{4}{3}x-3\)

Try it.

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

Try it.

\(m=-\frac{3}{4},\) containing point \((8,-5)\)

Solution

\(y=-\frac{3}{4}x+1\)

Try it.

\(m=-\frac{3}{5},\) containing point \((10,-5)\)

Try it.

Perpendicular to the line \(y-1=0,\) point \((-2,6)\)

Solution

\(x=-2\)

Try it.

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

Try it.

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

Solution

\(x=-2\)

Try it.

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

Try it.

Containing the points \((-3,-4)\) and \((2,-5)\)

Solution

\(y=-\frac{1}{5}x-\frac{23}{5}\)

Try it.

Containing the points \((-5,-3)\) and \((4,-6)\)

Try it.

Perpendicular to the line \(x-2y=5,\) point \((-2,2)\)

Solution

\(y=-2x-2\)

Try it.

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

Condensed — the full section is in OpenStax Intermediate Algebra 2e.

Find an Equation of the Line Given the Slope and

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.

Example

Try it.

Find an equation of a line with slope \(-7\) and y-intercept \((0,-1)\).

Solution

Since we are given the slope and y-intercept of the line, we can substitute the needed values into the slope–intercept form, \(y=mx+b\).

Name the slope.
Name the y-intercept.
Substitute the values into \(y=mx+b.\)

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

Example

Try it.

Find the equation of the line shown.

Solution

We need to find the slope and y-intercept of the line from the graph so we can substitute the needed values into the slope–intercept form, \(y=mx+b\).

To find the slope, we choose two points on the graph.

The y-intercept is \((0,-4)\) and the graph passes through \((3,-2)\).

Find the slope by counting the rise and run.
Find the y-intercept.
Substitute the values into \(y=mx+b.\)

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 \(({x}_{1},{y}_{1})\) 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.

\(m=\frac{y-{y}_{1}}{x-{x}_{1}}\)
Multiply both sides of the equation by \(x-{x}_{1}\).\(\begin{array}{lll}\ m(x-{x}_{1}) & = & (\frac{y-{y}_{1}}{x-{x}_{1}})(x-{x}_{1})\end{array}\)
Simplify.\(\begin{array}{lll}\ m(x-{x}_{1}) & = & y-{y}_{1}\end{array}\)
Rewrite the equation with the \(y\) terms on the left.\(\begin{array}{lll}\ y-{y}_{1} & = & m(x-{x}_{1})\end{array}\)

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 a Line Given the Slope and a Point

Try it.

Find an equation of a line with slope \(m=\frac{2}{5}\) that contains the point \((10,3)\). Write the equation in slope–intercept form.

Solution
Example

Try it.

Find an equation of a line with slope \(m=-\frac{1}{3}\) that contains the point \((6,-4)\). Write the equation in slope–intercept form.

Solution

Since we are given a point and the slope of the line, we can substitute the needed values into the point–slope form, \(y-{y}_{1}=m(x-{x}_{1})\).

Identify the slope.
Identify the point.
Substitute the values into \(y-{y}_{1}=m(x-{x}_{1}).\)
Simplify.
Write in slope–intercept form.

Condensed — the full section is in OpenStax Elementary Algebra 2e.

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.

Find an Equation of a Line Given Two Points

Try it.

Find an equation of a line that contains the points \((5,4)\) and \((3,6)\). Write the equation in slope–intercept form.

Solution


Use the point \((3,6)\) and see that you get the same equation.

Example

Try it.

Find an equation of a line that contains the points \((-3,-1)\) and \((2,-2)\). Write the equation in slope–intercept form.

Solution

Since we have two points, we will find an equation of the line using the point–slope form. The first step will be to find the slope.

Find the slope of the line through (−3, −1) and (2, −2).
Choose either point.
Substitute the values into \(y-{y}_{1}=m(x-{x}_{1}).\)
Write in slope–intercept form.

Example

Try it.

Find an equation of a line that contains the points \((-2,4)\) and \((-2,-3)\). Write the equation in slope–intercept form.

Solution

Again, the first step will be to find the slope.

Find the slope of the line through \((-2,4)\ \text{and}\ (-2,-3)\).\(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\)
\(m=\frac{-3-4}{-2-(-2)}\)
\(m=\frac{-7}{0}\)
The slope is undefined.

This tells us it is a vertical line. Both of our points have an x-coordinate of \(-2\). So our equation of the line is \(x=-2\). Since there is no \(y\), we cannot write it in slope–intercept form.

You may want to sketch a graph using the two given points. Does the graph agree with our conclusion that this is a vertical line?

Condensed — the full section is in OpenStax Elementary Algebra 2e.

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=2x-3\). We want to graph a line parallel to this line and passing through the point \((-2,1)\).

We know that parallel lines have the same slope. So the second line will have the same slope as\(y=2x-3\). That slope is\({m}_{∥}=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=\frac{2}{1}\)), we count out the rise 2 and the run 1. We draw the line.

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

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

How to Find an Equation of a Line Parallel to a Given Line

Try it.

Find an equation of a line parallel to \(y=2x-3\) that contains the point \((-2,1)\). Write the equation in slope–intercept form.

Solution


Does this equation make sense? What is the y-intercept of the line? What is the slope?

Condensed — the full section is in OpenStax Elementary Algebra 2e.

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=2x-3\). Now, we want to graph a line perpendicular to this line and passing through \((-2,1)\).

We know that perpendicular lines have slopes that are negative reciprocals. We’ll use the notation \({m}_{\text{⊥}}\) 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.)

\[\begin{array}{lll}y=2x-3 & & \text{perpendicular line} \\ m=2 & & {m}_{\text{⊥}}=-\frac{1}{2}\end{array}\]

We now know the perpendicular line will pass through \((-2,1)\) with \({m}_{\text{⊥}}=-\frac{1}{2}\).

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.

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.

How to Find an Equation of a Line Perpendicular to a Given Line

Try it.

Find an equation of a line perpendicular to \(y=2x-3\) that contains the point \((-2,1)\). Write the equation in slope–intercept form.

Solution

Condensed — the full section is in OpenStax Elementary Algebra 2e.

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, \(y-{y}_{1}=m(x-{x}_{1})\).
    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, \(y-{y}_{1}=m(x-{x}_{1})\).
    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 \(y-{y}_{1}=m(x-{x}_{1})\).
    • If given two points, use point–slope form \(y-{y}_{1}=m(x-{x}_{1})\).



  • 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, \(y-{y}_{1}=m(x-{x}_{1})\).
    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, \(y-{y}_{1}=m(x-{x}_{1})\).
    5. Write the equation in slope-intercept form.

Find the Equation of a Line

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.

Try it.

slope 3 and y-intercept \((0,5)\)

Try it.

slope 4 and y-intercept \((0,1)\)

Solution

\(y=4x+1\)

Try it.

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

Try it.

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

Solution

\(y=8x-6\)

Try it.

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

Try it.

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

Solution

\(y=\text{-}x+7\)

Try it.

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

Try it.

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

Solution

\(y=-3x-1\)

Try it.

slope \(\frac{3}{5}\) and y-intercept \((0,-1)\)

Try it.

slope \(\frac{1}{5}\) and y-intercept \((0,-5)\)

Solution

\(y=\frac{1}{5}x-5\)

Try it.

slope \(-\frac{3}{4}\) and y-intercept \((0,-2)\)

Try it.

slope \(-\frac{2}{3}\) and y-intercept \((0,-3)\)

Solution

\(y=-\frac{2}{3}x-3\)

Try it.

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

Try it.

slope 0 and y-intercept \((0,2)\)

Solution

\(y=2\)

Try it.

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

Try it.

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

Solution

\(y=-4x\)

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

Try it.

Try it.

Solution

\(y=-2x+4\)

Try it.

Try it.

Solution

\(y=\frac{3}{4}x+2\)

Try it.

Try it.

Solution

\(y=-\frac{3}{2}x-1\)

Try it.

Try it.

Solution

\(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.

Try it.

\(m=\frac{5}{8}\), point \((8,3)\)

Try it.

\(m=\frac{3}{8}\), point \((8,2)\)

Solution

\(y=\frac{3}{8}x-1\)

Try it.

\(m=\frac{1}{6}\), point \((6,1)\)

Try it.

\(m=\frac{5}{6}\), point \((6,7)\)

Solution

\(y=\frac{5}{6}x+2\)

Try it.

\(m=-\frac{3}{4}\), point \((8,-5)\)

Try it.

\(m=-\frac{3}{5}\), point \((10,-5)\)

Solution

\(y=-\frac{3}{5}x+1\)

Try it.

\(m=-\frac{1}{4}\), point \((-12,-6)\)

Try it.

\(m=-\frac{1}{3}\), point \((-9,-8)\)

Solution

\(y=-\frac{1}{3}x-11\)

Try it.

Horizontal line containing \((-2,5)\)

Try it.

Horizontal line containing \((-1,4)\)

Solution

\(y=4\)

Try it.

Horizontal line containing \((-2,-3)\)

Try it.

Horizontal line containing \((-1,-7)\)

Solution

\(y=-7\)

Try it.

\(m=-\frac{3}{2}\), point \((-4,-3)\)

Try it.

\(m=-\frac{5}{2}\), point \((-8,-2)\)

Solution

\(y=-\frac{5}{2}x-22\)

Try it.

\(m=-7\), point \((-1,-3)\)

Try it.

\(m=-4\), point \((-2,-3)\)

Solution

\(y=-4x-11\)

Try it.

Horizontal line containing \((2,-3)\)

Try it.

Horizontal line containing \((4,-8)\)

Solution

\(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.

Try it.

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

Try it.

\((3,1)\) and \((2,5)\)

Solution

\(y=-4x+13\)

Try it.

\((4,3)\) and \((8,1)\)

Try it.

\((2,7)\) and \((3,8)\)

Solution

\(y=x+5\)

Try it.

\((-3,-4)\) and \((5-2)\)

Try it.

\((-5,-3)\) and \((4,-6)\)

Solution

\(y=-\frac{1}{3}x-\frac{14}{3}\)

Try it.

\((-1,3)\) and \((-6,-7)\)

Try it.

\((-2,8)\) and \((-4,-6)\)

Solution

\(y=7x+22\)

Try it.

\((6,-4)\) and \((-2,5)\)

Try it.

\((3,-2)\) and \((-4,4)\)

Solution

\(y=-\frac{6}{7}x+\frac{4}{7}\)

Try it.

\((0,4)\) and \((2,-3)\)

Try it.

\((0,-2)\) and \((-5,-3)\)

Solution

\(y=\frac{1}{5}x-2\)

Try it.

\((7,2)\) and \((7,-2)\)

Try it.

\((4,2)\) and \((4,-3)\)

Solution

\(x=4\)

Try it.

\((-7,-1)\) and \((-7,-4)\)

Try it.

\((-2,1)\) and \((-2,-4)\)

Solution

\(x=-2\)

Try it.

\((6,1)\) and \((0,1)\)

Try it.

\((6,2)\) and \((-3,2)\)

Solution

\(y=2\)

Try it.

\((3,-4)\) and \((5,-4)\)

Try it.

\((-6,-3)\) and \((-1,-3)\)

Solution

\(y=-3\)

Try it.

\((4,3)\) and \((8,0)\)

Try it.

\((0,0)\) and \((1,4)\)

Solution

\(y=4x\)

Try it.

\((-2,-3)\) and \((-5,-6)\)

Try it.

\((-3,0)\) and \((-7,-2)\)

Solution

\(y=\frac{1}{2}x+\frac{3}{2}\)

Try it.

\((8,-1)\) and \((8,-5)\)

Try it.

\((3,5)\) and \((-7,5)\)

Solution

\(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.

Try it.

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

Try it.

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

Solution

\(y=3x-1\)

Try it.

line \(y=-2x-3\), point \((-1,3)\)

Try it.

line \(y=-3x-1\), point \((2,-3)\)

Solution

\(y=-3x+3\)

Try it.

line \(3x-y=4\), point \((3,1)\)

Try it.

line \(2x-y=6\), point \((3,0)\)

Solution

\(y=2x-6\)

Try it.

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

Try it.

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

Solution

\(y=-\frac{2}{3}x+5\)

Try it.

line \(x=-3\), point \((-2,-1)\)

Try it.

line \(x=-4\), point \((-3,-5)\)

Solution

\(x=-3\)

Try it.

line \(x-2=0\), point \((1,-2)\)

Try it.

line \(x-6=0\), point \((4,-3)\)

Solution

\(x=4\)

Try it.

line \(y=5\), point \((2,-2)\)

Try it.

line \(y=1\), point \((3,-4)\)

Solution

\(y=-4\)

Try it.

line \(y+2=0\), point \((3,-3)\)

Try it.

line \(y+7=0\), point \((1,-1)\)

Solution

\(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.

Try it.

line \(y=-2x+3\), point \((2,2)\)

Try it.

line \(y=\text{-}x+5\), point \((3,3)\)

Solution

\(y=x\)

Try it.

line \(y=\frac{3}{4}x-2\), point \((-3,4)\)

Try it.

line \(y=\frac{2}{3}x-4\), point \((2,-4)\)

Solution

\(y=-\frac{3}{2}x-1\)

Try it.

line \(2x-3y=8\), point \((4,-1)\)

Try it.

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

Solution

\(y=-\frac{3}{4}x-\frac{1}{4}\)

Try it.

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

Try it.

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

Solution

\(y=\frac{5}{4}x\)

Try it.

line \(y-3=0\), point \((-2,-4)\)

Try it.

line \(y-6=0\), point \((-5,-3)\)

Solution

\(x=-5\)

Try it.

line y-axis, point \((3,4)\)

Try it.

line y-axis, point \((2,1)\)

Solution

\(y=1\)

Condensed — the full section is in OpenStax Elementary Algebra 2e.

Practice (40)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Simplify: \(\frac{2}{5}(x+15).\)
    If you missed this problem, review .

    Одкриј го одговорот

    \(\frac{2}{5}x+6\)

  2. Simplify: \(-3(x-(-2)).\)
    If you missed this problem, review .

    Одкриј го одговорот

    \(-3x-6\)

  3. Solve for y: \(y-3=-2(x+1).\)
    If you missed this problem, review .

    Одкриј го одговорот

    \(y=-2x+1\)

  4. Find the equation of a line with slope \(-9\) and y-intercept \((0,-4).\)

    Одкриј го одговорот

    Since we are given the slope and y-intercept of the line, we can substitute the needed values into the slope-intercept form, \(y=mx+b.\)

    Name the slope.
    Name the y-intercept.
    Substitute the values into \(y=mx+b.\)
  5. Find the equation of a line with slope \(\frac{2}{5}\) and y-intercept \((0,4).\)

    Одкриј го одговорот

    \(y=\frac{2}{5}x+4\)

  6. Find the equation of a line with slope \(-1\) and y-intercept \((0,-3).\)

    Одкриј го одговорот

    \(y=\text{-}x-3\)

  7. Find the equation of the line shown in the graph.

    Одкриј го одговорот

    We need to find the slope and y-intercept of the line from the graph so we can substitute the needed values into the slope-intercept form, \(y=mx+b.\)

    To find the slope, we choose two points on the graph.

    The y-intercept is \((0,-4)\) and the graph passes through \((3,-2).\)

    Find the slope, by counting the rise and run.
    Find the y-intercept.
    Substitute the values into \(y=mx+b.\)
  8. Find the equation of the line shown in the graph.

    Одкриј го одговорот

    \(y=\frac{3}{5}x+1\)

  9. Find the equation of the line shown in the graph.

    Одкриј го одговорот

    \(y=\frac{4}{3}x-5\)

  10. Find an equation of a line with slope \(m=-\frac{1}{3}\) that contains the point \((6,-4).\) Write the equation in slope-intercept form.

  11. Find the equation of a line with slope \(m=-\frac{2}{5}\) and containing the point \((10,-5).\)

    Одкриј го одговорот

    \(y=-\frac{2}{5}x-1\)

  12. Find the equation of a line with slope \(m=-\frac{3}{4},\) and containing the point \((4,-7).\)

    Одкриј го одговорот

    \(y=-\frac{3}{4}x-4\)

  13. Find an equation of a horizontal line that contains the point \((-2,-6).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    Every horizontal line has slope 0. We can substitute the slope and points into the point-slope form, \(y-{y}_{1}=m(x-{x}_{1}).\)

    Identify the slope.
    Identify the point.
    Substitute the values into \(y-{y}_{1}=m(x-{x}_{1}).\)
    Simplify.
    Write in slope-intercept form.It is in y-form, but could be written \(y=0x-6.\)

    Did we end up with the form of a horizontal line, \(y=b?\)

  14. Find the equation of a horizontal line containing the point \((-3,8).\)

    Одкриј го одговорот

    \(y=8\)

  15. Find the equation of a horizontal line containing the point \((-1,4).\)

    Одкриј го одговорот

    \(y=4\)

  16. Find an equation of a line that contains the points \((-3,-1)\) and \((2,-2)\) Write the equation in slope-intercept form.

  17. Find the equation of a line containing the points \((-2,-4)\) and \((1,-3).\)

    Одкриј го одговорот

    \(y=\frac{1}{3}x-\frac{10}{3}\)

  18. Find the equation of a line containing the points \((-4,-3)\) and \((1,-5).\)

    Одкриј го одговорот

    \(y=-\frac{2}{5}x-\frac{23}{5}\)

  19. Find an equation of a line that contains the points \((-3,5)\) and \((-3,4).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    Again, the first step will be to find the slope.

    Find the slope of the line through \((-3,5)\) and \((-3,4).\)\(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\)
    \(m=\frac{4-5}{-3-(-3)}\)
    \(m=\frac{-1}{0}\)
    The slope is undefined.

    This tells us it is a vertical line. Both of our points have an x-coordinate of \(-3.\) So our equation of the line is \(x=-3.\) Since there is no y, we cannot write it in slope-intercept form.

    You may want to sketch a graph using the two given points. Does your graph agree with our conclusion that this is a vertical line?

  20. Find the equation of a line containing the points \((5,1)\) and \((5,-4).\)

    Одкриј го одговорот

    \(x=5\)

  21. Find the equation of a line containing the points \((-4,4)\) and \((-4,3).\)

    Одкриј го одговорот

    \(x=-4\)

  22. Find an equation of a line parallel to \(y=2x-3\) that contains the point \((-2,1).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    Look at graph with the parallel lines shown previously. Does this equation make sense? What is the y-intercept of the line? What is the slope?

  23. Find an equation of a line parallel to the line \(y=3x+1\) that contains the point \((4,2).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=3x-10\)

  24. Find an equation of a line parallel to the line \(y=\frac{1}{2}x-3\) that contains the point \((6,4).\)

    Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=\frac{1}{2}x+1\)

  25. Find an equation of a line perpendicular to \(y=2x-3\) that contains the point \((-2,1).\) Write the equation in slope-intercept form.

  26. Find an equation of a line perpendicular to the line \(y=3x+1\) that contains the point \((4,2).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=-\frac{1}{3}x+\frac{10}{3}\)

  27. Find an equation of a line perpendicular to the line \(y=\frac{1}{2}x-3\) that contains the point \((6,4).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=-2x+16\)

  28. Find an equation of a line perpendicular to \(x=5\) that contains the point \((3,-2).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    Again, since we know one point, the point-slope option seems more promising than the slope-intercept option. We need the slope to use this form, and we know the new line will be perpendicular to \(x=5.\) This line is vertical, so its perpendicular will be horizontal. This tells us the \({m}_{⊥}=0.\)

    Identify the point.\(\ (3,-2)\)
    Identify the slope of the perpendicular line.\(\ {m}_{⊥}=0\)
    Substitute the values into \(y-{y}_{1}=m(x-{x}_{1}).\)\(\ y-{y}_{1}=m(x-{x}_{1})\)
    \(\ y-(-2)=0(x-3)\)
    Simplify.\(y+2=0\)
    \(\ y=-2\)

    Sketch the graph of both lines. On your graph, do the lines appear to be perpendicular?

  29. Find an equation of a line that is perpendicular to the line \(x=4\) that contains the point \((4,-5).\). Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=-5\)

  30. Find an equation of a line that is perpendicular to the line \(x=2\) that contains the point \((2,-1).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(y=-1\)

  31. Find an equation of a line that is perpendicular to \(y=-3\) that contains the point \((-3,5).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    The line \(y=-3\) is a horizontal line. Any line perpendicular to it must be vertical, in the form \(x=a.\) Since the perpendicular line is vertical and passes through \((-3,5),\) every point on it has an x-coordinate of \(-3.\) The equation of the perpendicular line is \(x=-3\)

    You may want to sketch the lines. Do they appear perpendicular?

  32. Find an equation of a line that is perpendicular to the line \(y=1\) that contains the point \((-5,1).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(x=-5\)

  33. Find an equation of a line that is perpendicular to the line \(y=-5\) that contains the point \((-4,-5).\) Write the equation in slope-intercept form.

    Одкриј го одговорот

    \(x=-4\)

  34. slope 3 and
    \(y\)-intercept \((0,5)\)

    Одкриј го одговорот

    \(y=3x+5\)

  35. slope 8 and
    y-intercept \((0,-6)\)

  36. slope \(-3\) and
    \(y\)-intercept \((0,-1)\)

    Одкриј го одговорот

    \(y=-3x-1\)

  37. slope \(-1\) and
    \(y\)-intercept \((0,3)\)

  38. slope \(\frac{1}{5}\) and
    \(y\)-intercept \((0,-5)\)

    Одкриј го одговорот

    \(y=\frac{1}{5}x-5\)

  39. slope \(-\frac{3}{4}\) and
    \(y\)-intercept \((0,-2)\)

  40. slope 0 and
    \(y\)-intercept \((0,-1)\)

    Одкриј го одговорот

    \(y=-1\)

Symbols used here

\pm
plus or minus
Both signs at once: x = 3 ± 2 means 5 and 1.
\neq
not equal
The two sides are different.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\sqrt{x},\ \sqrt[n]{x}
square root, n-th root
The non-negative number whose square (n-th power) is x.
|x|
absolute value / modulus
Distance from zero: |−3| = 3. For a complex number, distance from the origin.
i
imaginary unit
i² = −1.
\log_b x,\ \ln x
logarithm, natural log
The exponent b must be raised to for x; ln uses base e.
\mathbb{N},\ \mathbb{Z},\ \mathbb{Q},\ \mathbb{R},\ \mathbb{C}
number sets
Naturals, integers, rationals, reals, complex numbers.

How to: Find the Equation of a Line

  1. Find an equation of the line given the slope and
  2. Find an equation of the line given the slope and a point
  3. Find an equation of the line given two points
  4. Find an equation of a line parallel to a given line
  5. Find an equation of a line perpendicular to a given line
  6. Identify the slope.
  7. Identify the point.
  8. Substitute the values into the point-slope form,

Questions people ask

What does it mean to solve an equation?

To find every value of the unknown that makes both sides equal. Each step is an operation applied to both sides that keeps the solution set the same, until the unknown stands alone.

Why do I sometimes get two answers?

A quadratic can cross the axis twice, so it can have two solutions. A degree-n polynomial has up to n. The graph shows where each one comes from.

How do I know whether to factor or use the quadratic formula?

Try factoring for a few seconds: look for two numbers that multiply to a·c and add to b. If nothing obvious appears, the discriminant b² − 4ac tells you how many real roots there are, and the formula finds them without guessing.

Обиди се со себе.

Parts of this page are adapted from OpenStax Elementary Algebra 2e (CC BY-NC-SA 4.0), OpenStax Intermediate Algebra 2e (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.

Повеќе во Algebra