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

$\begin{cases}g\left(x\right)=3x+6\hfill \\ h\left(x\right)=3x+1\hfill \\ p\left(x\right)=3x+\frac{2}{3}\hfill \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.

$\begin{cases}y-{y}_{1}=m\left(x-{x}_{1}\right)\hfill \\ y - 7=3\left(x - 1\right)\hfill \\ y - 7=3x - 3\hfill \\ \text{ }y=3x+4\hfill \end{cases}$

So $g\left(x\right)=3x+4$ is parallel to $f\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\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.

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

The line parallel to f(x) that passes through (3, 0) is $g\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.

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\left(x\right)=2x+4$

The slope of the line is 2, and its negative reciprocal is $-\frac{1}{2}$. Any function with a slope of $-\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).

$\begin{cases}g\left(x\right)=-\frac{1}{2}x+4\hfill \\ h\left(x\right)=-\frac{1}{2}x+2\hfill \\ p\left(x\right)=-\frac{1}{2}x-\frac{1}{2}\hfill \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 $-\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.

$\begin{cases}g\left(x\right)=mx+b\hfill \\ 0=-\frac{1}{2}\left(4\right)+b\hfill \\ 0=-2+b\hfill \\ 2=b\hfill \\ b=2\hfill \end{cases}$

The equation for the function with a slope of $-\frac{1}{2}$ and a y-intercept of 2 is

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

So $g\left(x\right)=-\frac{1}{2}x+2$ is perpendicular to $f\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\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\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 $-\frac{1}{3}$. Using this slope and the given point, we can find the equation for the line.

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

The line perpendicular to f(x) that passes through (3, 0) is $g\left(x\right)=-\frac{1}{3}x+1$.

### Analysis of the Solution

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

Figure 23

### Try It 5

Given the function $h\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.

$\begin{cases}{m}_{1}=\frac{5 - 6}{4-\left(-2\right)}\hfill \\ =\frac{-1}{6}\hfill \\ =-\frac{1}{6}\hfill \end{cases}$

Find the negative reciprocal of the slope.

$\begin{cases}{m}_{2}=\frac{-1}{-\frac{1}{6}}\hfill \\ =-1\left(-\frac{6}{1}\right)\hfill \\ =6\hfill \end{cases}$

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

$\begin{cases}g\left(x\right)=6x+b\hfill \\ 5=6\left(4\right)+b\hfill \\ 5=24+b\hfill \\ -19=b\hfill \\ b=-19\hfill \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=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