The composite function f(g(x)) applies g to x first, then f to the result. Changing the order changes the function.
f(x)=x+3, g(x)=x2 ⇒ g(f(x))=(x+3)2,f(g(x))=x2+3
For differentiation, practice seeing y=(2x+4)4 as an outer function y=u4 and an inner function u=2x+4. The chain rule multiplies the derivatives of the outer and inner parts.
Examples
-
01Write g(f(x)) as an expression:f(x)=x+3,g(x)=x2AnswerHide
Answer(x+3)2
Steps
- Substitute f into g
- g(x)=x2g(f(x))=(x+3)2
- Swapping the order gives a different expression
- f(g(x))=x2+3
-
02What is g(f(x)) − f(g(x))?g(f(x))=4x+2,f(g(x))=4x+8AnswerHide
Answer−6
Steps
- (4x+2)−(4x+8)=−6
- The x terms cancel; only the constants differ
- It is not 0 because the order changes the function
-
03Viewing this as y=u4, what is the inner u?y=(2x+4)4AnswerHide
Answer2x+4
Steps
- The bracket, which is computed first, is all of u
- u=2x+4y=u4
-
04Write f(g(x)) as an expression:f(x)=x+5,g(x)=x2AnswerHide
Answerx2+5
Steps
- Substitute g into f
- f(x)=x+5f(g(x))=x2+5
- Swapping the order gives a different expression
- g(f(x))=(x+5)2
-
05What is f(g(3))?f(x)=x+2,g(x)=x2AnswerHide
Answer11
Steps
- g goes first: compute g(3)
- g(3)=32=9
- Substitute that answer into f
- f(9)=9+2=11
- Swapping the order gives a different value
- g(f(3))=(5)2=25
-
06Write g(f(x)) as an expression:f(x)=x+4,g(x)=x2AnswerHide
Answer(x+4)2
Steps
- Substitute f into g
- g(x)=x2g(f(x))=(x+4)2
- Swapping the order gives a different expression
- f(g(x))=x2+4
FAQ
QAre f(g(x)) and g(f(x)) the same?
AUsually not. With
f(x)=x+3 and
g(x)=x2, f(g(x))=x2+3 but
g(f(x))=(x+3)2. The order matters.