1. Imagine you have two machines: one called $g$ and one called $f$. Each machine changes a number.
2. First, you put a number into machine $g$, and it gives you a new number.
3. Then, you take that new number and put it into machine $f$, and it gives you another number.
4. This is called $f(g(x))$, which means "machine $f$ after machine $g$".
Let's see an example! 🎉
**Box 1:**
Machine g:
🍎 🍎 🍎
(3 apples)
Machine $g$ doubles the number of apples: $g(x) = 2x$
**Box 2:**
🍎 🍎 🍎
(3 apples)
Machine f:
🍎 🍎 🍎 🍎 🍎 🍎
(6 apples)
Machine $f$ adds 1 apple: $f(x) = x + 1$
Step by step:
- Start with 3 apples 🍎 🍎 🍎
- Put into $g$: $g(3) = 2 \times 3 = 6$ apples 🍎 🍎 🍎 🍎 🍎 🍎
- Then put into $f$: $f(6) = 6 + 1 = 7$ apples 🍎 🍎 🍎 🍎 🍎 🍎 🍎
So, $f(g(3)) = 7$.
Great! You used two machines one after the other! 🚀🍎 🍎 🍎 🍎 🍎 🍎
(6 apples)