We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

Study Guides > College Algebra CoRequisite Course

Domain of a Composition

Learning Outcomes

  • Find the domain of a composite function.
  • Decompose a composite function.
As we discussed previously, the domain of a composite function such as fgf\circ g is dependent on the domain of gg and the domain of ff. It is important to know when we can apply a composite function and when we cannot, that is, to know the domain of a function such as fgf\circ g. Let us assume we know the domains of the functions ff and gg separately. If we write the composite function for an input xx as f(g(x))f\left(g\left(x\right)\right), we can see right away that xx must be a member of the domain of gg in order for the expression to be meaningful, because otherwise we cannot complete the inner function evaluation. However, we also see that g(x)g\left(x\right) must be a member of the domain of ff, otherwise the second function evaluation in f(g(x))f\left(g\left(x\right)\right) cannot be completed, and the expression is still undefined. Thus the domain of fgf\circ g consists of only those inputs in the domain of gg that produce outputs from gg belonging to the domain of ff. Note that the domain of ff composed with gg is the set of all xx such that xx is in the domain of gg and g(x)g\left(x\right) is in the domain of ff.

A General Note: Domain of a Composite Function

The domain of a composite function f(g(x))f\left(g\left(x\right)\right) is the set of those inputs xx in the domain of gg for which g(x)g\left(x\right) is in the domain of ff.

How To: Given a function composition f(g(x))f\left(g\left(x\right)\right), determine its domain.

  1. Find the domain of gg.
  2. Find the domain of ff.
  3. Find those inputs, xx, in the domain of gg for which g(x)g(x) is in the domain of ff. That is, exclude those inputs, xx, from the domain of gg for which g(x)g(x) is not in the domain of ff. The resulting set is the domain of fgf\circ g.

Example: Finding the Domain of a Composite Function

Find the domain of

(fg)(x) wheref(x)=5x1 and g(x)=43x2\left(f\circ g\right)\left(x\right)\text{ where}f\left(x\right)=\dfrac{5}{x - 1}\text{ and }g\left(x\right)=\dfrac{4}{3x - 2}

Answer: The domain of g(x)g\left(x\right) consists of all real numbers except x=23x=\frac{2}{3}, since that input value would cause us to divide by 0. Likewise, the domain of ff consists of all real numbers except 1. So we need to exclude from the domain of g(x)g\left(x\right) that value of xx for which g(x)=1g\left(x\right)=1.

\begin{align}&\dfrac{4}{3x - 2}=1\hspace{5mm}&&\text{Set}\hspace{2mm}g(x)\hspace{2mm}\text{equal to 1} \\[2mm]& 4=3x - 2 &&\text{Multiply by}\hspace{2mm} 3x-2\\[2mm]& 6=3x&&\text{Add 2 to both sides}\\[2mm]& x=2&&\text{Divide by 3} \end{align}

So the domain of fgf\circ g is the set of all real numbers except 23\frac{2}{3} and 22. This means that

x23orx2x\ne \frac{2}{3}\hspace{2mm}\text{or}\hspace{2mm}x\ne 2

We can write this in interval notation as

(,23)(23,2)(2,)\left(-\infty ,\frac{2}{3}\right)\cup \left(\frac{2}{3},2\right)\cup \left(2,\infty \right)

Example: Finding the Domain of a Composite Function Involving Radicals

Find the domain of

(fg)(x) wheref(x)=x+2 and g(x)=3x\left(f\circ g\right)\left(x\right)\text{ where}f\left(x\right)=\sqrt{x+2}\text{ and }g\left(x\right)=\sqrt{3-x}

Answer: Because we cannot take the square root of a negative number, the domain of gg is (,3]\left(-\infty ,3\right]. Now we check the domain of the composite function

(fg)(x)=3x+2\left(f\circ g\right)\left(x\right)=\sqrt{3-\sqrt{x+2}}

For (fg)(x)\left(f\circ g\right)\left(x\right), we need 3x+203-\sqrt{x+2}\ge{0}, again because we cannot take the square root of a negative number. Since the output of a square root is always non-negative, when we add 2, we see that 3x+2>03-\sqrt{x+2}>0, so the domain of (fg)(x)=(,3]\left(f\circ g\right)\left(x\right) = (-\infty,3].

Analysis of the Solution

This example shows that knowledge of the range of functions (specifically the inner function) can also be helpful in finding the domain of a composite function. It also shows that the domain of fgf\circ g can contain values that are not in the domain of ff, though they must be in the domain of gg. You cannot rely on an algorithm to find the domain of a composite function. Rather, you will need to first ask yourself "what is the domain of the inner function", and determine whether this set will comply with the domain restrictions of the outer function. In this case, the set (,3](-\infty,3] ensures a non-negative output for the inner function, which will in turn ensure a positive input for the composite function.

Try It

Find the domain of

(fg)(x) wheref(x)=1x2 and g(x)=x+4\left(f\circ g\right)\left(x\right)\text{ where}f\left(x\right)=\dfrac{1}{x - 2}\text{ and }g\left(x\right)=\sqrt{x+4}

Answer: [4,0)(0,)\left[-4,0\right)\cup \left(0,\infty \right)

Try It

We can use graphs to visualize the domain that results from a composition of two functions. Graph the two functions below with an online graphing calculator.
  1. f(x)=3xf(x)=\sqrt{3-x}
  2. g(t)=x+4g(t) = \sqrt{x+4}
Next, create a new function, h(x)=g(f(x))h(x) = g(f(x)).  Based on the graph, what is the domain of this function? Explain why g(f(x))g(f(x)) and f(x)f(x) have the same domain. Now define another composition, p(x)=f(g(x)p(x) = f(g(x).  What is the domain of this function? Explain why you can evaluate g(10)g(10), but not p(10)p(10).

Decompose a Composite Function

In some cases, it is necessary to decompose a complicated function. In other words, we can write it as a composition of two simpler functions. There is almost always more than one way to decompose a composite function, so we may choose the decomposition that appears to be most obvious.

Example: Decomposing a Function

Write f(x)=5x2f\left(x\right)=\sqrt{5-{x}^{2}} as the composition of two functions.

Answer: We are looking for two functions, gg and hh, so f(x)=g(h(x))f\left(x\right)=g\left(h\left(x\right)\right). To do this, we look for a function inside a function in the formula for f(x)f\left(x\right). As one possibility, we might notice that the expression 5x25-{x}^{2} is the inside of the square root. We could then decompose the function as

h(x)=5x2andg(x)=xh\left(x\right)=5-{x}^{2}\hspace{2mm}\text{and}\hspace{2mm}g\left(x\right)=\sqrt{x}

We can check our answer by recomposing the functions.

g(h(x))=g(5x2)=5x2g\left(h\left(x\right)\right)=g\left(5-{x}^{2}\right)=\sqrt{5-{x}^{2}}

Analysis of the Solution

For every composition there are infinitely many possible function pairs that will work. In this case, another function pair where g(h(x))=5x2g\left(h\left(x\right)\right)=\sqrt{5-{x}^{2}}  is  h(x)=x2h(x)=x^2 and g(x)=5xg(x)=\sqrt{5-x}

Try It

Write f(x)=434+x2f\left(x\right)=\dfrac{4}{3-\sqrt{4+{x}^{2}}} as the composition of two functions.

Answer: Possible answer:

g(x)=4+x2g\left(x\right)=\sqrt{4+{x}^{2}}

h(x)=43xh\left(x\right)=\dfrac{4}{3-x} f=hgf=h\circ g

Licenses & Attributions