Steply

Composition and inverse functions

Algebra 2 · 21 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Work out the inside
  2. Put it in
  3. Write the square out
  4. Split the first bracket
  5. Open the brackets
  6. Group like terms
  7. Check

The steps for Solve f(x) = x - 1, g(x) = x^2 + x, g(f(x)). Every solution names its steps, so you always know what comes next.

Worked examples

Solve f(x) = 2x + 1, g(x) = x^2 - 3, f(g(2)) Easy

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.

Answer
f(g(2)) = 3

▶ Watch it solved

Solve f(x) = 2x + 1, g(x) = x^2 - 3, f(g(x)) Medium

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.

Answer
f(g(x)) = 2x2 − 5

▶ Watch it solved

Solve f(x) = x - 1, g(x) = x^2 + x, g(f(x)) Harder

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.

Answer
g(f(x)) = x2 − x

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. f(x) = 2x + 1, g(x) = x^2 - 3, f(g(2))
    Answer
    f(g(2)) = 3
  2. f(x) = 3x - 1, f(f(2))
    Answer
    f(f(2)) = 14
  3. f(x) = x + 5, g(x) = 2x, g(f(1))
    Answer
    g(f(1)) = 12
  4. f(x) = x^2, g(x) = x - 4, f(g(6))
    Answer
    f(g(6)) = 4
  5. inverse of f(x) = x + 4
    Answer
    not a power
  6. inverse of f(x) = 3x
    Answer
    not a power
  7. f(x) = x - 9, find the inverse
    Answer
    not a power
  8. inverse of f(x) = 2x + 6
    Answer
    not a power

Medium

  1. f(x) = 2x + 1, g(x) = x^2 - 3, f(g(x))
    Answer
    f(g(x)) = 2x2 − 5
  2. f(x) = x^2 + 1, g(x) = 2x - 1, (f∘g)(x)
    Answer
    f(g(x)) = 4x2 − 4x + 2
  3. f(x) = 3x, g(x) = x + 2, g(f(x))
    Answer
    g(f(x)) = 3x + 2
  4. f(x) = 4x - 3, g(x) = x^2, f(g(-2))
    Answer
    f(g(−2)) = 13
  5. f(x) = 3x - 5, find the inverse
    Answer
    not a power
  6. f(x) = x/2 + 1, f^-1(x)
    Answer
    not a power
  7. f(x) = 7 - 2x, inverse
    Answer
    not a power
  8. f(x) = 5x + 4, find the inverse
    Answer
    not a power

Harder

  1. f(x) = x - 1, g(x) = x^2 + x, g(f(x))
    Answer
    g(f(x)) = x2 − x
  2. f(x) = 2x - 3, f(f(x))
    Answer
    f(f(x)) = 4x − 9
  3. f(x) = x/4 - 3, find the inverse
    Answer
    not a power
  4. f(x) = 6 - x/3, inverse
    Answer
    not a power
  5. inverse of f(x) = (x + 3)/4
    Answer
    not a power