This is the second part of a post, written by Muhammad Azhar Rohiman, a first year student on MAM1000W at UCT. This post came about when he asked me a question related to domains of composite functions, and it was clear that on first learning about such topics, there are some simple misunderstandings. I suggested that he write a couple of paragraphs explaining what he had learnt, and the following is, I think, a very clear explanation of some of the ideas and pitfalls of this topic. The first part of the post is here.

Consider the two functions below, from which we want to find the domain of

(a) $(f\circ g)(x)$.

(b) $(g\circ f)(x)$.

(c) $(f\circ f)(x)$.

(d) $( g \circ g )(x)$.

$f(x) = x + \frac{1}{x}$

$g(x) = \frac{x+8}{x+2}$

(a) The functions f(x) and g(x) cannot be defined at the values x = 0 and x = -2 respectively. Therefore, we can write this as follows: f(0) and g(-2) are not defined.

Values restricted by the domain of the starting function, which in this case is g(x) will never be in the domain of the composite function. The reason for this is because the restricted values will never make it through the starting function in the first place. This means that x = -2 will never be included in the domain of the composite function f(g(x)).

$(f\circ g)(x)$ which is equal to f(g(x)) is written as $f(\frac{x+8}{x+2})$.

So, we want to make sure that every value being returned by g(x), i.e $(\frac{x+8}{x+2})$, is in the domain of the function f(x).

Therefore, we do not want the function $g(x) = \frac{x+8}{x+2}$ to give us a value of 0 because f(0) is not defined. So, we need to find out when g(x) = 0. We solve this algebraically:

$\dfrac{x+8}{x+2}=0$

$x+8=0$

$x = -8$

Simplifying the composite function of f(g(x)) gives us:

$f(\frac{x+8}{x+2}) = \frac{x+8}{x+2} + \frac{x+2}{x+8}$

This can be simplified more, but here you get an idea already what values of x are accepted (All real numbers except -2 and -8. This one is quite clear when it comes to figuring out the domain. We will see in the upcoming examples that it is not always the case.

(b) Now let’s find the domain of $(g\circ f)(x)$.

This time, we have $(g\circ f)(x)$, which is equivalent to g(f(x)). So, the starting function is now f(x). Let’s evaluate the composite function g(f(x)) first and see what happens.

$g(x+\frac{1}{x}) = \frac{x + \frac{1}{x} + 8}{x + \frac{1}{x} + 2} = \frac{x^2 +8x +1}{x^2 + 2x +1}$

After simplifying, you will see that the value x = 0 can be defined. Although it looks like g(f(x)) can be defined at x = 0, you should remember that you will not get through f(x) in the first place. This is because f(0) cannot be defined. Now, work out the domain of g(f(x)) and convince yourself that the domain is all real numbers except x = 0 and x = -1

(c) We will start by evaluating the composite function f(f(x)).

$f(x + \frac{1}{x}) = x + \frac{1}{x} + \frac{1}{x + \frac{1}{x}}$

Make sure you work it out and get to the point where:

$f(x + \frac{1}{x}) = \frac{x^4 + 3x^2 + 1}{x(x^2+1)}$

Here, you can see that x = 0 is excluded from the domain of the composite function (since f(x) is the starting function). Let’s solve algebraically to see if x = 0 is the only restricted value on the domain. Remember, we do not want f(0), so we need to find when f(x) gives us 0.

$x+\frac{1}{x}=0$

$x^2+1=0$

$x = \sqrt{-1}$

But the domain of the square root is $x\ge 0$. Thus, we can conclude that the domain of the composite function is all real numbers except for x = 0.

(d) Finally, we will look at g(g(x)), which is a bit similar to part (b). Evaluating the composite function gives us:

$g(\frac{x+8}{x+2}) = \frac{\frac{x+8}{x+2} + 8}{\frac{x+8}{x+2} +2}$

And, finally resulting in: Work this out

$g(g(x)) = \frac{3x+8}{x+4}$

Here, you see that we have a problem similar to the one in part (b). x = -2 looks like it can be included because the function looks fine. However, you should remember that since x = -2 is not defined for g(x) (which is the starting function here), it should be excluded from the domain of the composite function.

Looking at the simplified equation, it is easy to see that x = -4 is also excluded from the domain. Therefore, the domain of g(g(x)) is all real numbers except -2 and -4.

 How clear is this post?