Unit 1, lesson 3

Function Notation and Evaluation

How to read f(x) as the output of a function at the input x, evaluate a function from a formula, a table or a graph, and substitute whole expressions such as a + h correctly.

  • Theory part 5
  • Practice part 6
  • Sets and Functions

Theory, part 5

Practice, part 6

A weather forecast lists the temperature hour by hour. If TT is that function and tt counts hours after midnight, then T(14)T(14) is the temperature at two in the afternoon. Function notation records which input you used and which output you got in a few symbols. Calculus uses it on every page, often with inputs like a+ha + h that are expressions rather than numbers.

Key terms

Function notation

Definition Let ff be a function with domain DD. For each x∈Dx \in D, the symbol f(x)f(x), read ”ff of xx”, denotes the unique output that ff assigns to xx. A formula such as

f(x)=3x2−1f(x) = 3x^2 - 1

defines a function by saying that for every xx in its domain the output is 3x2−13x^2 - 1. The letter used for the input is a placeholder, so f(t)=3t2−1f(t) = 3t^2 - 1 defines the same function. When no domain is stated, the domain is the natural domain of the formula. Writing y=f(x)y = f(x) names the output yy.

In plain words The name of the function goes outside the parentheses and the input goes inside. The whole symbol stands for the output.

Example The rule “square the input, then add 11” is written f(x)=x2+1f(x) = x^2 + 1. Then f(3)=32+1=10f(3) = 3^2 + 1 = 10, so the point (3,10)(3, 10) is on the graph of ff. Writing g(u)=u2+1g(u) = u^2 + 1 describes the same rule with a different letter, and indeed g(3)=10g(3) = 10 as well.

Function value as an output

Definition For an input aa in the domain of ff, the function value f(a)f(a) is a single number, the output at aa. The letter ff names the function itself, the whole rule or set of pairs, and is not a number. The equation f(a)=bf(a) = b says exactly that (a,b)(a, b) belongs to ff, which means that the point (a,b)(a, b) lies on the graph of ff.

In plain words The letter ff is the machine. The symbol f(a)f(a) is what comes out when you feed it aa.

Example A ball thrown upward is at height

s(t)=20t−5t2 meterss(t) = 20t - 5t^2 \text{ meters}

after tt seconds. The value s(2)=40−20=20s(2) = 40 - 20 = 20 says that two seconds after the throw the ball is 2020 meters high, and the point (2,20)(2, 20) is on the graph of ss. A statement like "s=20s = 20" makes no sense, since ss is the whole height function and not one height.

Evaluation

Definition To evaluate ff at aa means to find the value f(a)f(a). This is possible exactly when aa is in the domain of ff. If aa is not in the domain, then f(a)f(a) is undefined, and no algebra can produce a value for it.

In plain words Evaluating is asking the function for its answer at one input. Some inputs simply have no answer.

Example Let

g(x)=1x−1.g(x) = \frac{1}{x - 1}.

Then g(3)=12g(3) = \frac{1}{2} and g(0)=−1g(0) = -1. At x=1x = 1 the denominator is 00, so 11 is not in the domain and g(1)g(1) is undefined.

Substitution

Definition When ff is given by a formula in xx, the value f(a)f(a) is found by replacing every occurrence of xx in the formula by aa, written in parentheses, and then simplifying with the usual order of operations.

In plain words Swap each xx for the input, keep the input in parentheses, and then simplify.

Example Let f(x)=x2−3x+2f(x) = x^2 - 3x + 2. Then

f(−2)=(−2)2−3(−2)+2=4+6+2=12.\begin{aligned} f(-2) &= (-2)^2 - 3(-2) + 2 \\[0.4em] &= 4 + 6 + 2 \\[0.4em] &= 12. \end{aligned}

The parentheses matter. If the first term were written as −22-2^2, it would be read as −(22)=−4-(2^2) = -4, and the result would come out as 44 instead of 1212.

Evaluating from a table or a graph

Definition If ff is given completely by a table, then f(a)f(a) is the output listed with the input aa, and f(a)f(a) is undefined if aa is not among the listed inputs. If ff is given by its graph, then f(a)f(a) is the second coordinate of the point where the vertical line x=ax = a meets the graph. So

f(a)=b  ⟺  (a,b) is on the graph of f.\begin{aligned} &f(a) = b \\[0.4em] &\iff (a, b) \text{ is on the graph of } f. \end{aligned}

If the vertical line x=ax = a misses the graph, then aa is not in the domain.

In plain words In a table, find the input and read the output next to it. On a graph, go to the input on the horizontal axis, move up or down to the graph, and read the height there.

Example A function ff is given by this table.

xx−1-100112233
f(x)f(x)4411001144

Then f(2)=1f(2) = 1, while f(5)f(5) is undefined because 55 is not listed. Reading the table backwards answers a different question. The inputs with f(x)=1f(x) = 1 are x=0x = 0 and x=2x = 2. If the graph of a function gg passes through (−1,3)(-1, 3) and (2,0)(2, 0), then g(−1)=3g(-1) = 3 and g(2)=0g(2) = 0.

Arbitrary inputs

Definition The input of ff may be any expression whose value lies in the domain of ff, such as a letter aa, or 2x2x, x+1x + 1 or x2x^2. To find ff of an expression, substitute the whole expression, in parentheses, for every occurrence of the variable in the formula, and then simplify.

In plain words The input slot does not care whether it receives a number or an expression. Whatever goes in replaces every xx, all of it at once.

Example Let f(x)=x2−3xf(x) = x^2 - 3x. Then

f(2a)=(2a)2−3(2a)=4a2−6af(2a) = (2a)^2 - 3(2a) = 4a^2 - 6a

and

f(x+1)=(x+1)2−3(x+1)=x2+2x+1−3x−3=x2−x−2.\begin{aligned} f(x + 1) &= (x + 1)^2 - 3(x + 1) \\[0.4em] &= x^2 + 2x + 1 - 3x - 3 \\[0.4em] &= x^2 - x - 2. \end{aligned}

A quick numerical check helps. For x=2x = 2 the last formula gives 4−2−2=04 - 2 - 2 = 0, and indeed f(3)=9−9=0f(3) = 9 - 9 = 0.

Evaluating at a plus h

Definition For numbers aa and hh such that a+ha + h is in the domain of ff, the value f(a+h)f(a + h) is the output of ff at the single input a+ha + h. It is computed by substituting a+ha + h for the variable. In general f(a+h)f(a + h) is neither f(a)+hf(a) + h nor f(a)+f(h)f(a) + f(h).

In plain words Think of a+ha + h as one input, a step of size hh away from aa. Put the whole sum in the input slot before doing anything else.

Example Let f(x)=x2+1f(x) = x^2 + 1. Then

f(a+h)=(a+h)2+1=a2+2ah+h2+1.\begin{aligned} f(a + h) &= (a + h)^2 + 1 \\[0.4em] &= a^2 + 2ah + h^2 + 1. \end{aligned}

Compare this with the two tempting wrong answers, f(a)+h=a2+1+hf(a) + h = a^2 + 1 + h and f(a)+f(h)=a2+h2+2f(a) + f(h) = a^2 + h^2 + 2. With a=1a = 1 and h=2h = 2 the correct value is f(3)=10f(3) = 10, while the wrong ones give 44 and 77. Subtracting f(a)f(a) and dividing by h≠0h \ne 0 gives

f(a+h)−f(a)h=2ah+h2h=2a+h,\begin{aligned} \frac{f(a + h) - f(a)}{h} &= \frac{2ah + h^2}{h} \\[0.8em] &= 2a + h, \end{aligned}

which is the difference quotient behind derivatives.

Function value versus multiplication

Definition In f(x)f(x) the parentheses mean “apply ff to xx”, not “multiply ff by xx”. Function evaluation has no distributive law. The equations

f(a+b)=f(a)+f(b)f(a + b) = f(a) + f(b)

and

f(cx)=c f(x)f(cx) = c\,f(x)

hold for all real inputs when f(x)=mxf(x) = mx for a constant mm, but they fail for most other functions, for example for f(x)=x2f(x) = x^2 and for f(x)=x+1f(x) = x + 1. So neither may be used unless it has been checked for the function at hand. Whether a letter followed by parentheses means multiplication or evaluation depends on whether the letter names a number or a function.

In plain words A function is not a number you can hand out across a sum. To find f(a+b)f(a + b), add first and then apply ff.

Example Take f(x)=x2f(x) = x^2. Then f(3+4)=f(7)=49f(3 + 4) = f(7) = 49, while f(3)+f(4)=9+16=25f(3) + f(4) = 9 + 16 = 25. Similarly f(2⋅3)=36f(2 \cdot 3) = 36, while 2f(3)=182f(3) = 18. By contrast, if kk is the number 55, then k(x+1)=5x+5k(x + 1) = 5x + 5 really is a product.

Check yourself

  1. Let g(x)=2x2−xg(x) = 2x^2 - x. Find g(−3)g(-3) and g(a+1)g(a + 1).
Show the answer

Substituting gives

g(−3)=2(−3)2−(−3)=18+3=21.\begin{aligned} g(-3) &= 2(-3)^2 - (-3) \\[0.4em] &= 18 + 3 \\[0.4em] &= 21. \end{aligned}

For the second value,

g(a+1)=2(a+1)2−(a+1)=2a2+4a+2−a−1=2a2+3a+1.\begin{aligned} g(a + 1) &= 2(a + 1)^2 - (a + 1) \\[0.4em] &= 2a^2 + 4a + 2 - a - 1 \\[0.4em] &= 2a^2 + 3a + 1. \end{aligned}
  1. Let f(x)=x2−4xf(x) = x^2 - 4x. Simplify the following expression for h≠0h \ne 0.
f(3+h)−f(3)h\frac{f(3 + h) - f(3)}{h}
Show the answer

First

f(3+h)=(3+h)2−4(3+h)=9+6h+h2−12−4h=h2+2h−3,\begin{aligned} f(3 + h) &= (3 + h)^2 - 4(3 + h) \\[0.4em] &= 9 + 6h + h^2 - 12 - 4h \\[0.4em] &= h^2 + 2h - 3, \end{aligned}

and f(3)=9−12=−3f(3) = 9 - 12 = -3. So

f(3+h)−f(3)h=h2+2hh=h+2.\begin{aligned} \frac{f(3 + h) - f(3)}{h} &= \frac{h^2 + 2h}{h} \\[0.8em] &= h + 2. \end{aligned}
  1. For f(x)=x2f(x) = x^2, is it true that f(2x)=2f(x)f(2x) = 2f(x) for every xx?
Show the answer

No. Substituting gives f(2x)=(2x)2=4x2f(2x) = (2x)^2 = 4x^2, while 2f(x)=2x22f(x) = 2x^2. The two agree only at x=0x = 0. For example, f(2⋅1)=4f(2 \cdot 1) = 4 but 2f(1)=22f(1) = 2.

How this lesson connects