The question
Question: find f(g(2)) for f(x) = 2x + 1 and g(x) = x² − 3.
f(x) = 2x + 1
g(x) = x2 − 3
1 Work out the inside
f(g(2)) is a function inside a function.
Like with brackets, we start inside.
First g(2).
inside first: g(2)
Put 2 in place of x in g.
g(2) = 22 − 3
Powers come before minus.
Order: ( ) → x² √ → × ÷ → + −
2² means 2 times 2.
22 = 2 × 2 = 4
That is 4.
= 4 − 3
4 minus 3 is 1.
g(2) = 1
2 Then the outside
g(2) is 1.
So f(g(2)) is f(1).
f(g(2)) = f(1)
Put 1 in place of x in f.
= 2(1) + 1
Times comes before plus.
Order: ( ) → x² √ → × ÷ → + −
2(1) = 2 × 1
2(1) means 2 times 1.
2 times 1 is 2.
= 2 + 1
2 plus 1 is 3.
f(g(2)) = 3
So f(g(2)) = 3.
Let's look back.
First: work out the inside.
Last: then the outside.
▶ Watch it solved
The question
Question: find f(g(x)) for f(x) = 2x + 1 and g(x) = x² − 3.
f(x) = 2x + 1
g(x) = x2 − 3
1 Work out the inside
f(g(x)) is a function inside a function.
Like with brackets, we start inside.
First g(x).
inside first: g(x)
g(x) is x² − 3.
So f(g(x)) is f(x² − 3).
f(g(x)) = f(x2 − 3)
2 Put it in
Put (x² − 3) in place of every x in f.
We keep it in brackets.
= 2(x2 − 3) + 1
3 Open the brackets
The 2 in front of the bracket multiplies every part inside.
a(b + c) = ab + ac
So we write 2 times each part.
= 2(x2) + 2(−3) + 1
− × + = −
Watch the signs.
2 times x² is 2x².
2 times (−3) is −6.
= 2x2 − 6 + 1
4 Group like terms
Terms are the parts between the + and − signs.
Like terms are the same kind: same letters, same powers.
Plain numbers go together.
Each colour is one kind.
like terms = same letters,
same powers
−6 + 1 is −5.
−6 + 1 = −5
So the expression is 2x² − 5.
f(g(x)) = 2x2 − 5
5 Check
Let's check.
We pick a number for each letter: x = 2.
We put it into the start.
Start: 2 × (22 − 3) + 1 = 2 × 1 + 1 = 2 + 1
= 3
Now into our answer.
Answer: 2 × 22 − 5 = 8 − 5 = 3
Both give 3.
Same value, so 2x² − 5 is right!
Both give 3
Let's look back.
First: work out the inside.
Then: put it in.
Then: open the brackets.
Then: group like terms.
Last: check.
▶ Watch it solved
The question
Question: find g(f(x)) for g(x) = x² + x and f(x) = x − 1.
g(x) = x2 + x
f(x) = x − 1
1 Work out the inside
g(f(x)) is a function inside a function.
Like with brackets, we start inside.
First f(x).
inside first: f(x)
f(x) is x − 1.
So g(f(x)) is g(x − 1).
g(f(x)) = g(x − 1)
2 Put it in
Put (x − 1) in place of every x in g.
We keep it in brackets.
= (x − 1)2 + (x − 1)
3 Write the square out
A square means the bracket times itself.
(x − 1)² is x − 1 times x − 1.
( )² = ( )( )
Careful!
We can't just square each part.
x² + 1 is wrong.
The middle part is missing.
Careful: not (x − 1)2 = x² + 1 ✗
So we write the bracket two times.
= (x − 1)(x − 1) + (x − 1)
4 Split the first bracket
Each part of the first bracket multiplies the whole second bracket.
(a + b)(c + d) = a(c + d) + b(c + d)
The parts of the first bracket are x and −1.
Each one takes the whole second bracket.
= x(x − 1) − 1(x − 1) + (x − 1)
5 Open the brackets
What is in front of a bracket multiplies every part inside.
A bracket with a plus or nothing in front can just be removed.
a(b + c) = ab + ac
So we write each part times what is in front.
= x(x) + x(−1) + (−1)(x) + (−1)(−1) + x − 1
− × − = +
Watch the signs.
x times x is x².
x times (−1) is −x.
(−1) times x is −x.
(−1) times (−1) is 1.
= x2 − x − x + 1 + x − 1
6 Group like terms
Terms are the parts between the + and − signs.
Like terms are the same kind: same letters, same powers.
All the x terms go together.
Plain numbers go together.
Each colour is one kind.
like terms = same letters,
same powers
We move like terms next to each other.
Each term takes its sign with it.
= x2 − x − x + x + 1 − 1
−x − x + x is −x.
1 − 1 is 0.
−x − x + x = −x
1 − 1 = 0
So the expression is x² − x.
g(f(x)) = x2 − x
7 Check
Let's check.
We pick a number for each letter: x = 2.
We put it into the start.
Start: (2 − 1)2 + (2 − 1) = (1)2 + 1 = 1 + 1
= 2
Now into our answer.
Answer: 22 − 2 = 4 − 2 = 2
Both give 2.
Same value, so x² − x is right!
Both give 2
Let's look back.
First: work out the inside.
Then: put it in.
Then: write the square out.
Then: split the first bracket.
Then: open the brackets.
Then: group like terms.
Last: check.
▶ Watch it solved