0.2: Graphs of Linear Functions
- Page ID
- 31056
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Skills to Develop
- Graph linear functions.
- Write the equation for a linear function from the graph of a line.
- Given the equations of two lines, determine whether their graphs are parallel or perpendicular.
- Write the equation of a line parallel or perpendicular to a given line.
- Solve a system of linear equations.
Two competing telephone companies offer different payment plans. The two plans charge the same rate per long distance minute, but charge a different monthly flat fee. A consumer wants to determine whether the two plans will ever cost the same amount for a given number of long distance minutes used. The total cost of each payment plan can be represented by a linear function. To solve the problem, we will need to compare the functions. In this section, we will consider methods of comparing functions using graphs.
Graphing Linear Functions
In Linear Functions, we saw that that the graph of a linear function is a straight line. We were also able to see the points of the function as well as the initial value from a graph. By graphing two functions, then, we can more easily compare their characteristics.
There are three basic methods of graphing linear functions. The first is by plotting points and then drawing a line through the points. The second is by using the y-intercept and slope. And the third is by using transformations of the identity function \(f(x)=x\).
Graphing a Function by Plotting Points
To find points of a function, we can choose input values, evaluate the function at these input values, and calculate output values. The input values and corresponding output values form coordinate pairs. We then plot the coordinate pairs on a grid. In general, we should evaluate the function at a minimum of two inputs in order to find at least two points on the graph. For example, given the function, \(f(x)=2x\), we might use the input values 1 and 2. Evaluating the function for an input value of 1 yields an output value of 2, which is represented by the point \((1,2)\). Evaluating the function for an input value of 2 yields an output value of 4, which is represented by the point \((2,4)\). Choosing three points is often advisable because if all three points do not fall on the same line, we know we made an error.
HowTO: Given a linear function, graph by plotting points.
- Choose a minimum of two input values.
- Evaluate the function at each input value.
- Use the resulting output values to identify coordinate pairs.
- Plot the coordinate pairs on a grid.
- Draw a line through the points.
Example \(\PageIndex{1}\): Graphing by Plotting Points
Graph \(f(x)=−\frac{2}{3}x+5\) by plotting points.
Solution
Begin by choosing input values. This function includes a fraction with a denominator of 3, so let’s choose multiples of 3 as input values. We will choose 0, 3, and 6.
Evaluate the function at each input value, and use the output value to identify coordinate pairs.
\[\begin{align} x&=0 & f(0)&=-\dfrac{2}{3}(0)+5=5\rightarrow(0,5) \\ x&=3 & f(3)&=-\dfrac{2}{3}(3)+5=3\rightarrow(3,3) \\ x&=6 & f(6)&=-\dfrac{2}{3}(6)+5=1\rightarrow(6,1) \end{align}\]
Plot the coordinate pairs and draw a line through the points. Figure \(\PageIndex{1}\) represents the graph of the function \(f(x)=−\frac{2}{3}x+5\).
Figure \(\PageIndex{1}\): The graph of the linear function \(f(x)=−\frac{2}{3}x+5\).
Analysis
The graph of the function is a line as expected for a linear function. In addition, the graph has a downward slant, which indicates a negative slope. This is also expected from the negative constant rate of change in the equation for the function.
Exercise \(\PageIndex{1}\)
Graph \(f(x)=−\frac{3}{4}x+6\) by plotting points.
- Answer
-
Figure \(\PageIndex{2}\)
Graphing a Function Using y-intercept and Slope
Another way to graph linear functions is by using specific characteristics of the function rather than plotting points. The first characteristic is its y-intercept, which is the point at which the input value is zero. To find the y-intercept, we can set \(x=0\) in the equation.
The other characteristic of the linear function is its slope \(m\), which is a measure of its steepness. Recall that the slope is the rate of change of the function. The slope of a function is equal to the ratio of the change in outputs to the change in inputs. Another way to think about the slope is by dividing the vertical difference, or rise, by the horizontal difference, or run. We encountered both the y-intercept and the slope in Linear Functions.
Let’s consider the following function.
\[f(x)=\dfrac{1}{2}x+1\]
The slope is \(\frac{1}{2}\). Because the slope is positive, we know the graph will slant upward from left to right. The y-intercept is the point on the graph when \(x=0\). The graph crosses the y-axis at \((0,1)\). Now we know the slope and the y-intercept. We can begin graphing by plotting the point \((0,1)\) We know that the slope is rise over run, \(m=\frac{\text{rise}}{\text{run}}\). From our example, we have \(m=\frac{1}{2}\), which means that the rise is 1 and the run is 2. So starting from our y-intercept \((0,1)\), we can rise 1 and then run 2, or run 2 and then rise 1. We repeat until we have a few points, and then we draw a line through the points as shown in Figure \(\PageIndex{3}\).
Figure \(\PageIndex{3}\): Graph of \(f(x)\) showing slope and y-intercept
Graphical Interpretation of a Linear Function
In the equation \(f(x)=mx+b\)
- \(b\) is the y-intercept of the graph and indicates the point \((0,b)\) at which the graph crosses the y-axis.
- \(m\) is the slope of the line and indicates the vertical displacement (rise) and horizontal displacement (run) between each successive pair of points. Recall the formula for the slope:
\[m=\dfrac{\text{change in output (rise)}}{\text{change in input (run)}}=\dfrac{{\Delta}y}{{\Delta}x}=\dfrac{y_2-y_1}{x_2-x_1}\]
Exercise \(\PageIndex{1}\)
Do all linear functions have y-intercepts?
- Answer
-
Yes. All linear functions cross the y-axis and therefore have y-intercepts. (Note: A vertical line parallel to the y-axis does not have a y-intercept, but it is not a function.)
HowTO: Given the equation for a linear function, graph the function using the y-intercept and slope.
- Evaluate the function at an input value of zero to find the y-intercept.
- Identify the slope as the rate of change of the input value.
- Plot the point represented by the y-intercept.
- Use \(\frac{\text{rise}}{\text{run}}\) to determine at least two more points on the line.
- Sketch the line that passes through the points.
Example \(\PageIndex{2}\): Graphing by Using the y-intercept and Slope
Graph \(f(x)=−\frac{2}{3}x+5\) using the y-intercept and slope.
Solution
Evaluate the function at \(x=0\) to find the y-intercept. The output value when \(x=0\) is 5, so the graph will cross the y-axis at \((0,5)\).
According to the equation for the function, the slope of the line is \(-\frac{2}{3}\). This tells us that for each vertical decrease in the “rise” of –2 units, the “run” increases by 3 units in the horizontal direction. We can now graph the function by first plotting the y-intercept on the graph in Figure \(\PageIndex{4}\). From the initial value \((0,5)\) we move down 2 units and to the right 3 units. We can extend the line to the left and right by repeating, and then draw a line through the points.
Figure \(\PageIndex{4}\): Graph of \(f(x)\)
Analysis
The graph slants downward from left to right, which means it has a negative slope as expected.
\(\PageIndex{2}\): Find a point on the graph we drew in Example \(\PageIndex{2}\) that has a negative x-value.
Solution
Possible answers include \((−3,7)\), \((−6,9)\), or \((−9,11)\).
Graphing a Function Using Transformations
Another option for graphing is to use transformations of the identity function \(f(x)=x\). A function may be transformed by a shift up, down, left, or right. A function may also be transformed using a reflection, stretch, or compression.
Vertical Stretch or Compression
In the equation \(f(x)=mx\), the \(m\) is acting as the vertical stretch or compression of the identity function. When \(m\) is negative, there is also a vertical reflection of the graph. Notice in Figure \(\PageIndex{5}\) that multiplying the equation of \(f(x)=x\) by \(m\) stretches the graph of \(f\) by a factor of \(m\) units if \(m>1\) and compresses the graph of \(f\) by a factor of \(m\) units if \(0<m<1\). This means the larger the absolute value of \(m\), the steeper the slope.
Figure \(\PageIndex{5}\): Vertical stretches and compressions and reflections on the function \(f(x)=x\).
Vertical Shift
In \(f(x)=mx+b\), the \(b\) acts as the vertical shift, moving the graph up and down without affecting the slope of the line. Notice in Figure \(\PageIndex{6}\) that adding a value of \(b\) to the equation of \(f(x)=x\) shifts the graph of \(f\) a total of \(b\) units up if \(b\) is positive and \(|b|\) units down if \(b\) is negative.
Figure \(\PageIndex{6}\): This graph illustrates vertical shifts of the function \(f(x)=x\).
Using vertical stretches or compressions along with vertical shifts is another way to look at identifying different types of linear functions. Although this may not be the easiest way to graph this type of function, it is still important to practice each method.
Given the equation of a linear function, use transformations to graph the linear function in the form \(f(x)=mx+b\).
- Graph \(f(x)=x\).
- Vertically stretch or compress the graph by a factor \(m\).
- Shift the graph up or down \(b\) units.
Example \(\PageIndex{3}\): Graphing by Using Transformations
Graph \(f(x)=\frac{1}{2}x−3\) using transformations.
Solution
The equation for the function shows that \(m=\frac{1}{2}\) so the identity function is vertically compressed by \(\frac{1}{2}\). The equation for the function also shows that \(b=−3\) so the identity function is vertically shifted down 3 units. First, graph the identity function, and show the vertical compression as in Figure \(\PageIndex{7}\).
Figure \(\PageIndex{7}\): The function, \(y=x\), compressed by a factor of \(\frac{1}{2}\).
Then show the vertical shift as in Figure \(\PageIndex{8}\).
Figure \(\PageIndex{8}\): The function \(y=\frac{1}{2}x\), shifted down 3 units.
\(\PageIndex{3}\): Graph \(f(x)=4+2x\), using transformations.
Solution
Figure \(\PageIndex{9}\)
In Example 2.2.3, could we have sketched the graph by reversing the order of the transformations?
No. The order of the transformations follows the order of operations. When the function is evaluated at a given input, the corresponding output is calculated by following the order of operations. This is why we performed the compression first. For example, following the order: Let the input be 2.
\[\begin{align} f(2)&=\dfrac{1}{2}(2)-3 \\ &=1-3\\ &=-2 \end{align}\]
Writing the Equation for a Function from the Graph of a Line
Recall that in Linear Functions, we wrote the equation for a linear function from a graph. Now we can extend what we know about graphing linear functions to analyze graphs a little more closely. Begin by taking a look at Figure \(\PageIndex{10}\). We can see right away that the graph crosses the y-axis at the point \((0, 4)\) so this is the y-intercept.
Figure \(\PageIndex{10}\): Graph of a linear function
Then we can calculate the slope by finding the rise and run. We can choose any two points, but let’s look at the point (−2,0). To get from this point to the y-intercept, we must move up 4 units (rise) and to the right 2 units (run). So the slope must be
\[m=\dfrac{\text{rise}}{\text{run}}=\dfrac{4}{2}=2\]
Substituting the slope and y-intercept into the slope-intercept form of a line gives
\[y=2x+4\]
Given a graph of linear function, find the equation to describe the function.
- Identify the y-intercept of an equation.
- Choose two points to determine the slope.
- Substitute the y-intercept and slope into the slope-intercept form of a line.
Example \(\PageIndex{4}\): Matching Linear Functions to Their Graphs
Match each equation of the linear functions with one of the lines in Figure \(\PageIndex{11}\).
- \(f(x)=2x+3\)
- \(g(x)=2x−3\)
- \(h(x)=−2x+3\)
- \(j(x)=\frac{1}{2}x+3\)
Figure \(\PageIndex{11}\): Graph of four linear functions
Solution
Analyze the information for each function.
- This function has a slope of 2 and a y-intercept of 3. It must pass through the point \((0, 3)\) and slant upward from left to right. We can use two points to find the slope, or we can compare it with the other functions listed. Function \(g\) has the same slope, but a different y-intercept. Lines I and III have the same slant because they have the same slope. Line III does not pass through \((0, 3)\) so \(f\) must be represented by line I.
- This function also has a slope of 2, but a y-intercept of −3. It must pass through the point \((0,−3)\) and slant upward from left to right. It must be represented by line III.
- This function has a slope of –2 and a y-intercept of 3. This is the only function listed with a negative slope, so it must be represented by line IV because it slants downward from left to right.
- This function has a slope of \(\frac{1}{2}\) and a y-intercept of 3. It must pass through the point (0, 3) and slant upward from left to right. Lines I and II pass through \((0, 3)\), but the slope of \(j\) is less than the slope of \(f\) so the line for \(j\) must be flatter. This function is represented by Line II.
Now we can re-label the lines as in Figure \(\PageIndex{12}\).
Figure \(\PageIndex{12}\)
Finding the x-intercept of a Line
So far, we have been finding the y-intercepts of a function: the point at which the graph of the function crosses the y-axis. A function may also have an x-intercept, which is the x-coordinate of the point where the graph of the function crosses the x-axis. In other words, it is the input value when the output value is zero.
To find the x-intercept, set a function \(f(x)\) equal to zero and solve for the value of \(x\). For example, consider the function shown.
\[f(x)=3x−6\]
Set the function equal to 0 and solve for \(x\).
\[\begin{align} 0&=3x-6 \\ 6&=3x \\ 2&=x \\ x&=2 \end{align}\]
The graph of the function crosses the x-axis at the point \((2, 0)\).
Do all linear functions have x-intercepts?
No. However, linear functions of the form \(y=c\), where \(c\) is a nonzero real number are the only examples of linear functions with no x-intercept. For example, \(y=5\) is a horizontal line 5 units above the x-axis. This function has no x-intercepts, as shown in Figure \(\PageIndex{13}\).
Figure \(\PageIndex{13}\): Graph of \(y= 5\).
Note: x-intercept
The x-intercept of the function is value of \(x\) when \(f(x)=0\). It can be solved by the equation \(0=mx+b\).
Example \(\PageIndex{5}\): Finding an x-intercept
Find the x-intercept of \(f(x)=\frac{1}{2}−3\).
Solution
Set the function equal to zero to solve for \(x\).
\[\begin{align*} 0&=\dfrac{1}{2}x-3 \\ 3&=\dfrac{1}{2}x \\ 6 &= x \\ x&=6 \end{align*}\]
The graph crosses the x-axis at the point \((6, 0)\).
Analysis
A graph of the function is shown in Figure \(\PageIndex{14}\). We can see that the x-intercept is \((6, 0)\) as we expected.
Figure \(\PageIndex{14}\): The graph of the linear function \(f(x)=\frac{1}{2}x−3\).
\(\PageIndex{4}\): Find the x-intercept of \(f(x)=\frac{1}{4}x−4\).
Solution
\((16, 0)\)
Describing Horizontal and Vertical Lines
There are two special cases of lines on a graph—horizontal and vertical lines. A horizontal line indicates a constant output, or y-value. In Figure \(\PageIndex{15}\), we see that the output has a value of 2 for every input value. The change in outputs between any two points, therefore, is 0. In the slope formula, the numerator is 0, so the slope is 0. If we use \(m=0\) in the equation \(f(x)=mx+b\), the equation simplifies to \(f(x)=b\). In other words, the value of the function is a constant. This graph represents the function \(f(x)=2\).
Figure \(\PageIndex{15}\): A horizontal line representing the function \(f(x)=2\).
A vertical line indicates a constant input, or x-value. We can see that the input value for every point on the line is 2, but the output value varies. Because this input value is mapped to more than one output value, a vertical line does not represent a function. Notice that between any two points, the change in the input values is zero. In the slope formula, the denominator will be zero, so the slope of a vertical line is undefined.
Figure \(\PageIndex{16}\)
Notice that a vertical line, such as the one in Figure \(\PageIndex{17}\), has an x-intercept, but no y-intercept unless it’s the line \(x=0\). This graph represents the line \(x=2\).
Figure \(\PageIndex{17}\): The vertical line, \(x=2\), which does not represent a function.
Note: Horizontal and Vertical Lines
Lines can be horizontal or vertical.
- A horizontal line is a line defined by an equation in the form \(f(x)=b\).
- A vertical line is a line defined by an equation in the form \(x=a\).
Example \(\PageIndex{6}\): Writing the Equation of a Horizontal Line
Write the equation of the line graphed in Figure \(\PageIndex{18}\).
Figure \(\PageIndex{18}\): Graph of \(x=7\).
Solution
For any x-value, the y-value is −4, so the equation is \(y=−4\).
Example \(\PageIndex{7}\): Writing the Equation of a Vertical Line
Write the equation of the line graphed in Figure \(\PageIndex{19}\).
Figure \(\PageIndex{19}\): Graph of a vertical line
Solution
The constant x-value is 7, so the equation is \(x=7\).
Determining Whether Lines are Parallel or Perpendicular
The two lines in Figure \(\PageIndex{20}\) are parallel lines: they will never intersect. Notice that they have exactly the same steepness, which means their slopes are identical. The only difference between the two lines is the y-intercept. If we shifted one line vertically toward the y-intercept of the other, they would become the same line.
Figure \(\PageIndex{20}\): Parallel lines.
We can determine from their equations whether two lines are parallel by comparing their slopes. If the slopes are the same and the y-intercepts are different, the lines are parallel. If the slopes are different, the lines are not parallel.
Unlike parallel lines, perpendicular lines do intersect. Their intersection forms a right, or 90-degree, angle. The two lines in Figure \(\PageIndex{21}\) are perpendicular.
Figure \(\PageIndex{21}\): Perpendicular lines.
Perpendicular lines do not have the same slope. The slopes of perpendicular lines are different from one another in a specific way. The slope of one line is the negative reciprocal of the slope of the other line. The product of a number and its reciprocal is 1. So, if \(m_1\) and \(m_2\) are negative reciprocals of one another, they can be multiplied together to yield –1.
\[m_1m_2=−1\]
To find the reciprocal of a number, divide 1 by the number. So the reciprocal of 8 is \(\frac{1}{8}\), and the reciprocal of \(\frac{1}{8}\) is 8. To find the negative reciprocal, first find the reciprocal and then change the sign.
As with parallel lines, we can determine whether two lines are perpendicular by comparing their slopes, assuming that the lines are neither horizontal nor perpendicular. The slope of each line below is the negative reciprocal of the other so the lines are perpendicular.
\[\begin{align} f(x)&=\dfrac{1}{4}x+2 &\text{negative reciprocal of $\dfrac{1}{4}$ is -4} \\ f(x)&=-4x+3 &\text{negative reciprocal of -4 is $\dfrac{1}{4}$} \end{align}\]
The product of the slopes is –1.
\[−4\Big(\dfrac{1}{4}\Big)=−1\]
Definition: Parallel and Perpendicular Lines
Two lines are parallel lines if they do not intersect. The slopes of the lines are the same.
\(f(x)=m_1x+b_1\) and \(g(x)=m_2x+b_2\) are parallel if \(m_1 = m_2\).
If and only if \(b_1=b_2\) and \(m_1=m_2\), we say the lines coincide. Coincident lines are the same line.
Two lines are perpendicular lines if they intersect at right angles.
\(f(x)=m_1x+b_1\) and \(g(x)=m_2x+b_2\) are perpendicular if \(m_1m_2=−1\), and so \(m_2=\dfrac{−1}{m_1}\).
Example \(\PageIndex{8}\): Identifying Parallel and Perpendicular Lines
Given the functions below, identify the functions whose graphs are a pair of parallel lines and a pair of perpendicular lines.
\[\begin{align} f(x)&=2x+3 & h(x)&=-2x+2 \\ g(x)&=\dfrac{1}{2}x-4 & f(x)&=2x-6 \end{align}\]
Solution
Parallel lines have the same slope. Because the functions \(f(x)=2x+3\) and \(j(x)=2x−6\) each have a slope of 2, they represent parallel lines. Perpendicular lines have negative reciprocal slopes. Because −2 and \(\frac{1}{2}\) are negative reciprocals, the equations, \(g(x)=\frac{1}{2}x−4\) and \(h(x)=−2x+2\) represent perpendicular lines.
Analysis
A graph of the lines is shown in Figure \(\PageIndex{22}\).
Figure \(\PageIndex{22}\): Graph of \(h(x)\) (blue), \(f(x)\) (orange), \(j(x)\) (green), and \(g(x)\) (red)
The graph shows that the lines \(f(x)=2x+3\) and \(j(x)=2x–6\) are parallel, and the lines \(g(x)=\frac{1}{2}x–4\) and \(h(x)=−2x+2\) are perpendicular.
Writing 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+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{align} g(x)&=3x+6 \\ h(x)&=3x+1\\ p(x)&=3x+\dfrac{2}{3} \end{align}\]
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{align} y−y_1&=m(x−x_1) \\ y−7&=3(x−1) \\ y−7&=3x−3 \\ y&=3x+4 \end{align}\]
So \(g(x)=3x+4\) is parallel to \(f(x)=3x+1\) and passes through the point \((1, 7)\).
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.
- Find the slope of the function.
- Substitute the given values into either the general point-slope equation or the slope-intercept equation for a line.
- Simplify.
Example \(\PageIndex{9}\): Finding a Line Parallel to a Given Line
Find a line parallel to the graph of \(f(x)=3x+6\) that passes through the point \((3, 0)\).
Solution
The slope of the given line is 3. If we choose the slope-intercept form, we can substitute \(m=3\), \(x=3\), and \(f(x)=0\) into the slope-intercept form to find the y-intercept.
\[\begin{align} g(x)&=3x+b \\ 0&=3(3)+b \\ b&=-9 \end{align}\]
The line parallel to \(f(x)\) that passes through \((3,0)\) is \(g(x)=3x−9\).
Analysis
We can confirm that the two lines are parallel by graphing them. Figure \(\PageIndex{23}\) shows that the two lines will never intersect.
Figure \(\PageIndex{23}\): Graph of two functions where the blue line is \(y=3x+6\), and the orange line is \(y=3x-9\).
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+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{align} g(x)&=-\dfrac{1}{2}x+4 \\ h(x)&=-\dfrac{1}{2}x+2 \\ p(x)&=-\dfrac{1}{2}x-\dfrac{1}{2} \end{align}\]
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{align} g(x)&=mx+b \\ 0&=-\dfrac{1}{2}(4)+b \\ 0 & = -2+b\\ 2&=b \\ b&=2 \end{align}\]
The equation for the function with a slope of \(−\frac{1}{2}\) and a y-intercept of 2 is
\[g(x)=−\dfrac{1}{2}x+2\]
So \(g(x)=−\frac{1}{2}x+2\) is perpendicular to \(f(x)=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.
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.
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.
- Find the slope of the function.
- Determine the negative reciprocal of the slope.
- Substitute the new slope and the values for \(x\) and \(y\) from the coordinate pair provided into \(g(x)=mx+b\).
- Solve for \(b\).
- Write the equation for the line.
Example \(\PageIndex{10}\): Finding the Equation of a Perpendicular Line
Find the equation of a line perpendicular to \(f(x)=3x+3\) that passes through the point \((3, 0)\).
Solution
The original line has slope \(m=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{align} g(x)&= \; –\dfrac{1}{3}x+b \\ 0&= \; –\dfrac{1}{3}(3)+b \\ 1&=b \\ b&=1 \end{align}\]
The line perpendicular to \(f(x)\) that passes through \((3, 0)\) is \(g(x)=−\frac{1}{3}x+1\).
Analysis
A graph of the two lines is shown in Figure \(\PageIndex{24}\) below.
Figure \(\PageIndex{24}\): Graph of two functions where the blue line is \(g(x)= -\frac{1}{3}x+1\), and the orange line is \(f(x)=3x+6\).
Exercise \(\PageIndex{5}\)
Given the function \(h(x)=2x−4\), write an equation for the line passing through \((0,0)\) that is
- parallel to \(h(x)\)
- perpendicular to \(h(x)\)
- Answer
-
\(f(x)=2x\) \(g(x)=−\frac{1}{2}x\)
Given two points on a line and a third point, write the equation of the perpendicular line that passes through the point.
- Determine the slope of the line passing through the points.
- Find the negative reciprocal of the slope.
- Use the slope-intercept form or point-slope form to write the equation by substituting the known values.
- Simplify.
Example \(\PageIndex{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)\).
From the two points of the given line, we can calculate the slope of that line.
\[\begin{align} m_1&=\dfrac{5-6}{4−(−2)} \\ &=\dfrac{-1}{6} \\ &=−\dfrac{1}{6} \end{align}\]
Find the negative reciprocal of the slope.
\[\begin{align} m_2&=\dfrac{-1}{-\dfrac{1}{6}} \\ &=−1\Big(−\dfrac{6}{1}\Big) \\ & =6 \end{align}\]
We can then solve for the y-intercept of the line passing through the point \((4,5)\).
\[\begin{align} g(x)&=6x+b \\ 5&=6(4)+b \\ 5&=24+b \\ −19&=b \\ b&=−19 \end{align}\]
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\]
\(\PageIndex{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
\(y= \; –\dfrac{1}{3}x+6\)
Solving a System of Linear Equations Using a Graph
A system of linear equations includes two or more linear equations. The graphs of two lines will intersect at a single point if they are not parallel. Two parallel lines can also intersect if they are coincident, which means they are the same line and they intersect at every point. For two lines that are not parallel, the single point of intersection will satisfy both equations and therefore represent the solution to the system.
To find this point when the equations are given as functions, we can solve for an input value so that \(f(x)=g(x)\). In other words, we can set the formulas for the lines equal to one another, and solve for the input that satisfies the equation.
Example \(\PageIndex{12}\): Finding a Point of Intersection Algebraically
Find the point of intersection of the lines \(h(t)=3t−4\) and \(j(t)=5−t\).
Solution
Set \(h(t)=j(t)\).
\[\begin{align} 3t-4&=5-t \\ 4t&=9 \\ t&=\dfrac{9}{4} \end{align}\]
This tells us the lines intersect when the input is \(\frac{9}{4}\).
We can then find the output value of the intersection point by evaluating either function at this input.
\[\begin{align} j\Big( \dfrac{9}{4} \Big)&=5-\dfrac{9}{4} \\ &= \dfrac{11}{4}\end{align}\]
These lines intersect at the point \(\Big(\frac{9}{4},\frac{11}{4}\Big)\).
Analysis
Looking at Figure \(\PageIndex{25}\), this result seems reasonable.
Figure \(\PageIndex{25}\): Graph of two functions \(h(t) = 3t - 4\) and \(j(t)=t +5\) and their intersection at \((\frac{9}{4},\frac{11}{4})\).
If we were asked to find the point of intersection of two distinct parallel lines, should something in the solution process alert us to the fact that there are no solutions?
Yes. After setting the two equations equal to one another, the result would be the contradiction “\(0 = \text{non-zero real number}\)”.
\(\PageIndex{7}\): Look at the graph in Figure \(\PageIndex{23}\) and identify the following for the function \(j(t):\)
- y-intercept
- x-intercept(s)
- slope
- Is \(j(t)\) parallel or perpendicular to \(h(t)\) (or neither)?
- Is \(j(t)\) an increasing or decreasing function (or neither)?
- Write a transformation description for \(j(t)\) from the identity toolkit function \(f(x)=x\).
Solution
- \((0,5)\)
- (5, 0)
- Slope -1
- Neither parallel nor perpendicular
- Decreasing function
-
Given the identity function, perform a vertical flip (over the t-axis) and shift up 5 units.
Example \(\PageIndex{13}\): Finding a Break-Even Point
A company sells sports helmets. The company incurs a one-time fixed cost for $250,000. Each helmet costs $120 to produce, and sells for $140.
- Find the cost function, \(C\), to produce \(x\) helmets, in dollars.
- Find the revenue function, \(R\), from the sales of \(x\) helmets, in dollars.
- Find the break-even point, the point of intersection of the two graphs \(C\) and \(R\).
Solution
a. The cost function in the sum of the fixed cost, $125,000, and the variable cost, $120 per helmet.
\(C(x)=120x+250,000\)
b. The revenue function is the total revenue from the sale of \(x\) helmets, \(R(x)=140x\).
c. The break-even point is the point of intersection of the graph of the cost and revenue functions. To find the x-coordinate of the coordinate pair of the point of intersection, set the two equations equal, and solve for \(x\).
\[\begin{align} C(x)&=R(x) \\ 250,000+120x&=140x \\ 250,000&=20x \\ x&=12,500 \end{align}\]
To find \(y\), evaluate either the revenue or the cost function at 12,500.
\[\begin{align} R(20)&=140(12,500) \\ &=$1,750,000 \end{align}\]
The break-even point is \((12,500,1,750,000)\).
Analysis
This means if the company sells 12,500 helmets, they break even; both the sales and cost incurred equaled 1.75 million dollars. See Figure \(\PageIndex{26}\).
Figure \(\PageIndex{26}\): Graph of the two functions, \(C(x)\) and \(R(x)\) where it shows that below \((12500, 1750000)\) the company loses money and above that point the company makes a profit.
Key Concepts
- Linear functions may be graphed by plotting points or by using the y-intercept and slope.
- Graphs of linear functions may be transformed by using shifts up, down, left, or right, as well as through stretches, compressions, and reflections.
- The y-intercept and slope of a line may be used to write the equation of a line.
- The x-intercept is the point at which the graph of a linear function crosses the x-axis.
- Horizontal lines are written in the form, \(f(x)=b\).
- Vertical lines are written in the form, \(x=b\).
- Parallel lines have the same slope.
- Perpendicular lines have negative reciprocal slopes, assuming neither is vertical.
- A line parallel to another line, passing through a given point, may be found by substituting the slope value of the line and the x- and y-values of the given point into the equation, \(f(x)=mx+b\), and using the \(b\) that results. Similarly, the point-slope form of an equation can also be used.
- A line perpendicular to another line, passing through a given point, may be found in the same manner, with the exception of using the negative reciprocal slope.
- A system of linear equations may be solved setting the two equations equal to one another and solving for \(x\). The y-value may be found by evaluating either one of the original equations using this x-value.
- A system of linear equations may also be solved by finding the point of intersection on a graph.
Exercises
Verbal
If the graphs of two linear functions are parallel, describe the relationship between the slopes and the y-intercepts.
The slopes are equal; y-intercepts are not equal.
If the graphs of two linear functions are perpendicular, describe the relationship between the slopes and the y-intercepts.
If a horizontal line has the equation \(f(x)=a\) and a vertical line has the equation \(x=a\), what is the point of intersection? Explain why what you found is the point of intersection.
The point of intersection is \((a,a)\). This is because for the horizontal line, all of the \(y\) coordinates are a and for the vertical line, all of the \(x\) coordinates are a. The point of intersection will have these two characteristics.
Explain how to find a line parallel to a linear function that passes through a given point.
Explain how to find a line perpendicular to a linear function that passes through a given point.
First, find the slope of the linear function. Then take the negative reciprocal of the slope; this is the slope of the perpendicular line. Substitute the slope of the perpendicular line and the coordinate of the given point into the equation \(y=mx+b\) and solve for \(b\). Then write the equation of the line in the form \(y=mx+b\) by substituting in \(m\) and \(b\).
Algebraic
For the following exercises, determine whether the lines given by the equations below are parallel, perpendicular, or neither parallel nor perpendicular:
\(4x−7y=10 \\ 7x+4y=1\)
\(3y+x=12 \\ −y=8x+1\)
neither parallel or perpendicular
\(3y+4x=12 \\ −6y=8x+1\)
\(6x−9y=10 \\ 3x+2y=1\)
perpendicular
\(y=\frac{2}{3}x+1 \\ 3x+2y=1\)
\(y=\frac{3}{4}x+1 \\ −3x+4y=1\)
parallel
For the following exercises, find the x- and y-intercepts of each equation
\(f(x)=−x+2\)
\(g(x)=2x+4\)
\((–2, 0); (0, 4)\)
\(h(x)=3x−5\)
\(k(x)=−5x+1\)
\((\frac{1}{5}, 0); (0, 1)\)
\(−2x+5y=20\)
\(7x+2y=56\)
\((8, 0); (0, 28)\)
For the following exercises, use the descriptions of each pair of lines given below to find the slopes of Line 1 and Line 2. Is each pair of lines parallel, perpendicular, or neither?
Line 1: Passes through \((0,6)\) and \((3,−24)\)
Line 2: Passes through \((−1,19)\) and \((8,−71)\)
Line 1: Passes through \((−8,−55)\) and \((10, 89)\)
Line 2: Passes through \((9,−44)\) and \((4,−14)\)
Line 1: \(m=8\) Line 2: \(m=–6\) Neither
Line 1: Passes through \((2,3)\) and (4,−1)
Line 2: Passes through \((6,3)\) and \((8,5)\)
Line 1: Passes through \((1,7)\) and \((5,5)\)
Line 2: Passes through \((−1,−3)\) and \((1,1)\)
Line 1: \(m=–12\) Line 2: \(m=2\) Perpendicular
Line 1: Passes through \((0,5)\) and \((3,3)\)
Line 2: Passes through \((1,−5)\) and \((3,−2)\)
Line 1: Passes through \((2,5)\) and \((5,−1)\)
Line 2: Passes through \((−3,7)\) and \((3,−5)\)
Line 1: \(m=–2\) Line 2: \(m=–2\) Parallel
Write an equation for a line parallel to \(f(x)=−5x−3\) and passing through the point \((2, –12)\).
Write an equation for a line parallel to \(g(x)=3x−1\) and passing through the point \((4,9)\).
\(g(x)=3x−3\)
Write an equation for a line perpendicular to \(h(t)=−2t+4\) and passing through the point \((-4, –1)\).
Write an equation for a line perpendicular to \(p(t)=3t+4\) and passing through the point \((3,1)\).
\(p(t)=−\frac{1}{3}t+2\)
Find the point at which the line \(f(x)=−2x−1\) intersects the line \(g(x)=−x\).
Find the point at which the line \(f(x)=2x+5\) intersects the line \(g(x)=−3x−5\).
\((−2,1)\)
Use algebra to find the point at which the line \(f(x)= −\frac{4}{5}x +\frac{274}{25}\) intersects the line \(h(x)=\frac{9}{4}x + \frac{73}{10}.\)
Use algebra to find the point at which the line \(f(x)=\frac{7}{4}x + \frac{457}{60}\) intersects the line \(g(x)=\frac{4}{3}x + \frac{31}{5}\).
\((−\frac{17}{5},\frac{5}{3})\)
Graphical
For the following exercises, the given linear equation with its graph in Figure.
\(f(x)=−x−1\)
\(f(x)=−2x−1\)
F
\(f(x)=−\frac{1}{2}x−1\)
\(f(x)=2\)
C
\(f(x)=2+x\)
\(f(x)=3x+2\)
A
For the following exercises, sketch a line with the given features.
An x-intercept of \((–4, 0)\) and y-intercept of \((0, –2)\)
An x-intercept of \((–2, 0)\) and y-intercept of \((0, 4)\)
A y-intercept of \((0, 7)\) and slope \(−\frac{3}{2}\)
A y-intercept of \((0, 3)\) and slope \(\frac{2}{5}\)
Passing through the points \((–6, –2)\) and \((6, –6)\)
Passing through the points \((–3, –4)\) and \((3, 0)\)
For the following exercises, sketch the graph of each equation.
\(f(x)=−2x−1\)
\(g(x)=−3x+2\)
\(h(x)=\frac{1}{3}x+2\)
\(k(x)=\frac{2}{3}x−3\)
\(f(t)=3+2t\)
\(p(t)=−2 + 3t\)
\(x=3\)
\(x=−2\)
\(r(x)=4\)
\(q(x)=3\)
\(4x=−9y+36\)
\(\frac{x}{3}−\frac{y}{4}=1\)
\(3x−5y=15\)
\(3x=15\)
\(3y=12\)
If \(g(x)\) is the transformation of \(f(x)=x\) after a vertical compression by \(\frac{3}{4}\), a shift right by 2, and a shift down by 4
Write an equation for \(g(x)\).
What is the slope of this line?
Find the y-intercept of this line.
\(g(x)=0.75x−5.5\)
If \(g(x)\) is the transformation of \(f(x)=x\) after a vertical compression by \(\frac{1}{3}\), a shift left by 1, and a shift up by 3
Write an equation for \(g(x)\).
What is the slope of this line?
Find the y-intercept of this line.
For the following exercises,, write the equation of the line shown in the graph.
\(y=3\)
\(x=−3\)
For the following exercises, find the point of intersection of each pair of lines if it exists. If it does not exist, indicate that there is no point of intersection.
\(y=\frac{3}{4}x+1 \\ −3x+4y=12\)
no point of intersection
\(2x−3y=12 \\ 5y+x=30\)
\(2x=y−3 \\ y+4x=15\)
\((2, 7)\)
\(x−2y+2=3 \\ x−y=3 \)
\(5x+3y=−65 \\ x−y=−5 \)
\((–10, –5)\)
Extensions
Find the equation of the line parallel to the line \(g(x)=−0.01x + 2.01\) through the point \((1, 2)\).
Find the equation of the line perpendicular to the line \(g(x)=−0.01x+2.01\) through the point \((1, 2)\).
\(y=100x−98\)
For the following exercises, use the functions \(f(x)=−0.1x+200\) and \(g(x)=20x+0.1\).
Find the point of intersection of the lines \(f\) and \(g\).
Where is \(f(x)\) greater than \(g(x)?\) Where is \(g(x)\) greater than \(f(x)?\)
\(x<\frac{1999}{201}x>\frac{1999}{201}\)
Real-World Applications
A car rental company offers two plans for renting a car.
Plan A: $30 per day and $0.18 per mile
Plan B: $50 per day with free unlimited mileage
How many miles would you need to drive for plan B to save you money?
A cell phone company offers two plans for minutes.
Plan A: $20 per month and $1 for every one hundred texts.
Plan B: $50 per month with free unlimited texts.
How many texts would you need to send per month for plan B to save you money?
Less than 3000 texts
A cell phone company offers two plans for minutes.
Plan A: $15 per month and $2 for every 300 texts.
Plan B: $25 per month and $0.50 for every 100 texts.
How many texts would you need to send per month for plan B to save you money?
Glossary
horizontal line
a line defined by \(f(x)=b\), where \(b\) is a real number. The slope of a horizontal line is 0.
parallel lines
two or more lines with the same slope
perpendicular lines
two lines that intersect at right angles and have slopes that are negative reciprocals of each other
vertical line
a line defined by \(x=a\), where a is a real number. The slope of a vertical line is undefined.
x-intercept
the point on the graph of a linear function when the output value is 0; the point at which the graph crosses the horizontal axis
Contributors
Jay Abramson (Arizona State University) with contributing authors. Textbook content produced by OpenStax College is licensed under a Creative Commons Attribution License 4.0 license. Download for free at https://openstax.org/details/books/precalculus.