Operations with Functions

Operations with Functions

How to solve composite functions problems: examples and their solutions.

Example 1

If f(x) = 2x and g(x) = x^2 - x + 1, find (g(f(3)).

(gf)(x) = g(f(x)).
It means put the output of f(x)
into g(x) as an input.

To solve the composition,
solve it from the inside.

(gf)(3) = g(f(3)) = g(6) = 31

See the meaning of the solution.

To find (gf)(3) = 31:

Put 3 into f(x): f(3) = 6.
Put 6 into g(x): g(6) = 31.

Function

Example 2

If f(x) = 2x and g(x) = x^2 - x + 1, find (g(f(x)).

Put f(x) = 2x into g(x):

(gf)(x) = g(f(x))
= g(2x)
= (2x)2 - (2x) + 1

See the meaning of the solution.

To find (gf)(x) = 4x2 - 2x + 1:

Put x into f(x):
f(x) = 2x.

Put 2x into g(x):
g(2x) = (2x)2 - (2x) + 1
= 4x2 - 2x + 1

Example 3

If f(x) = 2x and g(x) = x^2 - x + 1, find (f(g(x)).

Put g(x) = x2 - x + 1 into f(x):

(fg)(x) = f(g(x))
= f(x2 - x + 1)
= 2(x2 - x + 1)

You can see that
(gf)(x) and (fg)(x) are different.
(See the previous example.)

See the meaning of the solution.

To find (fg)(x) = 2x2 - 2x + 2:

Put x into g(x):
g(x) = x2 - x + 1.

Put x2 - x + 1 into f(x):
f(x2 - x + 1) = 2(x2 - x + 1)
= 2x2 - 2x + 2