17.2.1: Evaluating Functions
- Page ID
- 77003
\( \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}\)- Given a function, described by an equation, find function values (outputs) for specified inputs.
Introduction
Throughout this course, you have been working with algebraic equations. Many of these equations are functions. For example, \(\ y=4 x+1\) is an equation that represents a function. When you input values for \(\ x\), you can determine a single output for \(\ y\). In this case, if you substitute \(\ x=10\) into the equation you will find that \(\ y\) must be 41; there is no other value of \(\ y\) that would make the equation true.
Rather than using the variable \(\ y\), the equations of functions can be written using function notation. Function notation is very useful when you are working with more than one function at a time, and substituting more than one variable in for \(\ x\).
Function Notation
Some people think of functions as “mathematical machines.” Imagine you have a machine that changes a number according to a specific rule, such as “multiply by 3 and add 2” or “divide by 5, add 25, and multiply by -1.” If you put a number into the machine, a new number will pop out the other end, having been changed according to the rule. The number that goes in is called the input, and the number that is produced is called the output.
You can also call the machine “\(\ f\)” for function. If you put \(\ x\) into the machine, \(\ f(x)\) comes out. Mathematically speaking, \(\ x\) is the input, or the “independent variable,” and \(\ f(x)\) is the output, or the “dependent variable,” since it depends on the value of \(\ x\).
\(\ f(x)=4 x+1\) is written in function notation and is read “\(\ f\) of \(\ x\) equals \(\ 4x\) plus 1.” It represents the following situation: A function named \(\ f\) acts upon an input, \(\ x\), and produces \(\ f(x)\) which is equal to \(\ 4 x+1\). This is the same as the equation \(\ y=4 x+1\).
Function notation gives you more flexibility because you don’t have to use \(\ y\) for every equation. Instead, you can use \(\ f(x)\) or \(\ g(x)\) or \(\ c(x)\). This can be a helpful way to distinguish equations of functions when you are dealing with more than one at a time.
You could write the formula for perimeter, \(\ P=4 s\), as the function \(\ p(x)=4 x\), and the formula for area, \(\ A=x^{2}\), as \(\ a(x)=x^{2}\). This would make it easy to graph both functions on the same graph without confusion about the variables.
Which two equations represent the same function?
- \(\ y=2 x-7 \text { and } f(x)=7-2 x\)
- \(\ 3 x=y-2 \text { and } f(x)=3 x-2\)
- \(\ f(x)=3 x^{2}+5 \text { and } y=3 x^{2}+5\)
- None of the above
- Answer
-
- Incorrect. These equations look similar but are not the same. The first has a slope of 2 and a y-intercept of -7. The second function has a slope of -2 and a y-intercept of 7. It slopes in the opposite direction. They do not produce the same graph, so they are not the same function. The correct answer is \(\ f(x)=3 x^{2}+5\) and \(\ y=3 x^{2}+5\).
- Incorrect. These equations represent two different functions. If you rewrite the first equation in terms of \(\ y\), you’ll find the equation of the function is \(\ y=3 x+2\). The correct answer is \(\ f(x)=3 x^{2}+5\) and \(\ y=3 x^{2}+5\).
- Correct. The expressions after \(\ f(x)=\) and \(\ y=\) are the same, so these are two different ways to write the same function: \(\ f(x)=3 x^{2}+5\) and \(\ y=3 x^{2}+5\).
- Incorrect. Look at the expressions that follow \(\ f(x)=\) and \(\ y=\). If the expressions are the same, then the equations represent the same exact function. The correct answer is \(\ f(x)=3 x^{2}+5\) and \(\ y=3 x^{2}+5\).
Evaluating Functions
Equations written using function notation can also be evaluated. With function notation, you might see a problem like this.
Given \(\ f(x)=4 x+1\), find \(\ f(2)\).
You read this problem like this: “given \(\ f\) of \(\ x\) equals \(\ 4x\) plus one, find \(\ f\) of 2.” While the notation and wording is different, the process of evaluating a function is the same as evaluating an equation: in both cases, you substitute 2 for \(\ x\), multiply it by 4 and add 1, simplifying to get 9. In both a function and an equation, an input of 2 results in an output of 9.
\(\ \begin{array}{l}
f(x)=4 x+1 \\
f(2)=4(2)+1=8+1=9
\end{array}\)
You can simply apply what you already know about evaluating expressions to evaluate a function. It’s important to note that the parentheses that are part of function notation do not mean multiply. The notation \(\ f(x)\) does not mean \(\ f\) multiplied by \(\ x\). Instead the notation means “\(\ f\) of \(\ x\)” or “the function of \(\ x\)” To evaluate the function, take the value given for \(\ x\), and substitute that value in for \(\ x\) in the expression. Let’s look at a couple of examples.
Given \(\ f(x)=3 x-4\), find \(\ f(5)\).
Solution
\(\ f(5)=3(5)-4\) | Substitute 5 in for \(\ x\) in the function. |
\(\ \begin{array}{l} f(5)=15-4 \\ f(5)=11 \end{array}\) |
Simplify the expression on the right side of the equation. |
Given \(\ f(x)=3 x-4, f(5)=11\).
Functions can be evaluated for negative values of \(\ x\), too. Keep in mind the rules for integer operations.
Given \(\ p(x)=2 x^{2}+5\), find \(\ p(-3)\).
Solution
\(\ p(-3)=2(-3)^{2}+5\) | Substitute -3 in for \(\ x\) in the function. |
\(\ \begin{array}{l} p(-3)=2(9)+5 \\ p(-3)=18+5 \\ p(-3)=23 \end{array}\) |
Simplify the expression on the right side of the equation. |
Given \(\ p(x)=2 x^{2}+5, p(-3)=23\).
You may also be asked to evaluate a function for more than one value as shown in the example that follows.
Given \(\ f(x)=3 x^{2}+2 x+1\), find \(\ f(0)\), \(\ f(2)\), and \(\ f(-1)\).
Solution
\(\ \begin{array}{l} f(0)=3(0)^{2}+2(0)+1 \\ f(0)=0+0+1 \\ f(0)=1 \end{array}\) |
Treat each of these like three separate problems. In each case, you substitute the value in for \(\ x\) and simplify. Start with \(\ x=0\). |
\(\ \begin{array}{l} f(2)=3(2)^{2}+2(2)+1 \\ f(2)=3(4)+4+1 \\ f(2)=12+4+1 \\ f(2)=17 \end{array}\) |
Evaluate for \(\ x=2\). |
\(\ \begin{array}{l} f(-1)=3(-1)^{2}+2(-1)+1 \\ f(-1)=3(1)+(-2)+1 \\ f(-1)=3-2+1 \\ f(-1)=1+1 \\ f(-1)=2 \end{array}\) |
Evaluate for \(\ x=-1\). |
Given \(\ f(x)=3 x^{2}+2 x+1\), \(\ f(0)=1\), \(\ f(2)=17\), and \(\ f(-1)=2\).
Given \(\ h(x)=4 x+7\), find \(\ h(-10)\).
- \(\ -40 h+7\)
- \(\ -33\)
- \(\ 4 x+17\)
- \(\ 47\)
- Answer
-
- Incorrect. \(\ h(-10)\) means “\(\ h\) of negative ten” not “\(\ h\) times negative ten.” To evaluate the function, substitute \(\ -10\) for \(\ x\). The correct answer is \(\ -33\).
- Correct. \(\ h(-10)=4(-10)+7=-40+7=-33\).
- Incorrect. To find \(\ h(-10)\), substitute \(\ -10\) in for \(\ x\) in the right side of the equation and simplify. The correct answer is \(\ -33\).
- Incorrect. Evaluate the function for \(\ h(-10)\), not \(\ h(10)\). The correct answer is \(\ -33\).
Evaluating Functions with Variable Inputs
So far, you have evaluated functions for inputs that have been constants. Functions can also be evaluated for inputs that are variables or expressions. The process is the same, but the simplified answer will contain a variable. The following examples show how to evaluate a function for a variable input.
Given \(\ f(x)=3 x^{2}+2 x+1\), find \(\ f(b)\).
Solution
\(\ f(b)=3 b^{2}+2 b+1\) |
This problem is asking you to evaluate the function for \(\ b\). This means substitute \(\ b\) in the equation for \(\ x\). (That’s it! You're done.) |
Given \(\ f(x)=3 x^{2}+2 x+1\), \(\ f(b)=3 b^{2}+2 b+1\).
In the following example, you evaluate a function for an expression. So here you will substitute the entire expression in for \(\ x\) and simplify.
Given \(\ f(x)=4 x+1\), find \(\ f(h+1)\).
Solution
\(\ f(h+1)=4(h+1)+1\) | This time, you substitute \(\ (h+1)\) into the equation for \(\ x\). |
\(\ \begin{aligned} f(h+1)&=4 h+4+1 \\ &=4 h+5 \end{aligned}\) |
Use the distributive property on the right side, and then combine like terms to simplify. |
Given \(\ f(x)=4 x+1, f(h+1)=4 h+5\).
Summary
Function notation takes the form such as \(\ f(x)=18 x-10\) and is read “\(\ f\) of \(\ x\) equals 18 times \(\ x\) minus 10.” Function notation can use letters other than \(\ f\), such as \(\ c(x)\), \(\ g(x)\), or \(\ h(x)\). As you go further in your study of functions, this notation will provide you more flexibility, allowing you to examine and compare different functions more easily. Just as an algebraic equation written in \(\ x\) and \(\ y\) can be evaluated for different values of the input \(\ x\), an equation written in function notation can also be evaluated for different values of \(\ x\). To evaluate a function, substitute in values for \(\ x\) and simplify to find the related output.