# Domain of a function

In mathematics, the domain of a function is the set of inputs accepted by the function. It is sometimes denoted by $\operatorname {dom} (f)$ , where f is the function. A function f from X to Y. The set of points in the red oval X is the domain of f. Graph of the real-valued square root function, f(x) = √x, whose domain consists of all nonnegative real numbers

More precisely, given a function $f\colon X\to Y$ , the domain of f is X. Note that in modern mathematical language, the domain is part of the definition of a function rather than a property of it.

In the special case that X and Y are both subsets of $\mathbb {R}$ , the function f can be graphed in the Cartesian coordinate system. In this case, the domain is represented on the x-axis of the graph, as the projection of the graph of the function onto the x-axis.

For a function $f\colon X\to Y$ , the set Y is called the codomain, and the set of values attained by the function (which is a subset of Y) is called its range or image.

Any function can be restricted to a subset of its domain. The restriction of $f\colon X\to Y$ to $A$ , where $A\subseteq X$ , is written as $\left.f\right|_{A}\colon A\to Y$ .