Finding Input and Output Values of a Function

Evaluation of Functions in Algebraic Forms

When we have a function in formula form, it is usually a simple matter to evaluate the function. For example, the function f(x)=5-3 x^{2} can be evaluated by squaring the input value, multiplying by 3, and then subtracting the product from 5.

HOW TO

Given the formula for a function, evaluate.
  1. Substitute the input variable in the formula with the value provided.
  2. Calculate the result.

Example 6

Evaluating Functions at Specific Values

Evaluate f(x)=x^{2}+3 x-4 at:

(a) 2

(b) a

(c) a+h

(d) Now evaluate \dfrac{f(a+h)-f(a)}{h}

Solution

Replace the x in the function with each specified value.

(a) Because the input value is a number, 2, we can use simple algebra to simplify.

\begin{aligned}f(2)=2^{2}+3(2)-& 4 \\&=4+6-4 \\&=6\end{aligned}

(b) In this case, the input value is a letter so we cannot simplify the answer any further.

f(a)=a^{2}+3 a-4

With an input value of a+h, we must use the distributive property.

\begin{aligned}f(a+h)=(a+h)^{2}+3(a+h)-4 & \\&=a^{2}+2 a h+h^{2}+3 a+3 h-4\end{aligned}

(c) In this case, we apply the input values to the function more than once, and then perform algebraic operations on the result. We already found that

f(a+h)=a^{2}+2 a h+h^{2}+3 a+3 h-4

and we know that

f(a)=a^{2}+3 a-4

Now we combine the results and simplify.

\begin{aligned}\frac{f(a+h)-f(a)}{h} &=\frac{\left(a^{2}+2 a h+h^{2}+3 a+3 h-4\right)-\left(a^{2}+3 a-4\right)}{h}\\&=\frac{2 a h+h^{2}+3 h}{h}\\&=\frac{h(2 a+h+3)}{h} \qquad \qquad \text { Factor out } h \text {. }\\&=2 a+h+3 \qquad \qquad \qquad \text { Simplify. }\end{aligned}

Example 7

Evaluating Functions

Given the function h(p)=p^{2}+2 p, evaluate h(4).

Solution

To evaluate h(4), we substitute the value 4 for the input variable p in the given function.

 \begin{aligned}h(p) &=p^{2}+2 p \\h(4) &=(4)^{2}+2(4) \\&=16+8 \\&=24\end{aligned}

Therefore, for an input of 4, we have an output of 24.

Try It #4

Given the function g(m)=\sqrt{m-4}, evaluate g(5).

Example 8

Solving Functions

Given the function h(p)=p^{2}+2 p, solve for h(p)=3.

Solution

\begin{aligned} h(p)=3 & \\ p^{2}+2 p=3 & \text { Substitute the original function } h(p)=p^{2}+2 p \\ p^{2}+2 p-3=0 & \text { Subtract } 3 \text { from each side. } \\(p+3)(p-1)=0 & \text { Factor. } \end{aligned}

If (p+3)(p-1)=0, either (p+3)=0 or (p-1)=0 (or both of them equal 0). We will set each factor equal to 0 and solve for p in each case.

\begin{aligned}&(p+3)=0, \quad p=-3 \\&(p-1)=0, \quad p=1\end{aligned}

This gives us two solutions. The output h(p)=3 when the input is either p=1 or p=-3. We can also verify by graphing as in Figure 3. The graph verifies that h(1)=h(-3)=3 and h(4)=24.

Graph of a parabola with labeled points (-3, 3), (1, 3), and (4, 24).

Figure 3

Try It #5

Given the function g(m)=\sqrt{m-4}, solve g(m)=2.