An example of a constant function isy(x) = 4, because the value ofy(x) is 4 regardless of the input valuex.
As a real-valued function of a real-valued argument, a constant function has the general formy(x) =c or justy =c. For example, the functiony(x) = 4 is the specific constant function where the output value isc = 4. Thedomain of this function is the set of allreal numbers. Theimage of this function is thesingleton set{4}. The independent variablex does not appear on the right side of the function expression and so its value is "vacuously substituted"; namelyy(0) = 4,y(−2.7) = 4,y(π) = 4, and so on. No matter what value ofx is input, the output is4.[1]
The graph of the constant functiony =c is ahorizontal line in theplane that passes through the point(0,c).[2] In the context of apolynomial in one variablex, the constant function is callednon-zero constant function because it is a polynomial of degree 0, and its general form isf(x) =c, wherec is nonzero. This function has no intersection point with thex-axis, meaning it has noroot (zero). On the other hand, the polynomialf(x) = 0 is theidentically zero function. It is the (trivial) constant function and everyx is a root. Its graph is thex-axis in the plane.[3] Its graph is symmetric with respect to they-axis, and therefore a constant function is aneven function.[4]
In the context where it is defined, thederivative of a function is a measure of the rate of change of function values with respect to change in input values. Because a constant function does not change, its derivative is 0.[5] This is often written:. The converse is also true. Namely, ify′(x) = 0 for all real numbersx, theny is a constant function.[6] For example, given the constant function. The derivative ofy is the identically zero function.
For any non-emptyX, every setY isisomorphic to the set of constant functions in. For anyX and each elementy inY, there is a unique function such that for all. Conversely, if a function satisfies for all, is by definition a constant function.
As a corollary, the one-point set is agenerator in the category of sets.
Every set is canonically isomorphic to the function set, orhom set in the category of sets, where 1 is the one-point set. Because of this, and the adjunction between Cartesian products and hom in the category of sets (so there is a canonical isomorphism between functions of two variables and functions of one variable valued in functions of another (single) variable,) the category of sets is aclosed monoidal category with theCartesian product of sets as tensor product and the one-point set as tensor unit. In the isomorphismsnatural inX, the left and right unitors are the projections and theordered pairs and respectively to the element, where is the uniquepoint in the one-point set.