Skip to content
ihateDesmos

Domain and range

8 min read · Updated 6 November 2026

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.

−224240
Open in calculator
y=x2
accepts every x, but only outputs y ≥ 0.
y=√x
only accepts x ≥ 0.

How to find the domain from an equation

Start with all real numbers, then remove anything that breaks one of these rules:

Watch forThe ruleExampleDomain
FractionsThe bottom can’t be 01/(x − 3)x ≠ 3
Square rootsThe inside can’t be negative√(x − 2)x ≥ 2
LogarithmsThe inside must be positiveln(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:

  1. Start from what you know. x² ≥ 0, so x² + 3 ≥ 3, and the range is y ≥ 3.
  2. Find the vertex of a parabola. Its y-value is the top or bottom of the range.
  3. 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.
  4. 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.
−4−2246850
Open in calculator
y=1x−2+1
never touches x = 2 or y = 1, so its domain is x ≠ 2 and its range is y ≠ 1.

Interval notation

WordsInequalityInterval notation
All real numbers−∞ < x < ∞(−∞, ∞)
x is at least 2x ≥ 2[2, ∞)
x is greater than 2x > 2(2, ∞)
x is between −1 and 3, including both−1 ≤ x ≤ 3[−1, 3]
Everything except 3x ≠ 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

FunctionDomainRange
mx + b (m ≠ 0)All real numbersAll real numbers
x²All real numbersy ≥ 0
√xx ≥ 0y ≥ 0
1/xx ≠ 0y ≠ 0
|x|All real numbersy ≥ 0
eˣAll real numbersy > 0
ln xx > 0All real numbers
sin x, cos xAll real numbers−1 ≤ y ≤ 1
tan xx ≠ π/2 + nπAll real numbers

Frequently asked questions

What is the domain of a function?
All the x-values you can put in and get a real output.
What is the range of a function?
All the y-values the function can actually produce.
How do you find the domain of a fraction?
Set the bottom equal to zero and solve. Those x-values are excluded, and everything else is in the domain.
How do you find the domain of a square root?
Set the inside greater than or equal to zero, and solve.
Which is x and which is y?
Domain goes with x, the input, and range goes with y, the output. In alphabetical order, domain comes before range, just as x comes before y.
Can the domain and range be the same?
Yes. For y = x and y = 1/x, each one matches: all real numbers, and everything except 0.

Keep going

Try it in the calculator

Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.

Open the calculator