C1 Let $f(x)=x^{2}$ and $g(x)=3 x-8$.
(a) (2 marks) Determine the values of $f(2)$ and $g(f(2))$.
(b) (4 marks) Determine all values of $x$ such that $f(g(x))=g(f(x))$.
(c) (4 marks) Let $h(x)=3 x-r$. Determine all values of $r$ such that $f(h(2))=h(f(2))$.
Solution:
(a) The answers are $f(2)=4$ and $g(f(2))=4$.
Substituting $x=2$ into $f(x)$ yields $f(2)=2^{2}=4$.
Substituting $x=2$ into $g(f(x))$ and noting that $f(2)=4$ yields $g(f(2))=g(4)=$ $3 \cdot 4-8=4$.
(b) The answers are $x=2$ and $x=6$.
Note that
$$
f(g(x))=f(3 x-8)=(3 x-8)^{2}=9 x^{2}-48 x+64
$$
and
$$
g(f(x))=g\left(x^{2}\right)=3 x^{2}-8 .
$$

Therefore, we are solving
$$
9 x^{2}-48 x+64=3 x^{2}-8 .
$$

Rearranging this into a quadratic equation yields
$$
6 x^{2}-48 x+72=0 \Rightarrow 6\left(x^{2}-8 x+12\right)=0 .
$$

This factors into $6(x-6)(x-2)=0$. Hence, $x=2$ or $x=6$. We now verify these are indeed solutions.

If $x=2$, then $f(g(2))=f(3(2)-8)=f(-2)=(-2)^{2}=4$ and $g(f(2))=4$ by part(a). Hence, $f(g(2))=g(f(2))$. Therefore, $x=2$ is a solution.

If $x=6$, then $f(g(6))=f(3 \cdot 6-8)=f(10)=10^{2}=100$ and $g(f(6))=g\left(6^{2}\right)=g(36)=$ $3 \cdot 36-8=108-8=100$. Hence, $f(g(6))=g(f(6))$. Therefore, $x=6$ is also a solution.
(c) The answers are $r=3$ and $r=8$.
We first calculate $f(h(2))$ and $h(f(2))$ in terms of $r$.
$$
f(h(2))=f(3 \cdot 2-r)=f(6-r)=(6-r)^{2}
$$
and
$$
h(f(2))=h\left(2^{2}\right)=h(4)=3 \cdot 4-r=12-r .
$$

Therefore, $(6-r)^{2}=12-r \Rightarrow r^{2}-12 r+36=12-r$. Re-arranging this yields
$$
r^{2}-11 r+24=0
$$
which factors as
$$
(r-8)(r-3)=0 \text {. }
$$

Hence, $r=3$ or $r=8$. We will now verify that both of these are indeed solutions.
If $r=3$, then $h(x)=3 x-3$. Then $f(h(2))=f(3 \cdot 2-3)=f(3)=9$ and $h(f(2))=$ $h\left(2^{2}\right)=h(4)=3 \cdot 4-3=9$. Therefore, $f(h(2))=h(f(2))$. Consequently, $r=3$ is a solution. From the result of part (b), we also verified that $r=8$ is a solution.