-
If f(x) and g(x) are two functions, then
-
g(f(x)) is a composite function
- Also written gf:x
-
It means the input xgoes through functionffirst
- This gives the output f(x)
- Then this output, f(x), becomes the input of function g, giving g(f(x))
-
gf(x) is the shorthand notation used for g(f(x))
- It means do f first, then g
- The order of applying the functions goes from right to left
- (the letter nearest the bracket goes first)
- This is often the opposite of what people expect!
-
fg(x) means do g(x) first then f(x) second
-
ff(x) means apply f(x) twice!
- This can be written f2(x)
- This does not mean the same as [f(x)]2
Exam Hint
A good trick in the exam is to write brackets around gf(x) to make it g(f(x)), to see that it is "g" of "f(x)".
-
If you are putting a number into a composite function
- put the number into the function closest to (x)
- then make the output of the first function the input of the second function
-
For example, if f(x)=2x+1 and g(x)=x1
-
to find gf(2):
- Put the 2 in as the input of f first
- f(2)=2(2)+1=5
- Then put 5 in as the input of g
- So gf(2)=g(f(2))=g(5)=151
-
to find fg(2):
- Put the 2 in as the input of g first
- g(2)=121
- Then put 21 in as the input of f
- So fg(2)=f(g(2))=f(121)=2(121)+1=2
-
to find ff(2):
- f(2)=2×2+1=5
- f(5)=2×5+1=11
- so ff(2)=11
-
If you are using algebra, substitute the whole algebraic expression as your input
-
For example, if f(x)=2x+1 and g(x)=x1
- fg(x)=f(g(x))=f(x1)=2×(x1)+1=x2+1
- gf(x)=g(f(x))=g(2x+1)=2x+11
- ff(x)=f(f(x))=f(2x+1)=2(2x+1)+1 which simplifies to ff(x)=4x+3
Worked Example
In this question, f(x)=2x−1 and g:x→(x+2)2.
(a) Find fg(4).
Answer:
"g" is on the inside of the composite function, so apply g first
g(4)=(4+2)2=62=36
Now apply the function "f" to 36
f(36)=72−1=2(36)−1
fg(4)=71
(b) Find gf(x).
Answer:
"f" is on the inside of the composite function so substitute the function f(x) into g(x)
It can help to write gf(x)=g(f(x))
-
*gf(x)=g(f(x))=g(2x−1)=((2x−1)+2)2
Simplify inside the bracket
gf(x)=(2x−1+2)2
gf(x)=(2x+1)2