Steply

f(x) = 1 - x, g(x) = 2x, find f(g(x)) and g(f(x))

Step by step, with the reason for every step · Composition order · Algebra 2

Step by step

The question

Question: find f(g(x)) and g(f(x)) for f(x) = 1 − x and g(x) = 2x.

f(x) = 1 − x
g(x) = 2x

1 Find f(g(x))

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 2x.

So f(g(x)) is f(2x).

f(g(x)) = f(2x)

Put (2x) in place of every x in f.

We keep it in brackets.

= 1 − (2x)

A minus in front of a bracket changes the sign of every part inside.

−( + ) → −, −( − ) → +

Now we have 1 − 2x.

f(g(x)) = 1 − 2x

2 Find g(f(x))

g(f(x)) is a function inside a function.

Like with brackets, we start inside.

First f(x).

f(x) is 1 − x.

So g(f(x)) is g(1 − x).

g(f(x)) = g(1 − x)

Put (1 − x) in place of every x in g.

We keep it in brackets.

= 2(1 − x)

The 2 in front of the bracket multiplies every part inside.

a(b + c) = ab + ac

So we write 2 times each part.

= 2(1) + 2(−x)
− × + = −

Watch the signs.

2 times 1 is 2.

2 times (−x) is −2x.

g(f(x)) = 2 − 2x

3 Compare

1 − 2x and 2 − 2x are not the same.

So the order matters!

1 − 2x ≠ 2 − 2x

Careful!

Inside first, then outside.

Swap them, and you usually get a different rule.

Careful: f(g(x)) is usually not g(f(x))

4 Check

Let's check with a number: x = 1.

g of 1 is 2, then f of 2 is −1.

f(g(1)) = f(2) = −1

f of 1 is 0, then g of 0 is 0.

Different, as we found.

g(f(1)) = g(0) = 0

And our rules give the same numbers: 1 − 2x gives −1, 2 − 2x gives 0.

They are right!

1 − 2x → −1, 2 − 2x → 0

Let's look back.

First: find f(g(x)).

Then: find g(f(x)).

Then: compare.

Last: check.

Answer
1 − 2x ≠ 2 − 2x

Your turn

Try this one yourself, then check:

f(x) = 3 − 3x, g(x) = 2x, find f(g(x)) and g(f(x))
Show the answer
3 − 6x ≠ 6 − 6x

More from Composition order

The whole lesson: Composition order →