algebra

Domain and Range

The domain of a function is the set of all valid inputs; the range is the set of all possible outputs. Together they fully describe what the function maps.

本术语中文版本即将上线。下方暂以英文原文展示。

The domain of a function ff is the set of all input values xx for which f(x)f(x) is defined. The range is the set of all output values that ff actually produces.

Common domain restrictions:

  • Division: f(x)=1/xf(x) = 1/x excludes x=0x = 0.
  • Even roots: f(x)=xf(x) = \sqrt{x} requires x0x \geq 0 in the reals.
  • Logarithms: ln(x)\ln(x) requires x>0x > 0.

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. sinx\sin x has range [1,1][-1, 1]).

In coding, "domain" / "range" become type signatures; in machine learning, they describe the input space and output space of a model.