The domain of a function is the set of all input values for which is defined. The range is the set of all output values that actually produces.
Common domain restrictions:
- Division: excludes .
- Even roots: requires in the reals.
- Logarithms: requires .
Finding the range is often harder than the domain — you must analyse the function's behaviour. For polynomials, calculus (derivatives, asymptotic analysis) helps determine the range; for trig functions, you exploit periodicity and bounded amplitude (e.g. has range ).
In coding, "domain" / "range" become type signatures; in machine learning, they describe the input space and output space of a model.