Sub topic 4
Evaluating a Function at a Value
Assume you can simplify algebraic expressions, substitute numbers for variables, and work with integer and fractional exponents. This chapter uses the function concept: each allowed input has exactly one output.
What does f(a) mean?
Function notation gives a compact way to name an output. In the expression f(x), the letter f names the function and x represents its input. The notation f(a) means “the output of f when the input is a.”
For example, suppose
f(x) = 2x + 3
To find f(4), replace every x with 4:
f(4) = 2(4) + 3 = 8 + 3 = 11
The parentheses in f(4) do not mean multiplication. They identify the input. The expression 2(4), however, does mean multiplication.
A reliable evaluation process is:
- Write the function rule.
- Substitute the given input for every occurrence of the variable.
- Use parentheses around a substituted value, especially when it is negative or algebraic.
- Simplify using the usual order of operations.
Numeric inputs
Let f(x) = x² - 5x + 6. Evaluate f(2):
f(2) = (2)² - 5(2) + 6 = 4 - 10 + 6 = 0
The input 2 produces the output 0.
Negative inputs require careful parentheses. For the same function:
f(-1) = (-1)² - 5(-1) + 6 = 1 + 5 + 6 = 12
Writing -1² instead of (-1)² would be incorrect because exponentiation happens before a leading negative sign. The expression -1² means -(1²), which equals -1.
Algebraic inputs
An input does not have to be a number. Let
g(x) = 3x² - 2x + 1
To evaluate g(t), replace x with t:
g(t) = 3(t)² - 2(t) + 1 = 3t² - 2t + 1
Now evaluate g(a + 1):
g(a + 1) = 3(a + 1)² - 2(a + 1) + 1
Expand and simplify:
g(a + 1) = 3(a² + 2a + 1) - 2a - 2 + 1 = 3a² + 6a + 3 - 2a - 1 = 3a² + 4a + 2
Do not replace x only in the first term. Every x in the rule must be replaced.
Combining function values
Once individual values are known, they can be combined. If f(x) = 2x + 3, then
f(1) = 5 f(2) = 7
Therefore,
f(1) + f(2) = 5 + 7 = 12
This is different from f(1 + 2). In fact,
f(1 + 2) = f(3) = 9
In general, f(a) + f(b) and f(a + b) are not equal unless the particular function makes them equal.
Using a table or a program
A table can record known input-output pairs. A short Python function follows the same substitution process as the algebraic rule.
def f(x):
return 2 * x + 3
print(f(4)) # 11
print(f(-1)) # 1
print(f(1) + f(2)) # 12, because 5 + 7The program's f(4) means the same thing as the mathematical notation f(4): apply the rule to the input 4.
Exercise
Let h(x) = 4 - x². Find h(-3), h(2), and h(a + 1).
Show answer
h(-3) = 4 - (-3)² = -5; h(2) = 4 - 2² = 0; h(a + 1) = 4 - (a + 1)² = 3 - 2a - a².