Functions
A function is a rule that turns each input into exactly one output, written like f(x) = 3x + 1. Function notation makes it easy to talk about combining rules (composite functions) and undoing them (inverse functions).
Key facts
- f(4) means substitute 4 into the function f.
- The domain is the set of allowed inputs; the range is the set of outputs.
- fg(x) means do g first, then f: fg(x) = f(g(x)).
- The inverse f⁻¹(x) undoes f. Write y = f(x), swap x and y, and make y the subject.
- Only one-to-one functions have an inverse; the graph of f⁻¹ is the reflection of the graph of f in y = x.
- Leave out of the domain any x that makes you divide by 0 or take the square root of a negative.
Worked examples
Example 1
f(x) = 2x² − 3. Find f(−2), and solve f(x) = 47.
- Square first. f(−2) = 2 × 4 − 3 = 5
- Set f(x) = 47. 2x² − 3 = 47, so x² = 25
- Square root. x = 5 or x = −5
Answer: f(−2) = 5; x = ±5
Example 2
f(x) = 3x − 1 and g(x) = x² + 2. Find fg(2) and gf(x).
- Work out g(2) first. g(2) = 2² + 2 = 6
- Then put 6 into f. f(6) = 3 × 6 − 1 = 17
- gf(x): put f(x) into g. gf(x) = (3x − 1)² + 2
- Expand. 9x² − 6x + 1 + 2 = 9x² − 6x + 3
Answer: fg(2) = 17; gf(x) = 9x² − 6x + 3
Example 3
Find the inverse of f(x) = (2x + 5)/3.
- Write y = f(x) and swap x and y. x = (2y + 5)/3
- Make y the subject. 3x = 2y + 5, so y = (3x − 5)/2
Answer: f⁻¹(x) = (3x − 5)/2
Example 4
Give the domain and range of f(x) = √(x − 4).
- Need x − 4 ≥ 0. x ≥ 4
- A square root is never negative. f(x) ≥ 0
Answer: Domain x ≥ 4; range f(x) ≥ 0
Example 5
f(x) = 3x + 2. Find f(4).
- Put x = 4 into the function. 3 × 4 + 2 = 14
Answer: 14
Example 6
g(x) = x^2 − 1. Find g(−3).
- Put x = −3 into the function. (−3)^2 − 1 = 9 − 1 = 8
Answer: 8
Example 7
f(x) = 5x − 4. Solve f(x) = 21.
- Set the function equal to 21. 5x − 4 = 21
- Solve. 5x = 25, x = 5
Answer: x = 5
Example 8
f(x) = 2x + 1 and g(x) = x^2. Find gf(3).
- Work out f(3) first. f(3) = 7
- Then put it into g. g(7) = 49
Answer: 49
Example 9
Find the inverse of f(x) = 4x − 3.
- Write y = 4x − 3 and make x the subject. x = (y + 3)/4
- Write it as a function of x. f⁻¹(x) = (x + 3)/4
Answer: f⁻¹(x) = (x + 3)/4