A function can look perfectly fine in a formula and still make no sense for certain inputs. For example, if a function describes the number of engines built in a factory, using an input like \(2.7\) engines is not realistic. If a graph stops at \(x = 5\), then values beyond \(5\) are not in its domain, even if the algebra seems possible. Understanding domain means asking a deeper question than "Can I substitute this number?" It means asking, "Is this input allowed by the graph, the formula, and the real-world situation?"
The domain of a function is the set of all input values for which the function is defined. In most graphs and formulas, the input variable is \(x\). In applications, the input might be time, number of items, length, temperature, or another quantity.
Domain is the set of all allowed input values of a function. Range is the set of all possible output values. The domain tells you what you are allowed to put into the function; the range tells you what can come out.
When you identify the domain, you are finding every value of the independent variable that makes sense. Sometimes the domain is all real numbers. Sometimes it is a short interval such as \(0 \, \leq \, t \, \leq \, 10\). Sometimes it is a set of separate values such as \(\{1,2,3,4,5\}\). The correct domain depends on the situation.
In more advanced algebra, students often start with formulas and ask which values are forbidden. But in applications, a formula is only part of the story. A quantity can be mathematically possible and still not fit the context. That is why the domain must be connected to both the graph and the real meaning of the variables.
In applications, the domain depends on what the input represents. Consider the function \(h(n)\), where \(h(n)\) gives the number of person-hours needed to assemble \(n\) engines. Because \(n\) counts engines, the inputs must be whole numbers, and in most cases positive whole numbers. As [Figure 1] shows, this kind of situation is represented by separate points rather than a continuous line, because values like \(1.5\) engines do not make sense.
So an appropriate domain could be the positive integers \(\{1,2,3,4,\dots\}\), or perhaps a limited set such as \(\{1,2,3,\dots,50\}\) if the factory only tracks daily production up to \(50\) engines. The context decides whether the domain is infinite or limited.

Here are some common kinds of real-world inputs and the domains they suggest:
| Situation | Input variable | Appropriate domain | Why |
|---|---|---|---|
| Number of books sold | \(b\) | Nonnegative integers | You cannot sell \( -1\) books or \(2.4\) books in a count. |
| Time during a race | \(t\) | \(0 \leq t \leq T\) | Time can vary continuously during the race. |
| Side length of a square | \(s\) | \(s > 0\) | Lengths must be positive. |
| Height of water in a tank over one hour | \(t\) | \(0 \leq t \leq 60\) | The model only applies during that hour. |
| Monthly profit based on items made | \(n\) | Nonnegative integers, often bounded above | Items are counted, and production may have a maximum capacity. |
Table 1. Examples of how the meaning of the input variable determines an appropriate domain.
Context can also rule out negative values. If \(t\) is time since a medicine was taken, then \(t < 0\) does not fit the situation. If \(x\) is the width of a room, then \(x \leq 0\) is impossible. If \(n\) is the number of students attending an event, then decimals usually do not belong in the domain.
In computer science and engineering, choosing a correct domain is a safety issue, not just a math detail. A formula used outside its valid inputs can lead to impossible predictions or incorrect design decisions.
Sometimes there is more than one reasonable domain depending on the question. For a taxi fare function, the input might be distance traveled, which could be any nonnegative real number, or it might be the number of miles shown on a meter rounded to the nearest whole mile. The function's meaning changes with the chosen input.
When a function is given by a graph, the domain is the set of all x-values where the graph has at least one point. To find it, scan the graph from left to right and record every horizontal position that contains part of the graph. Endpoints and gaps matter.
[Figure 2] If the graph begins at \(x = -4\) and ends at \(x = 5\), then the domain includes values from \(-4\) to \(5\), unless there are holes or breaks. A filled point means the endpoint is included. An open circle means that point is not included.
Suppose a graph exists from \(x = -4\) to \(x = 2\), with a closed endpoint at \(-4\) and an open endpoint at \(2\). Then that piece has domain \([-4, 2)\). If another piece exists from \(x = 3\) to \(x = 5\), both included, then the full domain is \([-4,2) \cup [3,5]\).

Graphs can show several different domain patterns:
A graph gives direct visual evidence about the domain. If no point appears above a certain \(x\)-value, then that input is not in the domain. Later, when comparing discrete and continuous situations, the contrast in [Figure 3] makes this especially clear.
When a function is given by a formula, you can often start by asking which inputs make the expression undefined. This gives the mathematical domain. Then, if the function describes a real situation, you must also check whether all those values make sense in context.
Two major sources of domain restrictions
For many high school functions, domain restrictions come from two places. First, a denominator cannot equal \(0\). Second, for a square root in the real number system, the expression inside the root cannot be negative. These restrictions come from algebra, before any real-world context is considered.
For example, in the rational function \(f(x) = \dfrac{3}{x-5}\), the denominator becomes \(0\) when \(x = 5\). So \(x = 5\) must be excluded. The domain is all real numbers except \(5\).
In the square-root function \(g(x) = \sqrt{x+2}\), the expression inside the root must satisfy \(x+2 \geq 0\). That means \(x \geq -2\). So the domain is \([-2, \infty)\).
Some functions have no algebraic restrictions. For example, a linear function such as \(y = 2x - 7\) is defined for all real numbers. A quadratic such as \(y = x^2 + 1\) is also defined for all real numbers. But if these functions model a real situation, the practical domain may still be smaller. A formula can allow all real numbers while the context allows only part of them.
A discrete domain contains separate individual values, often counts such as \(0,1,2,3,\dots\). A continuous domain contains all values in an interval, including decimals and fractions. The appearance of the graph often reveals the difference.
[Figure 3] If the input is the number of cars in a parking lot, only whole-number values make sense. That is discrete. If the input is time in minutes, values such as \(2.5\) minutes or \(2.53\) minutes may make sense. That is continuous.
This difference changes how a graph should look. A discrete function is graphed with isolated points. A continuous function is usually graphed with a connected curve or line segment.

The factory example from earlier is discrete because engines are counted one by one. By contrast, the height of a drone during the first \(10\) seconds of flight is usually modeled with a continuous domain such as \(0 \leq t \leq 10\), because time changes smoothly. Looking back at [Figure 1], the separate points show why decimal inputs are not appropriate there.
Intervals use brackets and parentheses to show whether endpoints are included. For example, \([2,6]\) includes both endpoints, while \((2,6)\) excludes both. A union such as \(( -\infty,1) \cup (1,\infty)\) means two separate pieces of the domain.
Discrete and continuous are not just graphing styles. They reflect the meaning of the variable itself. If you choose the wrong kind of domain, the graph can suggest impossible values or hide important restrictions.
Example 1: Domain from a context
A function \(C(n)\) gives the total cost of printing \(n\) posters for a school event. What is an appropriate domain?
Step 1: Identify what the input represents.
The variable \(n\) is the number of posters printed.
Step 2: Decide what values make sense.
You cannot print a negative number of posters, and you usually do not print fractional posters such as \(3.5\).
Step 3: State the domain.
An appropriate domain is the nonnegative integers:
\[n \in \{0,1,2,3,\dots\}\]
If the printer can make at most \(500\) posters, then a more specific domain is \(\{0,1,2,\dots,500\}\).
This example shows that context can limit the domain much more strongly than algebra alone. Even if a cost formula can be evaluated at \(n = 2.4\), that does not mean the input is meaningful.
Example 2: Domain from a graph
A graph has points for all \(x\)-values from \(-3\) to \(1\), including both endpoints, and also for all \(x\)-values from \(4\) to \(6\), but not including \(6\). Find the domain.
Step 1: Write the first interval.
From \(-3\) to \(1\), including both endpoints, gives \([-3,1]\).
Step 2: Write the second interval.
From \(4\) to \(6\), not including \(6\), gives \([4,6)\).
Step 3: Combine the intervals.
The full domain is
\[[-3,1] \cup [4,6)\]
The gap between \(1\) and \(4\) matters. Those inputs are not in the domain.
When students make mistakes with graph domains, they often read the graph vertically instead of horizontally. Domain is about where the graph exists along the horizontal axis.
Example 3: Domain from a rational formula
Find the domain of \(f(x) = \dfrac{x+1}{x^2-9}\).
Step 1: Find values that make the denominator \(0\).
Solve \(x^2 - 9 = 0\).
Factoring gives \((x-3)(x+3) = 0\), so \(x = 3\) or \(x = -3\).
Step 2: Exclude those values.
The function is undefined at \(x = 3\) and \(x = -3\).
Step 3: State the domain.
The domain is all real numbers except \(-3\) and \(3\):
\[( -\infty,-3) \cup (-3,3) \cup (3,\infty)\]
This is a mathematical restriction from the formula itself.
A graph of this rational function would show breaks at \(x = -3\) and \(x = 3\). That connection between formula and graph is one of the main ideas in function interpretation.
Example 4: Domain from a square-root formula and context
A function \(d(t) = \sqrt{20 - t}\) models a quantity during an experiment, where \(t\) is time in minutes. Find the mathematical domain and then the practical domain if the experiment lasts only \(12\) minutes.
Step 1: Use the square-root restriction.
The expression inside the root must be nonnegative:
\(20 - t \geq 0\)
So \(t \leq 20\).
Step 2: State the mathematical domain.
The mathematical domain is
\[( -\infty,20]\]
Step 3: Apply the context.
Since \(t\) is time in minutes during the experiment, negative time does not make sense, and the experiment lasts only \(12\) minutes.
Step 4: State the practical domain.
The practical domain is
\([0,12]\)
This example shows that context can shrink the domain even after the algebraic restriction is found.
The difference between mathematical domain and practical domain is important in science, finance, and engineering. A formula may be valid in a broad sense, while the model applies only over a smaller interval.
Functions appear in manufacturing, economics, medicine, and technology, but their domains are never arbitrary. If a company uses a function to predict cost based on the number of units produced, the input is usually a count, so whole numbers are appropriate. If an engineer models the cooling of a metal part over time, the input is time, so a continuous interval is more appropriate.
In medicine, a function might describe the amount of a drug in the bloodstream after a dose. The graph may only apply for a certain number of hours after the medication is taken. Inputs outside that time window do not belong in the practical domain. In business, a revenue model may be meaningful only for production levels from \(0\) to the factory's capacity. In environmental science, a temperature model may be used only during one season or under one set of conditions.
"The right answer in mathematics is not only about calculation; it is also about choosing values that actually mean something."
Even in sports analytics, domain matters. A function describing a runner's position during a \(100\)-meter race only makes sense during the race itself. Times before the starting gun or long after the finish do not belong. Reading the graph and interpreting the context together prevents unreasonable conclusions.
One common mistake is assuming every function has domain "all real numbers." That is not true for many graphs, rational expressions, square-root functions, and application-based models.
Another mistake is ignoring the meaning of the variable. If \(n\) counts students, using decimals is usually inappropriate. If \(x\) is a length, negative values are usually impossible. If a graph ends at \(x = 8\), then values larger than \(8\) are not in the domain unless the graph indicates continuation.
A third mistake is confusing domain with range. Domain is about inputs, usually read from the horizontal axis. Range is about outputs, usually read from the vertical axis.
Good reasoning about domain asks three questions: What inputs are allowed by the formula? What inputs are shown by the graph? What inputs make sense in the context? The best answer often combines all three.