Let \(f\) be a function from set \(A\) to set \(B\text{.}\) If \(B\) is a subset of the set of real numbers \(\Re\text{,}\) then \(f\) is called a real valued function, and in particular if \(A\) is also a subset of \(\Re\text{,}\) then \(f:A \rightarrow B\) is called a real function.
Functions are not numbers. But just as two numbers \(a\) and \(b\) can be added to produce a new number \(a + b\text{,}\) so two functions \(f\) and \(g\) can be added to produce a new function \(f + g\text{.}\) This is just one of the several operations on functions that we will describe in this section.
Consider functions \(f\) and \(g\) defined by \(f(x) = \frac{x - 3}{2}\) and \(g(x) = \sqrt{x}\text{.}\) We can make a new function \(f + g\) by having it assign to \(x\) the value \(\frac{x - 3}{2} + \sqrt{x}\text{,}\) that is,
Since an \(x -\)value must be an input into both \(f\) and \(g\text{,}\) the domain of \((f + g)(x)\) is the set of all \(x\) common to the domain of \(f\) and \(g\text{.}\) This is usually written as \(Dom(f + g) = Dom(f) \cap Dom(g)\text{.}\) Similar statements hold for the domains of the difference and product of two functions. In the case of the quotient, we must impose the additional restriction that all elements in the domain of \(g\) for which \(g(x) = 0\) are excluded.
Let \(f(x) = \sqrt[4]{x + 1}\) and \(g(x) = \sqrt{9 - x^{2}}\text{,}\) with respective domains \(\lbrack - 1,\infty)\) and \(\lbrack - 3,3\rbrack\text{.}\) Find formulas for \(f + g,\ f - g,\ f \cdot g,\frac{f}{g}\) and \(f^{3}\) and give their domains.
\((f \circ g)(x)\) is read as \(\text{f\}\ \{}\) composed with \(g\) of \(x\text{\}\ \{}\text{.}\)\(\)The domain of \(f \circ g\) consists of those \(x^{'}\)s in the domain of \(g\) whose range values are in the domain of \(f\text{,}\) i.e. those \(x^{'}\)s for which \(g(x)\) is in the domain of \(f\text{.}\)
Suppose \(f = \left\{ (2,z),(3,q) \right\}\) and \(g = \left\{ (a,2),(b,3),(c,5) \right\}\text{.}\) The function \((f \circ g)(x) = f(g(x))\) is found by taking elements in the domain of \(g\) and evaluating as follows:
If we attempt to find \(f(g(c))\) we get \(f(5)\text{,}\) but \(5\) is not in the domain of \(f(x)\) and so we cannot find \((f \circ g)(c)\text{.}\) Hence, \(f \circ g = \left\{ (a,z),(b,q) \right\}\text{.}\) The figure below illustrates this situation.
\((g \circ f)(x) = g(f(x)) = \frac{2}{\frac{x}{x + 1} - 1} = - 2x - 2\text{.}\) Since \(x\) must first be an input into \(f(x)\) and so must be in the domain of \(f\text{,}\) we see that \(\text{Dom}(g \circ f) = \left\{ x:x \neq - 1 \right\}\text{.}\)
We now explore the meaning of equality of two functions. Let \(f:A \rightarrow B\) and \(g:A \rightarrow B\) be two functions. Then, \(f\) and \(g\) are subsets of \(A \times B\text{.}\) Suppose \(f = g\text{.}\) Let \(x\) be any element of \(A\text{.}\) Then, \((x,f(x)) \in f = g\) and thus \((x,f(x)) \in g\text{.}\) Since \(g\) is a function and \((x,f(x)),\)\((x,g(x)) \in g\text{,}\) we must have \(f(x) = g(x)\text{.}\) Conversely, assume that \(g(x) = f(x)\) for all \(x \in A\text{.}\) Let \((x,y) \in f\text{.}\) Then, \(y = f(x) = g(x)\text{.}\) Thus, \((x,y) \in g\text{,}\) which implies that \(f \subseteq g\text{.}\) Similarly, we can show that \(g \subseteq f\text{.}\) It now follows that \(f = g\text{.}\) Thus two functions \(f:A \rightarrow B\) and \(g:A \rightarrow B\) are equal if and only if \(f(x) = g(x)\) for all \(x \in A\text{.}\) In general we have the following definition.
Let \(f:Z \rightarrow Z^{+} \cup \left\{ 0 \right\}\) and \(g:Z \rightarrow Z^{+} \cup \left\{ 0 \right\}\) be defined by \(f = \left\{ (n,n^{2}):n \in Z \right\}\) and \(g = \left\{ (n,\left| n \right|^{2}):n \in Z \right\}\text{.}\) Now, for all \(n \in Z\text{,}\)\(f(n) = n^{2} = \left| n \right|^{2} = g(n)\text{.}\) Thus, \(f = g\text{.}\)
Let \(f(x) = \frac{x^{2} - \text{25}}{x - 5},\ x \in \Re \setminus \{ 5\} \text{,}\) and \(g(x) = x + 5,\ x \in \Re\text{.}\) The function \(f\) and \(g\) are not equal because \(\text{Dom}(f) \neq \text{Dom}(g)\text{.}\)