Source codeVideos

Command Palette

Search for a command to run...

Function Composition and Inverse Function

Properties of Function Composition

Properties of Function Composition

Function composition, which involves combining functions sequentially, has several important properties we need to know. Let's study these properties using the following example functions:

f(x)=2x+1f(x) = 2x + 1
g(x)=x2+4g(x) = x^2 + 4
h(x)=1x+1h(x) = \frac{1}{x+1}

Non-Commutative Property

The first and most common property is that the order in which functions are composed matters. Changing the order of functions usually results in a different composite function.

In general, (fg)(x)(f \circ g)(x) is not equal to (gf)(x)(g \circ f)(x).

Example:

Let's compare (gf)(x)(g \circ f)(x) and (fg)(x)(f \circ g)(x).

  1. Calculating (gf)(x)(g \circ f)(x):

    (gf)(x)=g(f(x))=g(2x+1)(g \circ f)(x) = g(f(x)) = g(2x+1)
    g(2x+1)=(2x+1)2+4=(4x2+4x+1)+4=4x2+4x+5g(2x+1) = (2x+1)^2 + 4 = (4x^2 + 4x + 1) + 4 = 4x^2 + 4x + 5
  2. Calculating (fg)(x)(f \circ g)(x):

    (fg)(x)=f(g(x))=f(x2+4)(f \circ g)(x) = f(g(x)) = f(x^2+4)
    f(x2+4)=2(x2+4)+1=(2x2+8)+1=2x2+9f(x^2+4) = 2(x^2+4) + 1 = (2x^2 + 8) + 1 = 2x^2 + 9

Since 4x2+4x+52x2+94x^2 + 4x + 5 \neq 2x^2 + 9, it is proven that (gf)(x)(fg)(x)(g \circ f)(x) \neq (f \circ g)(x). This property also applies to other compositions, for example (fh)(x)(hf)(x)(f \circ h)(x) \neq (h \circ f)(x) and (gh)(x)(hg)(x)(g \circ h)(x) \neq (h \circ g)(x).

Associative Property

If we compose three or more functions, the order of performing the composition does not affect the final result, as long as the order of the functions remains the same.

Mathematically, for functions ff, gg, and hh, the following holds:

((fg)h)(x)=(f(gh))(x)((f \circ g) \circ h)(x) = (f \circ (g \circ h))(x)

This means we can compose ff with gg first, and then compose the result with hh. Alternatively, we can compose gg with hh first, and then compose ff with the result. The outcome will be the same.

Example:

Let's check if ((fg)h)(x)=(f(gh))(x)((f \circ g) \circ h)(x) = (f \circ (g \circ h))(x).

  1. Calculating ((fg)h)(x)((f \circ g) \circ h)(x):

    We already know (fg)(x)=2x2+9(f \circ g)(x) = 2x^2 + 9.

    ((fg)h)(x)=(fg)(h(x))=(fg)(1x+1)((f \circ g) \circ h)(x) = (f \circ g)(h(x)) = (f \circ g)(\frac{1}{x+1})
    (fg)(1x+1)=2(1x+1)2+9=2(x+1)2+9(f \circ g)(\frac{1}{x+1}) = 2\left(\frac{1}{x+1}\right)^2 + 9 = \frac{2}{(x+1)^2} + 9
  2. Calculating (f(gh))(x)(f \circ (g \circ h))(x):

    First, find (gh)(x)(g \circ h)(x):

    (gh)(x)=g(h(x))=g(1x+1)(g \circ h)(x) = g(h(x)) = g(\frac{1}{x+1})
    g(1x+1)=(1x+1)2+4=1(x+1)2+4g(\frac{1}{x+1}) = \left(\frac{1}{x+1}\right)^2 + 4 = \frac{1}{(x+1)^2} + 4

    Now, compose ff with this result:

    (f(gh))(x)=f((gh)(x))=f(1(x+1)2+4)(f \circ (g \circ h))(x) = f((g \circ h)(x)) = f\left(\frac{1}{(x+1)^2} + 4\right)
    f(1(x+1)2+4)=2(1(x+1)2+4)+1=2(x+1)2+8+1=2(x+1)2+9f\left(\frac{1}{(x+1)^2} + 4\right) = 2\left(\frac{1}{(x+1)^2} + 4\right) + 1 = \frac{2}{(x+1)^2} + 8 + 1 = \frac{2}{(x+1)^2} + 9

Since both results are the same (2(x+1)2+9\frac{2}{(x+1)^2} + 9), the associative property is proven to hold: ((fg)h)(x)=(f(gh))(x)((f \circ g) \circ h)(x) = (f \circ (g \circ h))(x).

This associative property also applies to other combinations of function order, such as ((hf)g)(x)=(h(fg))(x)((h \circ f) \circ g)(x) = (h \circ (f \circ g))(x) and ((gf)h)(x)=(g(fh))(x)((g \circ f) \circ h)(x) = (g \circ (f \circ h))(x).

Identity Element

There is a special function called the identity function, denoted by I(x)I(x), which is defined as I(x)=xI(x) = x. This function does not change its input.

If a function ff is composed with the identity function II (from either the left or the right), the result is the function ff itself.

(fI)(x)=f(I(x))=f(x)(f \circ I)(x) = f(I(x)) = f(x)
(If)(x)=I(f(x))=f(x)(I \circ f)(x) = I(f(x)) = f(x)

Example:

With f(x)=2x+1f(x) = 2x + 1:

  • (fI)(x)=f(I(x))=f(x)=2x+1(f \circ I)(x) = f(I(x)) = f(x) = 2x + 1
  • (If)(x)=I(f(x))=I(2x+1)=2x+1(I \circ f)(x) = I(f(x)) = I(2x+1) = 2x + 1

Both result in the function f(x)f(x) again.