Send to a Friend

Any suggestions on how to explain function composition in algebra?
I do some online tutoring and I have found that some students have a hard time with the idea of composing two functions. For example, if f(x)=3x+2 and g(x)=x+1, then f(g(x)) is 3(x+1)+2.
I tried the following, but it did not seem to work. f(g(x)) = 3(g(x)) + 1 = 3(x+1) + 2. Any other ideas? I was thinking that if students were taught to program a language like Python then the two functions could be translated into two software functions and it might be clearer.
Using Fluther
or