Composite functions

While IB occasionally specifically ask about composite functions, the more common usage is to recognize composite functions when differentiating, to be able to apply the chain rule, and to recognize integration by substitution.

Contents

How it works

Given some composite function h(x)=(fg)(x)h(x) = (f\circ g)(x), if and only if g(x0)g(x_0) is part of ff’s domain, then x0x_0 is part of hh’s domain, and (fg)(x0)(f\circ g)(x_0) is part of hh’s range.

Think of the composite function as a bottleneck; it only allows through values that can pass through both the inner and the outer functions.

Domain and range

It is a lot like conflict resolution: you have to first find common ground.

To find the domain and range of composite function f(g(x))f(g(x)), we first find the overlap between the domain of f(x)f(x) and the range of g(x)g(x). Then domain of the composite function is the set of values that can use gg to get to the overlap, and range is the set of values that can use ff to get from the overlap.

Example: Find domain and range of f(x)=(x+2)2+1+3f(x) = \sqrt{-(x+2)^2 + 1} + 3.


Define inner function (x+2)2+1-(x+2)^2 + 1, and outer function go(x)=x+3g_o(x) = \sqrt x + 3, such that f(x)=(gogi)(x)f(x) = (g_o \circ g_i)(x).

The domain of gog_o is [0,[\left[0, \infty\right[.

The range of gig_i is ],1]\left]-\infty, 1\right], from the shape of the downward-opening parabola.

The overlap is [0,1]\left[\mathbf0, \mathbf1\right].

The domain of ff is the set of values such that

0(x+2)2+111(x+2)201(x+2)20\begin{align*} \mathbf0 &\leq -(x+2)^2 + 1 &\leq \mathbf1 \\ -1 &\leq -(x+2)^2 &\leq 0 \\ 1 &\geq (x+2)^2 &\geq 0 \end{align*}

Note that for real xx, (x+2)2(x + 2)^2 is always non-negative, so we only need to solve the quadratic inequality

1(x+2)21x+213x1\begin{align*} 1 &\geq (x+2)^2 & \\ -1 &\leq x + 2 &\leq 1 \\ -3 &\leq x &\leq -1 \end{align*}

For range, because x+3\sqrt x + 3 is increasing, we only need to evaluate at the bounds of the interval.

go(0)=3;  go(1)=4g_o(\mathbf0) = 3;\;g_o(\mathbf1) = 4

Final answer for domain and range of ff:

3x1;  3y4-3 \leq x \leq -1;\; 3 \leq y \leq 4 \qed

Properties

fg is generally not gff\circ g \,\text{ is generally not } \,g\circ f
(hg)f=h(gf)(h \circ g) \circ f = h \circ (g \circ f)

Assuming ff and gg are invertible, then combining previous property with properties of inverse functions we get

g1gf=fg^{-1} \circ g \circ f = f
gf1f=gg \circ f^{-1} \circ f = g

and also

gg1f=fg \circ g^{-1} \circ f = f
gff1=gg \circ f \circ f^{-1} = g

But

fgf1gf \circ g \circ f^{-1} \neq g
gfg1fg \circ f \circ g^{-1} \neq f

The following two examples are two different cases. First one is given ff and gfg\circ f to find gg; second is given gg and gfg\circ f to find ff.

Example: Let f(x)=3x1f(x) = 3^{x-1} and (gf)(x)=34x2(g\circ f)(x) = {3^{4x-2}}. Find g(2)g(-\sqrt2).


Method 1: g=gff1g = g\circ f\circ f^{-1}

To find f1f^{-1}, we solve for yy in x=3y1x = 3^{y-1}. This requires knowledge of logarithms. A quick refresher is that 8=23    log28=38 = 2^3 \iff \log_2 8 = 3.

3y1=xy1=log3xy=log3x+1f1(x)=log3x+1\begin{align*} 3^{y-1} &= x \\ y - 1 &= \log_3 x \\ y &= \log_3 x + 1 \\ f^{-1}(x) &= \log_3 x + 1 \end{align*}

Note: log3x+1\log_3 x + 1 is (log3x)+1\left(\log_3x\right) + 1, not log3(x+1)\log_3(x + 1). See where is that bracket?

g(x)=((gf)f1)(x)=34f1(x)2=34(log3x+1)2=3(log3x)4+42=(3log3x)4342=x432=9x4g(2)=9(2)4=9(4)=36\begin{align*} g(x) &= ((g\circ f)\circ f^{-1})(x) \\ &= 3^{4f^{-1}(x) - 2} \\ &= 3^{4\left(\log_3 x + 1 \right) - 2} \\ &= 3^{\left(\log_3 x \right)4 + 4 - 2} \\ &= {\left(3^{\log_3 x} \right)^4} \cdot 3^{4 - 2} \\ &= x^4 \cdot 3^2 \\ &= 9x^4 \\ g\left(-\sqrt2\right) &= 9\left(-\sqrt2\right)^4 \\ &= 9(4) \\ &= 36 \qed \end{align*}

Method 2: Let y=f(x)=3x1y = f(x) = 3^{x-1} and find g(y)g(y).

(gf)(x)=34x4+42=34(x1)+2=(3x1)432g(y)=y49=9y4\begin{align*} (g\circ f)(x)&=3^{4x-4+4-2}\\ &=3^{4(x-1)+2}\\ &=\left(3^{x-1}\right)^4\cdot 3^2\\ g(y)&=y^4\cdot 9 \\ &=9y^4 \end{align*}

Then evaluate at y=3y = -\sqrt 3.

g(2)=9(2)4=9(4)=36\begin{align*} g\left(-\sqrt2\right) &= 9\left(-\sqrt2\right)^4 \\ &= 9(4) \\ &= 36 \qed \end{align*}

The first method is more systematic; the second method requires on-the-spot thinking and pattern recognition, but can be quicker.

Example: Let g(x)=12x4g(x) = -\frac1{2x-4} and (gf)(x)=4x1,  x14(g \circ f)(x) = {4x-1, \; x \neq \frac14}. Find f(732)f\left(\frac{7}{32}\right).


Method 1: f=g1gff = g^{-1} \circ g \circ f

To find g1g^{-1}, we solve for yy in x=12y4x = -\frac1{2y-4}.

x=12y42y4=1x2y=41xy=212xg1(x)=212x\begin{align*} x &= \frac{-1}{2y - 4} \\ 2y - 4 &= \frac{-1}{x} \\ 2y &= 4 - \frac{1}{x} \\ y &= 2 - \frac{1}{2x} \\ g^{-1}(x) &= 2 - \frac{1}{2x} \end{align*}
f(x)=(g1(gf))(x)=212(gf)(x)=212(4x1)=218x2f(732)=218(732)2=217484=2114=2(4)=6\begin{align*} f(x) &= (g^{-1} \circ (g \circ f))(x) \\ &= 2 - \frac{1}{2\cdot(g \circ f)(x)} \\ &= 2 - \frac{1}{2(4x - 1)} \\ &= 2 - \frac{1}{8x - 2} \\ f\left(\frac{7}{32}\right) &= 2 - \frac{1}{8\left(\frac{7}{32}\right) - 2} \\ &= 2 - \frac{1}{\frac{7}{4} - \frac{8}{4}} \\ &= 2 - \frac{1}{-\frac{1}{4}} \\ &= 2 - (-4) \\ &= 6 \qed \end{align*}

Method 2: Let y=f(x)y = f(x). Write g(y)g(y) two ways and compare.

g(f(x))=g(y)f(x)=y4x1=12y42y4=14x12y=414x1y=f(x)=218x2f(732)=218(732)2=217484=2114=2(4)=6\begin{align*} g(f(x)) &= g(y) \\ f(x) &= y \\ 4x-1 &= \frac{-1}{2y-4} \\ 2y-4 &= \frac{-1}{4x-1} \\ 2y &= 4 - \frac{1}{4x-1} \\ y = f(x) &= 2 - \frac{1}{8x-2} \\ f\left(\frac{7}{32}\right) &= 2 - \frac{1}{8\left(\frac{7}{32}\right) - 2} \\ &= 2 - \frac{1}{\frac{7}{4} - \frac{8}{4}} \\ &= 2 - \frac{1}{-\frac{1}{4}} \\ &= 2 - (-4) \\ &= 6 \qed \end{align*}

Both methods need gg to be invertible.