# Given $f(x)$ and $g(x)$, find the range and domain of $fg(x)$

We are given:

\eqalign{ & f(x) = x - 1 \cr & g(x) = {x^2} \cr}

Given these functions the answer I get is:

$fg(x)=x^2-1$

As the range of $g(x)=x^2$ is always positive this means the domain of the new function is $x \geqslant 0$ The range of this function is $fg(x) \geqslant - 1$

However this is wrong, the answer in the textbook states that the domain is the set of real numbers, and I know this makes sense as it is a quadratic equation and can accept all values but doesn't the function $g(x)$ who's outputs form the inputs of the compound function $gf(x)$ limit the domain to being $x \geqslant 0$ ?

It’s true that the outputs of $g$ are non-negative, but since $f$ can accept any real number as input, it really doesn’t matter what the outputs of $g$ are. The domain of the composite function $f\circ g$ is the set of all acceptable inputs to $f\circ g$; $g$ can accept any real number as input, and the output of $g$ is always acceptable input to $f$, so $f\circ g$ can accept any real number as input. In other words, its domain really is $\Bbb R$.
• Ah, I see! but say $g(x) = \sqrt x$, would I be right in thinking that would change things, as despite fg(x) being able to accept any real number the square root would restrict the domain to non-negative numbers, right? Oct 5 '13 at 21:24
• @Assad: Yes, if $g$ were the square root function, then the domain of $f\circ g$ would indeed be the set of non-negative reals. Oct 5 '13 at 21:27