FUNCTIONS 03
Domain, Codomain and Range
The domain tells us which inputs are allowed. The codomain declares where outputs are expected to lie. The range contains the outputs actually produced.
The main idea
A function is not just a formula. It also includes information about the allowed inputs and the set containing its outputs.
\[\boxed{f:A\to B}\]Here \(A\) is the domain and \(B\) is the codomain. The range is the subset of \(B\) actually reached by the function.
1. Domain: the allowed inputs
The domain is the set of values that may be supplied as inputs.
For
\[f(x)=x^2,\]every real number is allowed, so the domain is \(\mathbb R\).
\(\mathbb R\)
↓ choose any real \(x\)
\(x\mapsto x^2\)
2. Range: the outputs actually produced
For \(f(x)=x^2\), real inputs never produce a negative output.
\[f(x)\ge0.\]Therefore the range is
\[[0,\infty).\]3. Domain and range are different ideas
For \(f(x)=x^2\),
\[\text{domain}=(-\infty,\infty),\qquad\text{range}=[0,\infty).\]The function accepts negative inputs, but it does not produce negative outputs.
↓ square
outputs: \(\ldots,4,1,0,1,4,\ldots\)
4. Division can restrict the domain
For
\[f(x)=\frac1x,\]the input \(x=0\) is forbidden because division by zero is undefined.
\[\text{domain}=\mathbb R\setminus\{0\}.\]5. Square roots can restrict the domain
For the real-valued function
\[f(x)=\sqrt{x},\]we require \(x\ge0\). The range is also \([0,\infty)\).
6. Context can choose a smaller domain
A formula may be mathematically valid for more inputs than make sense in an application.
If
\[P(t)=100e^{0.2t}\]models population from the start of an observation period, we may choose \(t\ge0\).
modelling domain: \(t\ge0\)
because negative time is outside the chosen study period
7. Several restrictions can act together
Consider
\[f(x)=\frac{\sqrt{x-2}}{x-5}.\]The square root requires \(x\ge2\), while the denominator requires \(x\ne5\).
\[\boxed{\text{domain}=[2,5)\cup(5,\infty)}.\]8. Reading domain and range from a graph
Geometrically, the domain is the horizontal extent of the graph, while the range is its vertical extent.
\[\text{domain}\leftrightarrow x\text{-values},\qquad\text{range}\leftrightarrow y\text{-values}.\]9. Codomain and range
The codomain is the declared set containing possible outputs. The range is what is actually reached.
For
\[f:\mathbb R\to\mathbb R,\qquad f(x)=x^2,\]the codomain is \(\mathbb R\), but the range is only \([0,\infty)\).
10. Formal function notation
The notation
\[f:A\to B\]is read “\(f\) maps \(A\) to \(B\)”. For every \(x\in A\), the function assigns one output \(f(x)\in B\).
The range is therefore always contained in the codomain.
\(B\) = codomain
\(f(A)\) = range
\(f(A)\subseteq B\)
The domain contains allowed inputs. The codomain is the declared output set. The range contains outputs actually produced. Formulas, algebraic restrictions, graphs and modelling context can all determine the domain and range.
Why this matters for calculus
Limits, derivatives and integrals are meaningful only where functions are defined. Domain restrictions identify where a formula can be used, while range information helps describe bounds, extrema and the behaviour of a model.