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 in HL 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.

Domain and range

Finding domain and range of a composite function does not come up often, could get time-consuming, and typically the given question is somewhat simple. It’s not worth it to spend too much time practising this.

Example: Find domain and range of f(x)=2lnx+41f(x) = \sqrt{2\ln x + 4} - 1.


Define inner function gi(x)=2lnx+4g_i(x) = 2\ln x + 4, and outer function go(x)=x1g_o(x) = \sqrt x - 1, such that f(x)=(gogi)(x)f(x) = (g_o \circ g_i)(x).

gog_o only accepts non-negative numbers. We need

gi(x)=2lnx+40lnx2xe2\begin{align*} g_i(x) = 2\ln x + 4 &\geq 0 \\ \ln x &\geq -2 \\ x &\geq \e^{-2} \end{align*}

Note: SL students only have to solve linear and quadratic inequalities.

We were able to exploit the fact that lnx\ln x is strictly increasing, such that lnb>lna    b>a\ln b >\ln a \iff b > a

Restricting gi(x)g_i(x) to xe2x \geq \e^{-2} is still able to cover the entire domain of gog_o. So the range of gogig_o \circ g_i is same as the range of gog_o, which is y1y \geq -1.

Domain: xe2x \geq \e^{-2}. Range: y1y \geq -1 \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.