{
  "id": "domain-of-a-function",
  "title": "Domain of a Function",
  "lang": "en",
  "source_lang": "en",
  "summary": "The domain of a function is the set of inputs for which the function assigns a uniquely determined output.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Function domain",
    "domain of definition",
    "input set"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/domain-of-a-function/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/domain-of-a-function/",
      "json": "https://aiwiki.page/zh/domain-of-a-function.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The domain of a function is the set of all inputs on which a function is defined. In the notation \\(f:A\\to B\\), the domain is \\(A\\): every element of \\(A\\) must be assigned exactly one output in \\(B\\). A domain may consist of numbers, ordered tuples, or other mathematical objects. It is distinct from both the set of permitted outputs and the set of outputs actually attained. Specifying a function therefore requires more than an algebraic formula; its input set must also be understood. (jirilebl.github.io)"
    },
    {
      "heading": "Formal definition and related sets",
      "text": "In set theory, a function \\(f:A\\to B\\) can be represented by a subset of the Cartesian product \\(A\\times B\\), with exactly one ordered pair \\((x,y)\\) for every \\(x\\in A\\). This set of pairs is its graph. The domain can be recovered from the graph by\n\n\\[\\operatorname{dom}(f)=\\{x:\\text{there exists }y\\text{ with }(x,y)\\in f\\}.\\]\n\nThe set \\(B\\) is the codomain, while the image, also commonly called the range, is\n\n\\[f(A)=\\{f(x):x\\in A\\}.\\]\n\nThe image is a subset of the codomain, but need not equal it. (jirilebl.github.io)\n\nFor example, \\(f:\\mathbb R\\to\\mathbb R\\), \\(f(x)=x^2\\), has all real numbers as its domain and codomain, but its image is \\([0,\\infty)\\). Inputs and outputs play different roles: negative numbers are valid inputs even though no negative output is produced. A function is surjective precisely when its image equals its codomain. (jirilebl.github.io)"
    },
    {
      "heading": "Specified and natural domains",
      "text": "A domain may be explicitly prescribed. The assignments \\(f(x)=x^2\\) on \\(\\mathbb R\\) and \\(g(x)=x^2\\) on \\([0,\\infty)\\) define different functions, despite using the same formula. Similarly, a function defined only on the integers does not automatically accept arbitrary real inputs merely because its formula can be evaluated there. The declared domain controls which inputs belong to the function. (jirilebl.github.io)\n\nWhen an elementary formula is given without an explicit domain, a common convention is to use its natural domain: the largest subset of the intended number system on which the expression is defined. For real-valued formulas, typical restrictions are:\n\n- A polynomial has natural domain \\(\\mathbb R\\).\n- A quotient excludes inputs that make its denominator zero.\n- An even root requires a nonnegative radicand.\n- A real logarithm requires a strictly positive argument. (openstax.org)\n\nThus \\(1/(x-2)\\) has domain \\(\\mathbb R\\setminus\\{2\\}\\), whereas \\(\\sqrt{x-2}\\) has domain \\([2,\\infty)\\). These are real-domain statements: changing the intended number system to the complex numbers changes the available operations and may require additional choices, such as a branch of a logarithm. “Natural domain” is therefore meaningful only relative to the mathematical setting. (openstax.org)"
    },
    {
      "heading": "Notation and graphical interpretation",
      "text": "Domains can be expressed by listing elements, using set-builder notation, or using interval notation. For instance,\n\n\\[\\{x\\in\\mathbb R:x\\ge2\\}=[2,\\infty).\\]\n\nSquare brackets include a finite endpoint; parentheses exclude it. An excluded point may split a domain into several intervals:\n\n\\[\\mathbb R\\setminus\\{2\\}=(-\\infty,2)\\cup(2,\\infty).\\]\n\nInfinity symbols always take parentheses in interval notation because they are not real endpoints. (openstax.org)\n\nFor the graph of a real function of one variable, the domain consists of the horizontal coordinates of all graph points. Holes and missing endpoints can therefore affect the domain. A displayed plotting window, however, may show only part of the graph and does not necessarily establish the function’s complete domain. (openstax.org)"
    },
    {
      "heading": "Operations and composition",
      "text": "For real-valued functions with domains \\(A\\) and \\(C\\), the pointwise sum, difference, and product are defined on \\(A\\cap C\\). Their quotient has domain\n\n\\[\\{x\\in A\\cap C:g(x)\\ne0\\}.\\]\n\nSimplifying a formula does not restore excluded inputs. For example,\n\n\\[\\frac{x^2-1}{x-1}=x+1\\qquad(x\\ne1).\\]\n\nThe quotient retains its exclusion of \\(1\\); the polynomial \\(x+1\\), defined everywhere on \\(\\mathbb R\\), is an extension rather than the identical function. (openstax.org)\n\nFor function composition, the output of the inner function must be an admissible input to the outer function:\n\n\\[\\operatorname{dom}(g\\circ f) =\\{x\\in\\operatorname{dom}(f):f(x)\\in\\operatorname{dom}(g)\\}.\\]\n\nFor example, if \\(f(x)=x-3\\) and \\(g(u)=\\sqrt{u}\\), then \\(g(f(x))=\\sqrt{x-3}\\) is defined exactly when \\(x\\ge3\\). Merely intersecting the original domains would not express the required condition on the intermediate output. (openstax.org)"
    },
    {
      "heading": "Restrictions and inverse functions",
      "text": "Restricting a function means retaining its assignments only on a selected subset of its domain. This can change whether the function is injective. Squaring is not injective on \\(\\mathbb R\\), since \\(x\\) and \\(-x\\) have the same square, but it is injective on \\([0,\\infty)\\). (openstax.org)\n\nThe inverse function of an injective function, taken onto its image, has that image as its domain. Accordingly, the inverse of \\(x\\mapsto x^2\\) restricted to \\([0,\\infty)\\) is \\(y\\mapsto\\sqrt y\\), also defined on \\([0,\\infty)\\). Domain restriction is thus essential when constructing inverses of functions that are not initially one-to-one. (openstax.org)"
    },
    {
      "heading": "Multivariable and contextual domains",
      "text": "A function of several variables has tuples as inputs, usually forming a subset of Euclidean space \\(\\mathbb R^n\\). For example,\n\n\\[h(x,y)=\\sqrt{9-x^2-y^2}\\]\n\nhas domain\n\n\\[\\{(x,y)\\in\\mathbb R^2:x^2+y^2\\le9\\},\\]\n\nthe closed disk of radius \\(3\\). Both variables must satisfy the joint constraint; separate lists of allowable coordinates would not describe the domain adequately. (openstax.org)\n\nIn applications, context may impose restrictions beyond those required by the formula. The cylinder-volume formula \\(V(r,h)=\\pi r^2h\\) is algebraically meaningful for every real pair, but interpreting \\(r\\) and \\(h\\) as the radius and height of a nondegenerate cylinder requires \\(r>0\\) and \\(h>0\\). The domain then records the admissible physical inputs, not merely where arithmetic is possible. (openstax.org)"
    }
  ],
  "links": [
    "mathematical-function",
    "set-theory",
    "subset",
    "cartesian-product",
    "ordered-pair",
    "graph-of-a-function",
    "codomain",
    "image-of-a-function",
    "real-number",
    "surjective-function",
    "integer",
    "polynomial",
    "logarithm",
    "complex-number",
    "interval-mathematics",
    "function-composition",
    "injective-function",
    "inverse-function",
    "euclidean-space",
    "closed-set"
  ],
  "sources": [
    {
      "title": "jirilebl.github.io/ra/html/sec_basicset.html",
      "url": "https://jirilebl.github.io/ra/html/sec_basicset.html"
    },
    {
      "title": "openstax.org/books/precalculus-2e/pages/1-2-domain-and-range",
      "url": "https://openstax.org/books/precalculus-2e/pages/1-2-domain-and-range"
    },
    {
      "title": "openstax.org/books/precalculus/pages/1-4-composition-of-functions",
      "url": "https://openstax.org/books/precalculus/pages/1-4-composition-of-functions?modal=KS"
    },
    {
      "title": "openstax.org/books/precalculus-2e/pages/1-7-inverse-functions",
      "url": "https://openstax.org/books/precalculus-2e/pages/1-7-inverse-functions"
    },
    {
      "title": "openstax.org/books/calculus-volume-3/pages/4-1-functions-of-several-variables",
      "url": "https://openstax.org/books/calculus-volume-3/pages/4-1-functions-of-several-variables"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}