What Is The Domain And Range Of A Function?
The domain and range of a function are the two sets that describe what the function accepts and what it produces. The domain is the set of all allowable input values $x$ for which the function is defined; the range is the set of all output values $y$ the function actually produces as $x$ runs over the domain.
Written compactly, for a function $f$:
$$\text{Domain} = {, x : f(x) \text{ is defined} ,}, \qquad \text{Range} = {, f(x) : x \in \text{Domain} ,}$$
A function pairs each input with exactly one output, so the domain is the list of legal inputs and the range is everything those inputs can reach. The range sits inside a larger set called the codomain (the type of output, such as "all real numbers"); the range is the part of the codomain that is genuinely hit. Different types of functions restrict these sets in different ways, and the whole skill is learning which inputs to throw out and which outputs are reachable.
Two notations describe these sets. Set-builder notation states the condition, such as ${, x \in \mathbb{R} : x \ge 2 ,}$. Interval notation lists the stretch, such as $[2, \infty)$, where a square bracket includes the endpoint and a parenthesis excludes it. Infinity always takes a parenthesis, because it is never reached.
How Do You Find The Domain Of A Function?
To find the domain, start from "all real numbers" and remove only the inputs that break a rule. Three rules cause almost every exclusion:
Division by zero. A denominator can never equal $0$. Set the denominator equal to zero, solve, and exclude those values.
Even roots of negatives. Inside a square root (or any even root) the expression must be $\ge 0$. Set the radicand $\ge 0$ and solve.
Logs of non-positive numbers. Inside a logarithm the argument must be strictly $> 0$. A logarithmic function is undefined at zero and below.
A polynomial has none of these, so its domain is all of $\mathbb{R}$. Everything else is a matter of applying the rules above and writing what survives.
Example 1: Domain of a square-root function. Find the domain of $f(x) = \sqrt{x - 2}$.
The radicand must be non-negative:
$$x - 2 \ge 0 \quad\Longrightarrow\quad x \ge 2$$
Final answer: domain $= [2, \infty)$, or ${, x \in \mathbb{R} : x \ge 2 ,}$.
Example 2: Domain of a rational function. Find the domain of $f(x) = \dfrac{1}{x - 3}$.
The denominator cannot be zero:
$$x - 3 \ne 0 \quad\Longrightarrow\quad x \ne 3$$
Final answer: domain $= (-\infty, 3) \cup (3, \infty)$, or ${, x \in \mathbb{R} : x \ne 3 ,}$.
Example 3: When two rules combine. Find the domain of $f(x) = \dfrac{1}{\sqrt{4 - x^2}}$.
The root sits in a denominator, so the radicand must be strictly positive (not merely $\ge 0$), otherwise the denominator is zero:
$$4 - x^2 > 0 \quad\Longrightarrow\quad x^2 < 4 \quad\Longrightarrow\quad -2 < x < 2$$
Final answer: domain $= (-2, 2)$. The strict inequality is the whole point: at $x = \pm 2$ the denominator would be $0$, so both endpoints are excluded.
How Do You Find The Range Of A Function?
Finding a range is harder than finding a domain, because you are asking which outputs are reachable rather than which inputs are legal. Three methods cover almost every case.
Algebraically: solve $y = f(x)$ for $x$, then ask which values of $y$ give a real, legal $x$. The $y$-values that survive form the range.
From the graph: the range is the vertical shadow of the curve, the set of heights the graph actually reaches.
With calculus: use the derivative to find the highest and lowest outputs (extrema), and use asymptotes and end behaviour to see where the graph levels off or runs away to infinity. This is how you pin an exact range when the algebra is stubborn.
Example 4: Range by the algebraic method. Find the range of $f(x) = \dfrac{1}{x - 3}$.
Solve for $x$: from $y = \dfrac{1}{x-3}$ you get $x - 3 = \dfrac{1}{y}$, so $x = 3 + \dfrac{1}{y}$. This is a real, legal input for every $y$ except $y = 0$ (which would divide by zero).
Final answer: range $= (-\infty, 0) \cup (0, \infty)$, or ${, y \in \mathbb{R} : y \ne 0 ,}$. A fraction with a non-zero numerator can get arbitrarily close to $0$ but never equals it, which matches the horizontal asymptote $y = 0$ on the graph.
Example 5: Range pinned by calculus. Find the range of $f(x) = \dfrac{x}{x^2 + 1}$.
The domain is all of $\mathbb{R}$, since $x^2 + 1 \ge 1 > 0$ always. To find the extreme outputs, differentiate using the quotient rule and set $f'(x) = 0$:
$$f'(x) = \frac{(x^2 + 1)(1) - x(2x)}{(x^2 + 1)^2} = \frac{1 - x^2}{(x^2 + 1)^2}$$
$$f'(x) = 0 \quad\Longrightarrow\quad 1 - x^2 = 0 \quad\Longrightarrow\quad x = \pm 1$$
Evaluate at the critical inputs: $f(1) = \dfrac{1}{2}$ and $f(-1) = -\dfrac{1}{2}$. The end behaviour confirms these are the extremes:
$$\lim_{x \to \pm\infty} \frac{x}{x^2 + 1} = 0$$
So the graph rises to a highest point of $\tfrac{1}{2}$, falls to a lowest point of $-\tfrac{1}{2}$, and flattens toward $0$ at both ends.
Final answer: range $= \left[ -\dfrac{1}{2}, \dfrac{1}{2} \right]$. Here the derivative did what algebra alone could not: it located the exact ceiling and floor of the output.
What Is The Domain And Range Of A Function, By Type?
Most functions fall into a handful of families, and knowing each family's domain and range on sight saves most of the work.
Table: Domain and range of the common function families.
Function | Domain | Range |
|---|---|---|
$f(x) = mx + c,\ m \ne 0$ (linear) | $\mathbb{R}$ | $\mathbb{R}$ |
$f(x) = x^2$ (and even powers) | $\mathbb{R}$ | $[0, \infty)$ |
$f(x) = x^3$ (odd polynomial) | $\mathbb{R}$ | $\mathbb{R}$ |
$f(x) = \sqrt{x}$ | $[0, \infty)$ | $[0, \infty)$ |
$f(x) = \dfrac{1}{x}$ | $(-\infty, 0) \cup (0, \infty)$ | $(-\infty, 0) \cup (0, \infty)$ |
$f(x) = e^{x}$ | $\mathbb{R}$ | $(0, \infty)$ |
$f(x) = \ln x$ | $(0, \infty)$ | $\mathbb{R}$ |
$f(x) = \lvert x \rvert$ (see absolute value function) | $\mathbb{R}$ | $[0, \infty)$ |
$f(x) = \sin x$ | $\mathbb{R}$ | $[-1, 1]$ |
Notice a pattern worth carrying: $e^{x}$ and $\ln x$ are inverses, and their domains and ranges swap. That is not a coincidence, and it holds for every inverse function: the domain of $f$ becomes the range of $f^{-1}$, and the range of $f$ becomes the domain of $f^{-1}$. The periodic trigonometric functions have their own bounded ranges, covered in full at domain and range of trigonometric functions.
Why Does The Shadow Picture Of Domain And Range Work?
The cleanest way to see domain and range is as two shadows of the graph, and the picture explains every rule above.
The domain is the shadow on the $x$-axis. Shine a light straight down onto the curve; the stretch of the $x$-axis that lies in shadow is exactly the set of inputs the graph uses. A gap in that shadow is an excluded input, such as $x = 3$ for $\tfrac{1}{x-3}$.
The range is the shadow on the $y$-axis. Shine a light straight across onto the curve; the stretch of the $y$-axis in shadow is exactly the set of outputs. A height the curve never reaches, such as $y = 0$ for $\tfrac{1}{x-3}$, is a gap in that shadow.
Asymptotes and extrema mark the edges of the vertical shadow. A horizontal asymptote is a height the graph approaches but never lands on, so it bounds the range without belonging to it. A maximum or minimum found by $f'(x) = 0$ is the top or bottom edge of the shadow, which is why calculus reads the range straight off the graph.
This is also why the vertical line test matters. A function assigns one output per input, so every vertical line through the domain meets the graph exactly once, and the range is simply the collection of heights those single meetings produce. The relations and functions idea of "one input, one output" is what makes the two shadows well defined in the first place.
Who Shaped The Domain And Range Of A Function?
The idea that a function is defined by its set of inputs is younger than the word "function" itself. For a long time a function meant a formula; only later did mathematicians decide that the rule plus its domain was the real object.
Two earlier figures set the stage:
Gottfried Wilhelm Leibniz (1646–1716, Germany) coined the word "function" in the 1670s, first to describe quantities depending on a curve.
Leonhard Euler (1707–1783, Switzerland) introduced the notation $f(x)$ and pushed the idea of a function as a relationship between input and output, the language every domain and range problem still uses today.
Where Is The Domain And Range Of A Function Used In The Real World?
Domain and range are not just exam vocabulary; they are how models stay honest about what is possible.
Physics and motion: a projectile's height is a function of time, and its range (the set of reachable heights) tops out at the peak the derivative finds, then returns to the ground, the launch and landing bounding the domain.
Economics: a profit function only makes sense for a non-negative quantity produced, so the domain is $[0, \infty)$, and the maximum profit is the top of the range, located exactly where marginal profit is zero.
Biology: a population model with a carrying capacity has a bounded range, because the environment caps how large the population can grow no matter how much time passes.
Computer graphics and signals: a colour channel is clamped to the range $[0, 255]$ and an audio sample to a fixed interval, so any output outside that range is invalid and must be limited.
Engineering: a component has a safe operating domain (the inputs it tolerates) and a rated output range, and staying inside both is the whole job of a specification.
Across every one of these fields, the branch of mathematics that studies how outputs change and where they peak is calculus, which is why the range so often comes down to finding a maximum or a minimum.
What Are The Most Common Mistakes With Domain And Range Of A Function?
These four errors account for most lost marks, verified against the LibreTexts Common Mistakes pre-calculus page and the "which is $x$, which is $y$" confusion that recurs across Reddit's r/learnmath threads and Google's People-Also-Ask box.
Confusing the domain with the range.
Where it slips in:
A student is asked for the domain and reports the $y$-values the graph reaches, or answers a range question with the $x$-values, swapping inputs and outputs.
Don't do this:
Do not read the vertical extent when the question asks for the domain.
The correct way:
Fix the direction first. Domain is the horizontal shadow (allowable inputs $x$); range is the vertical shadow (resulting outputs $y$). Say "inputs" and "outputs" out loud before writing anything down.
Forgetting to restrict the range.
Where it slips in:
A student finds the domain correctly, then writes "all real numbers" for the range out of habit, missing that $x^2$ never goes below $0$ or that $\tfrac{1}{x-3}$ never equals $0$.
Don't do this:
Do not assume the range is every real number just because the domain nearly is.
The correct way:
Test the outputs. Square outputs are $\ge 0$; a non-zero fraction never reaches $0$; an exponential stays positive. Check the floor and ceiling before claiming the range is unbounded.
Getting the direction wrong on a root domain.
Where it slips in:
Solving $\sqrt{x - 2}$, a student writes $x \le 2$, flipping the inequality, or treats $\sqrt{64}$ as $\pm 8$ and invents extra outputs.
Don't do this:
Do not flip the inequality, and do not attach a $\pm$ to a principal square root.
The correct way:
Set the radicand $\ge 0$ and solve in that direction: $x - 2 \ge 0$ gives $x \ge 2$. The principal root symbol returns only the non-negative value, so $\sqrt{64} = 8$.
Using $\ge$ instead of $>$ when the root is in a denominator or a log.
Where it slips in:
For $\tfrac{1}{\sqrt{4 - x^2}}$ a student writes $4 - x^2 \ge 0$ and includes $x = \pm 2$, or for $\ln(x - 1)$ writes $x - 1 \ge 0$ and includes $x = 1$.
Don't do this:
Do not include the endpoint where the denominator becomes zero or the log argument becomes zero.
The correct way:
Make the inequality strict when a zero would break the function. A radical in a denominator needs radicand $> 0$; a logarithm needs its argument $> 0$. Division by zero and $\log 0$ are both undefined.
Practice Problems On Domain And Range Of A Function
Find the requested set for each function. Answers follow each line.
Domain of $f(x) = \sqrt{x + 5}$.
(Answer: $[-5, \infty)$; range $[0, \infty)$.)Domain of $f(x) = \dfrac{1}{x^2 - 9}$.
(Answer: $(-\infty, -3) \cup (-3, 3) \cup (3, \infty)$, since $x \ne \pm 3$.)Range of $f(x) = x^2 - 4$.
(Answer: $[-4, \infty)$; the minimum output is $-4$ at $x = 0$.)Domain of $f(x) = \ln(x - 1)$.
(Answer: $(1, \infty)$; the argument must be $> 0$.)Domain of $f(x) = \dfrac{1}{\sqrt{x - 1}}$.
(Answer: $(1, \infty)$; the radicand must be $> 0$ because it sits in a denominator.)Range of $f(x) = \dfrac{x}{x^2 + 1}$.
(Answer: $\left[-\tfrac{1}{2}, \tfrac{1}{2}\right]$, from $f'(x) = 0$ at $x = \pm 1$.)
Where Should You Go Next After Domain And Range Of A Function?
Domain and range are the gateway to the wider study of functions, and several natural doors open from here.
Function. Nail down the exact definition of a function (one input, one output) that makes domain and range well defined.
Types of functions. See how linear, quadratic, rational, exponential, and log functions each shape their own domain and range.
Domain and range of trigonometric functions. Extend the same skill to the periodic functions, where the range is bounded and the domain repeats.
If your child is building these foundations, a live Bhanzu trainer teaches domain and range starting from the "why" (the machine picture and the two shadows) before the notation, through the Bhanzu math tutor program.
Was this article helpful?
Your feedback helps us write better content
