
Mark H. answered 07/01/19
Tutoring in Math and Science at all levels
A function describes the relationship between 2 or more variables. For the simplest case with only 2 variables, one is the independent variable, and the other is the dependent variable. This is a fancy way of saying that one depends on the other.
Suppose we say that f(x) = 2x, What we are really saying is that "f" acts by taking the expression in parentheses and multiplying by 2.
Having defined f, we can write f(y) = 2y, or f(z) = 2z.
Next define another function: g(x) = x + 2
Now, suppose we are given y = f(g(x))
First, plug in our definition for g(x) to get y = f(x + 2)
Then, apply f by multiplying by 2:
y = 2(x + 2) = 2x + 4
What if we are given y = g(f(x)?
f(x) = 2x
g(2x) = 2x + 2
So....f of g of x does NOT equal g of f of x
f(g(x)) ≠ g(f(x))