Answer
The answer is below.
Work Step by Step
It is necessary because some values will not result in a valid output if used as an input for the function. For instance, if the denominator of the fraction was x+5, we could not use -5 as an input, for it would result in the denominator canceling out to 0, which is not allowed.