Write the equation of a line parallel or perpendicular to a given line

If we know the equation of a line, we can use what we know about slope to write the equation of a line that is either parallel or perpendicular to the given line.

Writing Equations of Parallel Lines

Suppose for example, we are given the following equation.

f(x)=3x+1f\left(x\right)=3x+1

We know that the slope of the line formed by the function is 3. We also know that the y-intercept is (0, 1). Any other line with a slope of 3 will be parallel to f(x). So the lines formed by all of the following functions will be parallel to f(x).

{g(x)=3x+6h(x)=3x+1p(x)=3x+23\begin{cases}g\left(x\right)=3x+6\qquad \\ h\left(x\right)=3x+1\qquad \\ p\left(x\right)=3x+\frac{2}{3}\qquad \end{cases}

Suppose then we want to write the equation of a line that is parallel to f and passes through the point (1, 7). We already know that the slope is 3. We just need to determine which value for b will give the correct line. We can begin with the point-slope form of an equation for a line, and then rewrite it in the slope-intercept form.

{yy1=m(xx1)y7=3(x1)y7=3x3 y=3x+4\begin{cases}y-{y}_{1}=m\left(x-{x}_{1}\right)\qquad \\ y - 7=3\left(x - 1\right)\qquad \\ y - 7=3x - 3\qquad \\ \text{ }y=3x+4\qquad \end{cases}

So

g(x)=3x+4g\left(x\right)=3x+4
is parallel to
f(x)=3x+1f\left(x\right)=3x+1
and passes through the point (1, 7).

How To: Given the equation of a function and a point through which its graph passes, write the equation of a line parallel to the given line that passes through the given point.

  1. Find the slope of the function.
  2. Substitute the given values into either the general point-slope equation or the slope-intercept equation for a line.
  3. Simplify.

Example 9: Finding a Line Parallel to a Given Line

Find a line parallel to the graph of

f(x)=3x+6f\left(x\right)=3x+6
that passes through the point (3, 0).

Solutions

The slope of the given line is 3. If we choose the slope-intercept form, we can substitute = 3, = 3, and f(x) = 0 into the slope-intercept form to find the y-intercept.

{g(x)=3x+b 0=3(3)+b b=9\begin{cases}g\left(x\right)=3x+b\qquad \\ \text{ }0=3\left(3\right)+b\qquad \\ \text{ }b=-9\qquad \end{cases}

The line parallel to f(x) that passes through (3, 0) is

g(x)=3x9g\left(x\right)=3x - 9
.

Analysis of the Solution

We can confirm that the two lines are parallel by graphing them. Figure 22 shows that the two lines will never intersect.

Graph of two functions where the blue line is y = 3x + 6, and the orange line is y = 3x - 9.Figure 22


Writing Equations of Perpendicular Lines

We can use a very similar process to write the equation for a line perpendicular to a given line. Instead of using the same slope, however, we use the negative reciprocal of the given slope. Suppose we are given the following function:

f(x)=2x+4f\left(x\right)=2x+4

The slope of the line is 2, and its negative reciprocal is

12-\frac{1}{2}
. Any function with a slope of
12-\frac{1}{2}
will be perpendicular to f(x). So the lines formed by all of the following functions will be perpendicular to f(x).

{g(x)=12x+4h(x)=12x+2p(x)=12x12\begin{cases}g\left(x\right)=-\frac{1}{2}x+4\qquad \\ h\left(x\right)=-\frac{1}{2}x+2\qquad \\ p\left(x\right)=-\frac{1}{2}x-\frac{1}{2}\qquad \end{cases}

As before, we can narrow down our choices for a particular perpendicular line if we know that it passes through a given point. Suppose then we want to write the equation of a line that is perpendicular to f(x) and passes through the point (4, 0). We already know that the slope is

12-\frac{1}{2}
. Now we can use the point to find the y-intercept by substituting the given values into the slope-intercept form of a line and solving for b.

{g(x)=mx+b0=12(4)+b0=2+b2=bb=2\begin{cases}g\left(x\right)=mx+b\qquad \\ 0=-\frac{1}{2}\left(4\right)+b\qquad \\ 0=-2+b\qquad \\ 2=b\qquad \\ b=2\qquad \end{cases}

The equation for the function with a slope of

12-\frac{1}{2}
and a y-intercept of 2 is

g(x)=12x+2g\left(x\right)=-\frac{1}{2}x+2
.

So

g(x)=12x+2g\left(x\right)=-\frac{1}{2}x+2
is perpendicular to
f(x)=2x+4f\left(x\right)=2x+4
and passes through the point (4, 0). Be aware that perpendicular lines may not look obviously perpendicular on a graphing calculator unless we use the square zoom feature.

Q & A

A horizontal line has a slope of zero and a vertical line has an undefined slope. These two lines are perpendicular, but the product of their slopes is not –1. Doesn’t this fact contradict the definition of perpendicular lines?

No. For two perpendicular linear functions, the product of their slopes is –1. However, a vertical line is not a function so the definition is not contradicted.

How To: Given the equation of a function and a point through which its graph passes, write the equation of a line perpendicular to the given line.

  1. Find the slope of the function.
  2. Determine the negative reciprocal of the slope.
  3. Substitute the new slope and the values for x and y from the coordinate pair provided into
    g(x)=mx+bg\left(x\right)=mx+b
    .
  4. Solve for b.
  5. Write the equation for the line.

Example 10: Finding the Equation of a Perpendicular Line

Find the equation of a line perpendicular to

f(x)=3x+3f\left(x\right)=3x+3
that passes through the point (3, 0).

Solution

The original line has slope = 3, so the slope of the perpendicular line will be its negative reciprocal, or

13-\frac{1}{3}
. Using this slope and the given point, we can find the equation for the line.

{g(x)=13x+b 0=13(3)+b 1=b b=1\begin{cases}g\left(x\right)=-\frac{1}{3}x+b\qquad \\ \text{ }0=-\frac{1}{3}\left(3\right)+b\qquad \\ \text{ }1=b\qquad \\ \text{ }b=1\qquad \end{cases}

The line perpendicular to f(x) that passes through (3, 0) is

g(x)=13x+1g\left(x\right)=-\frac{1}{3}x+1
.

Analysis of the Solution

A graph of the two lines is shown in Figure 23.

Graph of two functions where the blue line is g(x) = -1/3x + 1, and the orange line is f(x) = 3x + 6.Figure 23


Try It 5

Given the function

h(x)=2x4h\left(x\right)=2x - 4
, write an equation for the line passing through (0, 0) that is

a. parallel to h(x)

b. perpendicular to h(x)

Solution

How To: Given two points on a line and a third point, write the equation of the perpendicular line that passes through the point.

  1. Determine the slope of the line passing through the points.
  2. Find the negative reciprocal of the slope.
  3. Use the slope-intercept form or point-slope form to write the equation by substituting the known values.
  4. Simplify.

Example 11: Finding the Equation of a Line Perpendicular to a Given Line Passing through a Point

A line passes through the points (–2, 6) and (4, 5). Find the equation of a perpendicular line that passes through the point (4, 5).

Solution

From the two points of the given line, we can calculate the slope of that line.

{m1=564(2)=16=16\begin{cases}{m}_{1}=\frac{5 - 6}{4-\left(-2\right)}\qquad \\ =\frac{-1}{6}\qquad \\ =-\frac{1}{6}\qquad \end{cases}

Find the negative reciprocal of the slope.

{m2=116=1(61)=6\begin{cases}{m}_{2}=\frac{-1}{-\frac{1}{6}}\qquad \\ =-1\left(-\frac{6}{1}\right)\qquad \\ =6\qquad \end{cases}

We can then solve for the y-intercept of the line passing through the point (4, 5).

{g(x)=6x+b5=6(4)+b5=24+b19=bb=19\begin{cases}g\left(x\right)=6x+b\qquad \\ 5=6\left(4\right)+b\qquad \\ 5=24+b\qquad \\ -19=b\qquad \\ b=-19\qquad \end{cases}

The equation for the line that is perpendicular to the line passing through the two given points and also passes through point (4, 5) is

y=6x19y=6x - 19

Try It 6

A line passes through the points, (–2, –15) and (2, –3). Find the equation of a perpendicular line that passes through the point, (6, 4).

Solution

Licenses and Attributions