Solution:
Key idea: The composite fog(x) means f(g(x)): put g(x) into f. gof(x) means g(f(x)): put f(x) into g. For fog we will need the cube of a sum, (a+b)3=a3+3a2b+3ab2+b3.
Step 1 — Write fog(x). The function f cubes its input, so we cube 2x2+1.
fog(x)=f(2x2+1)
fog(x)=(2x2+1)3
Step 2 — Expand the cube. We use the identity with a=2x2 and b=1, writing each of the four terms.
(2x2+1)3=(2x2)3+3(2x2)2(1)+3(2x2)(1)2+13
(2x2+1)3=8x6+12x4+6x2+1
Step 3 — Write gof(x). The function g doubles the square of its input and adds 1, so we put x3 into it.
gof(x)=g(x3)
gof(x)=2(x3)2+1
gof(x)=2x6+1
Therefore, fog(x)=8x6+12x4+6x2+1 and gof(x)=2x6+1.