Mathwords logoMathwords

Domain of a Function — Definition, Formula & Examples

The domain of a function is the complete set of input values (usually xx-values) for which the function is defined and produces a real output.

Given a function f:ABf: A \to B, the domain is the set AA consisting of all elements xx such that f(x)f(x) exists in the codomain BB. When working with real-valued functions, the domain is the largest subset of R\mathbb{R} for which the rule f(x)f(x) yields a real number, unless a different domain is explicitly stated.

How It Works

To find the domain, ask: "Which xx-values would cause a problem?" The three most common restrictions for real-valued functions are division by zero, square roots (or even roots) of negative numbers, and logarithms of non-positive numbers. Exclude those problematic xx-values, and everything that remains is the domain. For polynomial functions like f(x)=3x25x+1f(x) = 3x^2 - 5x + 1, no operation is restricted, so the domain is all real numbers. When a function is defined by a graph, the domain is the set of all xx-values that the graph covers from left to right.

Worked Example

Problem: Find the domain of f(x)=x2x5f(x) = \dfrac{\sqrt{x - 2}}{x - 5}.
Identify restriction 1 — square root: The expression under the square root must be non-negative.
x20    x2x - 2 \ge 0 \implies x \ge 2
Identify restriction 2 — denominator: The denominator cannot equal zero.
x50    x5x - 5 \neq 0 \implies x \neq 5
Combine both restrictions: Take the values satisfying x2x \ge 2 and remove x=5x = 5.
Domain=[2,5)(5,)\text{Domain} = [2,\, 5) \cup (5,\, \infty)
Answer: The domain is [2,5)(5,)[2, 5) \cup (5, \infty), meaning all real numbers from 2 onward except 5.

Another Example

Problem: Find the domain of g(x)=ln(4x)g(x) = \ln(4 - x).
Apply the logarithm restriction: The argument of a natural logarithm must be strictly positive.
4x>04 - x > 0
Solve the inequality: Isolate xx.
x<4x < 4
State the domain: All real numbers less than 4.
Domain=(,4)\text{Domain} = (-\infty,\, 4)
Answer: The domain is (,4)(-\infty, 4).

Why It Matters

Domain shows up constantly in Algebra 2, Precalculus, and AP Calculus when you analyze or compose functions. In calculus, you must know the domain before you can discuss limits, continuity, or differentiability. Engineers and data scientists also check domains to ensure their mathematical models only receive inputs that produce meaningful results.

Common Mistakes

Mistake: Forgetting to check multiple restrictions at once.
Correction: A function like xx3\dfrac{\sqrt{x}}{x - 3} has two restrictions: x0x \ge 0 from the square root AND x3x \neq 3 from the denominator. You must combine both to get the correct domain [0,3)(3,)[0, 3) \cup (3, \infty).
Mistake: Assuming every function has domain all real numbers.
Correction: Only certain types — mainly polynomials, exponential functions, and sine/cosine — have domain (,)(-\infty, \infty). Always inspect the formula for division, even roots, and logarithms before concluding the domain is unrestricted.

Related Terms