$(f \circ g)(x) = f(g(x))$. Work from the inside out: apply $g$ first, then apply $f$ to the result. To get a formula, replace every $x$ in $f$ with the whole expression $g(x)$.
💡 Por qué funciona
Read $f(g(3))$ like a set of instructions. The parentheses say $g$ acts on 3 first; its output is the only thing $f$ ever sees. Order matters because the processes are different: putting on socks and then shoes is not the same as shoes and then socks. The little circle $\circ$ is read "after": $f \circ g$ is "$f$ after $g$."
Two machines in a row. Change the input and press "Swap the order" to see that $f(g(x))$ and $g(f(x))$ are usually different.
Worked examples
✏️ Ejemplo resuelto: Numbers first
Let $f(x) = x^2 + 1$ and $g(x) = 2x - 3$. Find $f(g(2))$ and $g(f(2))$.
$g(2) = 4 - 3 = 1$, then $f(1) = 1 + 1 = 2$. So $f(g(2)) = 2$.
$f(2) = 4 + 1 = 5$, then $g(5) = 10 - 3 = 7$. So $g(f(2)) = 7$.
Respuesta: $f(g(2)) = 2$ and $g(f(2)) = 7$: the order changes the answer.
✏️ Ejemplo resuelto: A formula for the composition
With the same functions, find $f(g(x))$ and $g(f(x))$.
Replace $x$ in $f$ with $(2x - 3)$: $f(g(x)) = (2x - 3)^2 + 1$.
Expand: $4x^2 - 12x + 9 + 1 = 4x^2 - 12x + 10$.
Replace $x$ in $g$ with $(x^2 + 1)$: $g(f(x)) = 2(x^2 + 1) - 3 = 2x^2 - 1$.
Check with $x = 2$: $4(4) - 24 + 10 = 2$ and $2(4) - 1 = 7$, matching the first example.
Multiplying instead of composing. $f(g(x))$ is not $f(x) \cdot g(x)$. In the first example, $f(2) \cdot g(2) = 5 \cdot 1 = 5$, but $f(g(2)) = 2$. Another slip is working in the wrong order. Check yourself by plugging in one number and evaluating step by step from the inside out.
Práctica
Apruebas con 3 respuestas correctas, las 2 últimas seguidas. Cada respuesta correcta da 2 XP.