Finding the Domain of a Composite Function

Suppose that \(f( x) =\dfrac{1}{x+2}\) and \(g( x) = \dfrac{4}{x-1}\). Find \(f\circ g\) and its domain.

Solution \[ ( f\circ g) ( x) =f( g( x) ) =\dfrac{1}{g( x) +2}=\dfrac{1}{\dfrac{4}{x-1}+2}= \dfrac{x-1}{4+2( x-1) }=\dfrac{x-1}{2x+2} \]

To find the domain of \(f\circ g,\) first note that the domain of \(g\) is \( \{ x|x\neq 1\} ,\) so we exclude 1 from the domain of \(f\circ g.\) Next note that the domain of \(f\) is \(\{ x|x\neq -2\} \), which means \(g( x) \) cannot equal \(-2.\) To determine what additional values of \(x\) to exclude, we solve the equation \(g( x) =-2\): \[ \begin{array}{l} \frac{4}{{x - 1}} = - 2 \quad \quad {\color{#0066A7}{g(x) = - 2}} \\ \,\, \,\,\,\,\,\,\,4 = - 2(x - 1) \\ \,\,\, \,\,\,\,\,\,4 = - 2x + 2 \\ \,\,\,\,\,\,2x = - 2 \\ \,\,\,\, \,\,\,\,\,x = - 1 \\ \end{array} \]

We also exclude \(-1\) from the domain of \(f\,{\circ}\, g.\)

The domain of \(f\circ g\) is \(\{ x|x\neq -1\), \(x\neq 1\}\).

We could also find the domain of \(f\circ g\) by first finding the domain of \( g\): \(\{ x|x\neq 1\}\). So, exclude \(1\) from the domain of \( f\circ g\). Then looking at \(( f\circ g) ( x) =\dfrac{ x-1}{2x+2}=\dfrac{x-1}{2( x+1) }\), notice that \(x\neq -1\), so we exclude \(-1\) from the domain of \(f\circ g.\) Therefore, the domain of \(f\circ g\) is \(\{ x|x\neq -1\), \(x\neq 1\}\).