Domain and range
The domain of a function is the set of x-values you can put in, and the range is the set of y-values you can get out. To find the domain, look for anything that would break the maths. To find the range, look at how high and low the output goes.
What domain and range mean
Think of a function as a machine. The domain is everything the machine accepts. The range is everything it can produce.
For f(x) = x², you can put in any number, so the domain is all real numbers. But squaring never gives a negative, so the range is y ≥ 0.
How to find the domain from an equation
Start with all real numbers, then remove anything that breaks one of these rules:
| Watch for | The rule | Example | Domain |
|---|---|---|---|
| Fractions | The bottom can’t be 0 | 1/(x − 3) | x ≠ 3 |
| Square roots | The inside can’t be negative | √(x − 2) | x ≥ 2 |
| Logarithms | The inside must be positive | ln(x + 1) | x > −1 |
If there is none of these, as with polynomials, sin x, cos x and eˣ, the domain is all real numbers.
Worked example: a fraction with a root
For f(x) = √(x + 4) / (x − 1): the root needs x + 4 ≥ 0, so x ≥ −4. The fraction needs x − 1 ≠ 0, so x ≠ 1. Both must hold, so the domain is x ≥ −4 with x ≠ 1, or [−4, 1) ∪ (1, ∞).
How to find the range from an equation
The range is usually harder, and there is no single recipe. These approaches work most of the time:
- Start from what you know. x² ≥ 0, so x² + 3 ≥ 3, and the range is y ≥ 3.
- Find the vertex of a parabola. Its y-value is the top or bottom of the range.
- Solve for x. For y = 1/(x − 3), rearranging gives x = 1/y + 3, which fails only at y = 0. So the range is y ≠ 0.
- Graph it. This is often the most reliable check.
How to find domain and range from a graph
Domain: squash the graph flat onto the x-axis. The part of the x-axis it covers is the domain. Range: squash it sideways onto the y-axis. The part it covers is the range.
- An arrow means the graph continues forever in that direction.
- A filled dot means that point is included. An open dot means it is not.
- A vertical asymptote means a gap in the domain. A horizontal one often means a gap in the range.
Interval notation
| Words | Inequality | Interval notation |
|---|---|---|
| All real numbers | −∞ < x < ∞ | (−∞, ∞) |
| x is at least 2 | x ≥ 2 | [2, ∞) |
| x is greater than 2 | x > 2 | (2, ∞) |
| x is between −1 and 3, including both | −1 ≤ x ≤ 3 | [−1, 3] |
| Everything except 3 | x ≠ 3 | (−∞, 3) ∪ (3, ∞) |
A square bracket includes the endpoint, and a round one excludes it. Infinity always gets a round bracket, because it isn’t a number you can reach.
Domain and range of common functions
Frequently asked questions
What is the domain of a function?
What is the range of a function?
How do you find the domain of a fraction?
How do you find the domain of a square root?
Which is x and which is y?
Can the domain and range be the same?
Keep going
Check your answer, with steps and a graph.
Why some values are missing from a function.
The basic graphs and their domains.
Where domain and range swap places.
See the domain and range at a glance.
How shifts change the domain and range.
Functions with a chosen domain on each piece.
Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.