Science & Maths

Domain and Range: How to Find Them from Graphs, Tables, and Equations

A hand-drawn blue curve on graph paper on a wooden desk, with a pencil and an open notebook beside it.

The domain of a function is the set of all x values, or inputs, that you can put into the function. The range is the set of all y values, or outputs, that the function can produce. To find the domain, ask which x values work. To find the range, ask which y values come out. This guide shows you how to find both from a graph, a table, a set of ordered pairs, or an equation, with worked examples for each method.

What Is Domain and Range?

Think of a function as a machine. You feed in an input, the machine does its work, and an output comes out. The domain is everything you are allowed to feed in. The range is everything that can possibly come out.

For f(x) = x + 2, any number works as an input: 3 gives 5, and -10 gives -8. So the domain and the range are both all real numbers.

For f(x) = x squared, any number works as an input, so the domain is all real numbers. But squaring never gives a negative result: 3 squared is 9, -3 squared is also 9, and 0 squared is 0. So the range is all numbers from 0 upward, written as y >= 0.

Remember three things. Domain means inputs: on a graph, look along the x axis, and in a pair (x, y) the domain value is the first number. Range means outputs: on a graph, look along the y axis, and in a pair (x, y) the range value is the second number. If a value would break the function, it is not in the domain: the two usual ways are dividing by zero and taking the square root of a negative number.

Interval Notation and Set Builder Notation

Once you know the domain and range, you need a way to write them down. The two standard ways are interval notation and set builder notation. Interval notation is shorter and is the most common choice in school maths.

In interval notation, a square bracket means the endpoint is included. A round bracket means the endpoint is not included. Infinity always takes a round bracket, because infinity is not a number you can reach. The smaller number always goes on the left and the larger number on the right.

Meaning Interval notation Set builder notation
All real numbers (-infinity, infinity) {x \ x is a real number}
x from 0 upward, including 0 [0, infinity) {x \ x >= 0}
x from -2 to 4, both included [-2, 4] {x \ -2 <= x <= 4}
All x except 3 (-infinity, 3) union (3, infinity) {x \ x is not equal to 3}

In set builder notation, {x | x >= 0} means "the set of all x such that x is greater than or equal to 0". The bar | is read as "such that". For a range, use y instead of x, as in {y | y >= 0}.

The union symbol joins two pieces: for f(x) = 1/x the domain is (-infinity, 0) union (0, infinity).

How to Find Domain and Range from a Graph

The domain is the horizontal spread of the graph, and the range is the vertical spread. Scan left to right for the domain and bottom to top for the range.

A solid dot means the point is included, so use a square bracket. An open circle means it is not, so use a round bracket. An arrow means the graph keeps going forever in that direction.

Worked example 1: a line segment

A line segment runs from (-2, 1) to (4, 5), with solid dots at both ends. The smallest x value is -2 and the largest is 4, both included. The smallest y value is 1 and the largest is 5.

  • Domain: [-2, 4]
  • Range: [1, 5]

Worked example 2: a parabola

A parabola opens upward with its lowest point, the vertex, at (1, -2). Both arms rise forever. The graph covers every x value, so the domain is all real numbers. The lowest y value is -2, at the vertex, and the graph rises from there without stopping.

  • Domain: (-infinity, infinity)
  • Range: [-2, infinity)

The vertex sets the range: if the parabola opens upward, the range starts at the vertex y value and goes up; if it opens downward, it ends there and goes down.

Worked example 3: a square root graph

A square root graph starts at the point (-3, 0), marked with a solid dot, and curves up and to the right forever. The graph begins at x = -3 and never goes further left. It begins at y = 0 and rises without stopping.

  • Domain: [-3, infinity)
  • Range: [0, infinity)

How to Find Domain and Range from a Table and Ordered Pairs

An open notebook with a straight diagonal line drawn on grid paper, with a pencil and a calculator on a wooden desk.

The domain is the list of first numbers, and the range is the list of second numbers. List each value only once, even if it appears more than once.

Worked example: a table

x -2 -1 0 1 2
y 4 1 0 1 4

The x values are -2, -1, 0, 1, and 2. The y values are 4, 1, 0, 1, and 4, but 4 and 1 are each listed once in the range.

  • Domain: {-2, -1, 0, 1, 2}
  • Range: {0, 1, 4}

This table shows f(x) = x squared for five inputs; -2 and 2 both square to 4, which is why 4 appears twice in the table but once in the range.

Worked example: ordered pairs

For the set of points {(1, 4), (2, 7), (3, 4), (5, 0)}, take the first number from each pair for the domain and the second number from each pair for the range.

  • Domain: {1, 2, 3, 5}
  • Range: {0, 4, 7}

Note that 4 is the y value for both x = 1 and x = 3. That is fine: a function can send two inputs to the same output. But one input cannot have two outputs, so if the same x value is paired with two different y values, the set is not a function.

How to Find Domain and Range from an Equation

A whiteboard in a bright classroom showing a curved graph rising from the origin on a grid, with desks and a potted plant behind it.

With an equation and no graph, work by elimination. Assume the domain is all real numbers, then look for the two things that can break a function: a denominator that can equal zero, and a square root of a negative number. The range depends on the shape of the function.

Linear functions

A linear function has the form f(x) = mx + b. There is no denominator with x in it and no square root, so nothing can break, and a line that is not flat goes up forever in one direction and down forever in the other.

Worked example: f(x) = 2x + 3.

  • Domain: all real numbers, (-infinity, infinity)
  • Range: all real numbers, (-infinity, infinity)

A flat line such as f(x) = 4 is the exception: its range is just {4}.

Quadratic functions

A quadratic has the form f(x) = ax squared + bx + c. Any x value works, so the domain is all real numbers. The range depends on the vertex, the lowest or highest point.

Worked example: f(x) = x squared – 4. The vertex is at (0, -4), since x squared is smallest at x = 0. The parabola opens upward, so -4 is the smallest output.

  • Domain: (-infinity, infinity)
  • Range: [-4, infinity)

Worked example: f(x) = -x squared + 5. The minus sign makes it open downward. The vertex is at (0, 5), and 5 is the largest output.

  • Domain: (-infinity, infinity)
  • Range: (-infinity, 5]

Square root functions

The number inside the square root must be zero or positive, because the square root of a negative number is not a real number. Set the inside to be greater than or equal to zero and solve.

Worked example: f(x) = square root of x. The inside is x, so x >= 0. The square root symbol always means the non negative root, so the outputs are also zero or positive.

  • Domain: [0, infinity)
  • Range: [0, infinity)

Worked example: f(x) = square root of (x – 3) + 1. Set x – 3 >= 0, so x >= 3. At x = 3 the output is 0 + 1 = 1, the smallest value.

  • Domain: [3, infinity)
  • Range: [1, infinity)

Rational functions

A rational function is a fraction with x in the denominator. The denominator cannot be zero: set it equal to zero, solve for x, and exclude those values from the domain.

Worked example: f(x) = 1/x. The denominator is x, so x cannot be 0. The output can never be 0 either, because 1 divided by any number is never 0.

  • Domain: (-infinity, 0) union (0, infinity)
  • Range: (-infinity, 0) union (0, infinity)

Worked example: f(x) = 1/(x + 2). Set x + 2 = 0, so x = -2 is excluded. The output can never be 0.

  • Domain: all real numbers except -2, written (-infinity, -2) union (-2, infinity)
  • Range: all real numbers except 0, written (-infinity, 0) union (0, infinity)

The numerator changes nothing. For f(x) = 3/(x – 1), x = 1 is excluded, so the domain is all real numbers except 1 and the range is all real numbers except 0.

Combined restrictions

Some functions have two restrictions at once. For h(x) = 1 / square root of (x – 5), the inside of the root must be zero or positive and the denominator must not be zero. If x – 5 were 0, the denominator would be 0. So x – 5 must be greater than 0, which means x > 5.

  • Domain: (5, infinity)
  • Range: (0, infinity)

The range is (0, infinity): as x grows, the output shrinks toward 0 without reaching it.

Worked Examples at a Glance

Function Domain Range
f(x) = 2x + 3 (-infinity, infinity) (-infinity, infinity)
f(x) = x squared (-infinity, infinity) [0, infinity)
f(x) = x squared – 4 (-infinity, infinity) [-4, infinity)
f(x) = -x squared + 5 (-infinity, infinity) (-infinity, 5]
f(x) = square root of x [0, infinity) [0, infinity)
f(x) = square root of (x – 3) + 1 [3, infinity) [1, infinity)
f(x) = 1/x (-infinity, 0) union (0, infinity) (-infinity, 0) union (0, infinity)
f(x) = 1/(x + 2) (-infinity, -2) union (-2, infinity) (-infinity, 0) union (0, infinity)

Most textbook problems use one of these forms, or a shifted version of one.

Common Mistakes

  • Swapping domain and range. Domain is x, the input. Range is y, the output.
  • Using a square bracket with infinity. Infinity always takes a round bracket: [0, infinity), never [0, infinity].
  • Listing a repeated value twice. Each domain or range value is listed once, even if it appears several times.
  • Forgetting the restriction. For f(x) = 1/(x – 4), x = 4 makes the denominator zero, so it must be excluded.
  • Forgetting that the square root symbol means the non negative root, so the range of f(x) = square root of x is [0, infinity), not all real numbers.
  • Reading the range off the x axis. The range is the vertical spread.
  • ## Practice Questions

Try these, then check your answers below.

  1. Find the domain and range of f(x) = x squared + 1.
  2. Find the domain and range of g(x) = square root of (x + 4).
  3. Find the domain and range of h(x) = 3/(x – 1).
  4. Find the domain and range of the set of points {(-3, 2), (-1, 2), (0, 5), (2, 5)}.
  5. A graph is a line segment from (-1, -2), marked with a solid dot, to (3, 4), marked with an open circle. Find its domain and range.

Answers

  1. Domain: (-infinity, infinity). Range: [1, infinity). The vertex is (0, 1) and the parabola opens upward.
  2. Domain: [-4, infinity). Range: [0, infinity). The inside, x + 4, must be zero or positive, so x >= -4.
  3. Domain: (-infinity, 1) union (1, infinity). Range: (-infinity, 0) union (0, infinity). The denominator is zero when x = 1, and 3 divided by a number is never 0.
  4. Domain: {-3, -1, 0, 2}. Range: {2, 5}. Each value is listed once, even though 2 and 5 each appear twice as outputs.
  5. Domain: [-1, 3). Range: [-2, 4). The solid dot means -1 and -2 are included. The open circle means 3 and 4 are not.

Frequently Asked Questions

What is the difference between domain and range?

The domain is the set of inputs, or x values, a function accepts. The range is the set of outputs, or y values, it produces. For x squared, the domain is all real numbers and the range is y >= 0.

How do you find the domain of a function from a graph?

Scan left to right along the x axis. The leftmost and rightmost x values the graph reaches give the domain. A solid dot means the endpoint is included, an open circle means it is not, and an arrow means the graph continues forever.

What is the domain of a square root function?

For f(x) = square root of x, the domain is [0, infinity), because the number inside the root must be zero or positive. For f(x) = square root of (x – 3), set x – 3 >= 0, so x >= 3, and the domain is [3, infinity).

Can the domain and range be the same?

Yes. For f(x) = 2x + 3, both are all real numbers. For f(x) = 1/x, both are all real numbers except 0. But they are often different: f(x) = x squared has domain all real numbers and range [0, infinity).

How do you write domain in interval notation?

Use a square bracket when the endpoint is included and a round bracket when it is not, with the smaller number on the left. Infinity always takes a round bracket. So x from 0 upward, including 0, is [0, infinity).

Conclusion

Domain is the inputs a function accepts, and range is the outputs it produces. From a graph, read the domain left to right and the range bottom to top, watching for solid dots, open circles, and arrows. From a table or a set of points, list the first numbers for the domain and the second numbers for the range, each once. From an equation, start with all real numbers and remove anything that breaks the function: values that make a denominator zero, and values that put a negative number inside a square root. For the range, use the shape of the function: a parabola vertex, a square root starting point, or values a fraction never reaches. Work through the practice questions above, and finding domain and range will soon feel routine.