# 1.2 Composite Functions

SPM Form 4 Additional Mathematics (KSSM) · Chapter 1 Functions. Interactive version with diagrams: https://spmtuition.com/add-math/form-4/chapter-1-functions/1-2-composite-functions/

## Order of operations

*Graph of fg(x) = 2x² + 3; gf(x) = (2x + 3)²: Order changes the result: f(x) = 2x + 3 and g(x) = x².* (interactive on the web page)

1. Start with x
2. Apply g
3. Apply f

fg(x) means f(g(x)). Apply the function nearest x first.

**Worked example:** If f(x) = 2x + 3 and g(x) = x², find fg(x).

1. g(x) = x².
2. f(g(x)) = 2(x²) + 3.
3. fg(x) = 2x² + 3.

**Answer:** 2x² + 3

> **Exam tip:** fg and gf usually differ. Composition is not multiplication.

### Practice questions: Order of operations

1. f(x) = x + 1 and g(x) = 2x. Find fg(3).
   A. 7
   B. 8
   C. 9
   D. 6
   **Answer:** A. 7. First g(3) = 6, then f(6) = 7.

2. For the same functions, find gf(3).
   A. 5
   B. 8
   C. 7
   D. 6
   **Answer:** B. 8. First f(3) = 4, then g(4) = 8.

3. f(x) = 3x. Find f²(x).
   A. 6x
   B. 3x²
   C. 9x
   D. 9x²
   **Answer:** C. 9x. Apply the rule twice: 3(3x), not (3x)².

## Repeated and unknown functions

*Graph of f²(x) = x + 8; [f(x)]² = (x + 4)²: For f(x) = x + 4, applying f twice adds 8. Squaring f(x) gives a different curve.* (interactive on the web page)

f²(x) means f(f(x)), not [f(x)]².

**Worked example:** Given f(x) = x + 4 and fg(x) = 3x − 1, find g(x).

1. f(g(x)) = g(x) + 4.
2. g(x) + 4 = 3x − 1.
3. g(x) = 3x − 5.

**Answer:** g(x) = 3x − 5

The output of the inner function must lie in the domain of the outer function.

### Practice questions: Repeated and unknown functions

1. f(x) = x − 2 and fg(x) = x². Find g(x).
   A. x² − 2
   B. (x − 2)²
   C. x + 2
   D. x² + 2
   **Answer:** D. x² + 2. Subtracting 2 from g(x) must leave x².

2. f(x) = 1/x. Find f²(x), for x ≠ 0.
   A. x
   B. 1/x²
   C. −x
   D. 2/x
   **Answer:** A. x. The reciprocal of the reciprocal is the original input.

---

Online SPM tuition for Physics, Chemistry, Biology, Mathematics and Additional Mathematics, Form 4–5, in English or BM. Students who want tuition or extra help can request it at https://spmtuition.com/tuition/.
