Skip to main content

Section 2.1 Evaluating Functions from a Formula

Think of a function as a machine that turns inputs into outputs. We write \(f(x)\text{,}\) which is read "f of x". The \(f\) out front is the name of the function, which helps us know which one we're talking about. The \(x\) in the parentheses is a placeholder for the input. Think of it like an empty box, and you might even find it helpful to actually write it as an empty box that you can fill in your input later.

When we put something else into the parentheses, that's our input. So, we would replace all of the \(x\) with that thing.

Example 2.1.

Suppose \(f(x)=4x+3\text{.}\)

  1. Let's find \(f(2)\text{.}\) Since the \(2\) is inside the parentheses, that tells us that our input is supposed to be \(2\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(2\text{.}\) Since \(f({\color{red}{x}})=4{\color{red}{x}}+3\text{,}\) we get:

    \begin{equation*} f({\color{red}{2}})=4({\color{red}{2}})+3 = 8+3 = 11 \end{equation*}
    Therefore, the answer is \(11\text{.}\)

  2. Let's find \(f(-1)\text{.}\) Since the \(-1\) is inside the parentheses, that tells us that our input is supposed to be \(-1\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(-1\text{.}\) Since \(f({\color{red}{x}})=4{\color{red}{x}}+3\text{,}\) we get:

    \begin{equation*} f({\color{red}{-1}})=4({\color{red}{-1}})+3 = -4+3 = -1 \end{equation*}
    Therefore, the answer is \(-1\text{.}\)

Example 2.2.

Suppose \(g(x)=x^2+2x-1\text{.}\)

  1. Let's find \(g(0)\text{.}\) Since the \(0\) is inside the parentheses, that tells us that our input is supposed to be \(0\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(0\text{.}\) Since \(g({\color{red}{x}})={\color{red}{x}}^2+2{\color{red}{x}}-1\text{,}\) we get:

    \begin{equation*} g({\color{red}{0}})=({\color{red}{0}})^2+2({\color{red}{0}})-1=-1 \end{equation*}
    Therefore, the answer is \(-1\text{.}\)

  2. Let's find \(g(-1)\text{.}\) Since the \(-1\) is inside the parentheses, that tells us that our input is supposed to be \(-1\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(-1\text{.}\) Since \(g({\color{red}{x}})={\color{red}{x}}^2+2{\color{red}{x}}-1\text{,}\) we get:

    \begin{equation*} g({\color{red}{-1}})=({\color{red}{-1}})^2+2({\color{red}{-1}})-1=1-2-1=-2 \end{equation*}
    Therefore, the answer is \(-2\text{.}\)

Checkpoint 2.3.

Suppose \(h(x)=2x^2-5\text{.}\)

  1. Find \(h(3)\text{.}\)

  2. Find \(h(-1)\text{.}\)

Answer.
  1. \(\displaystyle h(3)=13\)

  2. \(\displaystyle h(-1)=-3\)

Solution.
  1. In this question, we want to find \(h(3)\text{.}\) Since the \(3\) is inside the parentheses, that tells us that our input is supposed to be \(3\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(3\text{.}\) Since \(h({\color{red}{x}})=2{\color{red}{x}}^2-5\text{,}\) we get:

    \begin{equation*} h({\color{red}{3}})=2({\color{red}{3}})^2-5=2(9)-5=18-5=13 \end{equation*}
    Therefore, the answer is \(13\text{.}\)

  2. In this question, we want to find \(h(-1)\text{.}\) Since the \(-1\) is inside the parentheses, that tells us that our input is supposed to be \(-1\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(-1\text{.}\) Since \(h({\color{red}{x}})=2{\color{red}{x}}^2-5\text{,}\) we get:

    \begin{equation*} h({\color{red}{-1}})=2({\color{red}{-1}})^2-5=2(1)-5=2-5=-3 \end{equation*}
    Therefore, the answer is \(-3\text{.}\)

So far, we have only seen examples where the inputs were numbers, but the inputs could be anything we want. Whatever we put in the parentheses next to the function name, we replace all of the \(x\) with that.

Example 2.4.

Suppose \(t(x)=7x-1\text{.}\)

  1. Let's find \(t(a)\text{.}\)Since the \(a\) is inside the parentheses, that tells us that our input is supposed to be \(a\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(a\text{.}\) Since \(t({\color{red}{x}})=7{\color{red}{x}}-1\text{,}\) we get:

    \begin{equation*} t({\color{red}{a}})=7({\color{red}{a}})-1=7a-1 \end{equation*}
    Therefore, the answer is \(7a-1\text{.}\)

  2. Let's find \(t(2b)\text{.}\)Since the \(2b\) is inside the parentheses, that tells us that our input is supposed to be \(2b\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(2b\text{.}\) Since \(t({\color{red}{x}})=7{\color{red}{x}}-1\text{,}\) we get:

    \begin{equation*} t({\color{red}{2b}})=7({\color{red}{2b}})-1=14b-1 \end{equation*}
    Therefore, the answer is \(14b-1\text{.}\)

  3. Let's find \(t(ah+4)\text{.}\)Since the \(ah+4\) is inside the parentheses, that tells us that our input is supposed to be \(ah+4\text{.}\) In our original formula, we replace all of the \(x\)'s with a \(ah+4\text{.}\) Since \(t({\color{red}{x}})=7{\color{red}{x}}-1\text{,}\) we get:

    \begin{equation*} t({\color{red}{ah+4}})=7({\color{red}{ah+4}})-1=7ah+28-1=7ah+27 \end{equation*}
    Therefore, the answer is \(7ah+27\text{.}\)

The last example shows how important it is to put parentheses around the input. Although sometimes you might not need them, it is a good idea to always start with parentheses around your input. This lowers your risk of forgetting something when you simplify your answer.

Sometimes, students who are first learning this notation have trouble with removing \(x\) and inserting the new input all in the same step. If that is giving you difficulty, try adding a step in the middle: replace all of the \(x\) with an empty line. After that, fill in the new input onto the empty line. With this technique, the last example would look like this:

\begin{align*} t({\color{red}{x}})\amp=7{\color{red}{x}}-1\\ t({\color{red}{\underline{\hspace{0.5in}}}})\amp=7({\color{red}{\underline{\hspace{0.5in}}}})-1\\ t({\color{red}{\underline{ah+4}}})\amp=7({\color{red}{\underline{ah+4}}})-1 \end{align*}

We can then simplify the last line to get the final answer of \(t(ah+4)=7ah+27\text{.}\)

Checkpoint 2.5.

Suppose \(f(x)=x^2-x+1\text{.}\)

  1. Evaluate \(f(b+1)\text{.}\)

  2. Evaluate \(f(a+h)\text{.}\)

  3. Evaluate \(f(\sqrt{7})\text{.}\)

Answer.
  1. \(\displaystyle f(b+1)=b^2+b+1\)

  2. \(\displaystyle f(a+h)=a^2+2ah+h^2-a-h+1\)

  3. \(\displaystyle f(\sqrt{7})=8-\sqrt{7}\)

Solution.
  1. To find \(f(b+1)=\text{:}\)

    \begin{align*} f({\color{red}{b+1}})\amp=({\color{red}{b+1}})^2-({\color{red}{b+1}})+1\\ \amp=(b+1)(b+1)-(b+1)+1\\ \amp=(b^2+2b+1)-(b+1)+1\\ \amp=b^2+2b+1-b-1+1\\ \amp=b^2+b+1 \end{align*}

  2. To find \(f(a+h)=\text{:}\)

    \begin{align*} f({\color{red}{a+h}})\amp=({\color{red}{a+h}})^2-({\color{red}{a+h}})+1\\ \amp=(a+h)(a+h)-(a+h)+1\\ \amp=(a^2+2ah+h^2)-(a+h)+1\\ \amp=a^2+2ah+h^2-a-h+1 \end{align*}

  3. To find \(f(\sqrt{7})=\text{:}\)

    \begin{align*} f({\color{red}{\sqrt{7}}})\amp=({\color{red}{\sqrt{7}}})^2-({\color{red}{\sqrt{7}}})+1\\ \amp=7-\sqrt{7}+1\\ \amp=8-\sqrt{7} \end{align*}

There is one more special case we need to look at before this section is over.

Example 2.6. Constant Functions.

Suppose \(g(x)=42\text{.}\) Notice how this one is different from the other examples we've looked at: there is no \(x\) in the formula! Normally, when we want to evaluate a function, we replace all of the \(x\) in the formula with the input. Since there is no \(x\) in the formula, the input doesn't matter. The answer is always just \(42\text{.}\)

  1. Let's find \(g(2)\text{.}\) Normally, we would replace all of the \(x\) in the formula with the new input of \(2\text{.}\) However, since there is no \(x\) in the formula, the answer is just \(42\text{.}\)

  2. Let's find \(g(a+2)\text{.}\) Normally, we would replace all of the \(x\) in the formula with the new input of \(a+2\text{.}\) However, since there is no \(x\) in the formula, the answer is just \(42\text{.}\)

Definition 2.7.

A function like the one above is called a constant function, since it's output never changes.

Checkpoint 2.8.

Suppose \(c(x)=\pi\text{.}\)

  1. Evaluate \(c(0)\text{.}\)

  2. Evaluate \(c(a+h)\text{.}\)

Answer.
  1. \(\displaystyle c(0)=\pi\)

  2. \(\displaystyle c(a+h)=\pi\)

Solution.
  1. To find \(c(0)=\pi\text{,}\) normally, we would replace all of the \(x\) in the formula with the new input of \(0\text{.}\) However, since there is no \(x\) in the formula, the answer is just \(\pi\text{.}\)

  2. To find \(c(a+h)=\pi\text{,}\) normally, we would replace all of the \(x\) in the formula with the new input of \(a+h\text{.}\) However, since there is no \(x\) in the formula, the answer is just \(\pi\text{.}\)