Math Solver Free

Domain and Range Calculator

Enter f(x) to get its domain and range in interval notation, with reasoning.

How to Find the Domain and Range of a Function

Every function comes with two questions: which inputs is it allowed to take, and which outputs can it produce? The domain answers the first — it is the set of all x-values a function can accept. The range answers the second — the set of all y-values it can produce. This calculator takes a function f(x) and works out both, showing the reasoning step by step. Three things can break a domain: division by zero, an even root of a negative number, and a logarithm of a non-positive number. Check for those three first, and most domain problems solve themselves.

The Definitions, Formally

Formally, the domain of f is the set {x ∈ ℝ | f(x) is defined}: every real x for which the rule produces an output. The range is {y ∈ ℝ | y = f(x) for some x in the domain} — the outputs actually hit, which can be smaller than you might first assume. This tool reports its answers in words and in interval notation: parentheses exclude an endpoint, brackets include it, and ∪ joins separate pieces, so “all real numbers except x = 2” is written (−∞, 2) ∪ (2, ∞). In set-builder notation that same answer reads {x | x ≠ 2}.

Interval Notation Basics

  • Parentheses ( ) exclude an endpoint: (2, 5) means 2 < x < 5.
  • Brackets [ ] include an endpoint: [0, ∞) means x ≥ 0.
  • Infinity always gets a parenthesis: (−∞, ∞) is the whole real line.

How to Use the Calculator

  1. Type your function into the single Function f(x) box, using x as the variable: write division as 1/(x-2), a square root as sqrt(x), and logs as ln(x) or log(x).
  2. Press Find Domain & Range. The Domain and Range lines appear in the results panel.
  3. Read the Reasoning steps underneath — they name the restriction that fired, such as “denominator must not equal zero”, so you can see why values were excluded.
  4. For unusual functions, confirm the range with a sketch, since the reasoning is symbolic for common forms.

Worked Example 1: f(x) = 1/(x − 2)

  1. Spot the restriction: the function divides by (x − 2), and division by zero is undefined.
  2. Exclude the bad value: set x − 2 = 0, giving x = 2. That single value is banned; every other real x works.
  3. Domain: (−∞, 2) ∪ (2, ∞).
  4. Range: the output is a fraction with numerator 1, so it can never equal 0 — no input makes 1 divided by something equal zero. As x approaches 2 the outputs shoot off to ±∞, and every other real value is hit exactly once.
  5. Range, concluded: (−∞, 0) ∪ (0, ∞). Notice the symmetry: the excluded input and the excluded output match.

Worked Example 2: f(x) = x² − 4x + 7

  1. Domain first: this is a polynomial — no division, no roots, no logarithms — so nothing restricts x. Domain: (−∞, ∞).
  2. Complete the square to find the vertex: x² − 4x + 7 = (x − 2)² + 3.
  3. Read the minimum: a square is always ≥ 0, so (x − 2)² + 3 ≥ 3, with equality at x = 2. Check: f(2) = 4 − 8 + 7 = 3. ✓
  4. Range: the parabola opens upward from its vertex (2, 3), so the range is [3, ∞). Spot-check the symmetry: f(0) = 7 and f(4) = 16 − 16 + 7 = 7, equal heights either side of x = 2. ✓

Range Strategies

For a parabola, complete the square to find the vertex — the range starts or ends there. For 1/x style rational functions, the range is everything except the horizontal asymptote value. When in doubt, sketch the graph: the range is simply how far the curve stretches vertically.

When Domain and Range Matter Outside Class

A programmer validating inputs for a pricing model needs to know exactly which values keep a formula defined, so the code can reject the rest instead of crashing. A physics student using t = √(2h/g) for a falling object needs h ≥ 0 before the formula means anything. Anyone plotting a function — in a spreadsheet, a graphing app, or a report — has to choose an x-window, and that choice is the domain. And inverse functions swap domain and range, so this analysis is the entry ticket to that whole topic.

Common Mistakes

  • Mixing up strict and non-strict inequalities. A radicand may equal zero, so square roots give ≥ and a bracket: [3, ∞). A logarithm's argument may not, so logs give > and a parenthesis. Swapping them flips whether the endpoint is included.
  • Forgetting the range has exclusions too. Students carefully ban x = 2 from 1/(x − 2) and then state the range as “all real numbers”, missing that y = 0 is never produced.
  • Giving every parabola the range (−∞, ∞). Only lines do that. A quadratic stops at its vertex value — find the vertex before claiming anything about the outputs.

Working with equations? Try our linear equation solver or the derivative calculator to locate maxima and minima.

Frequently Asked Questions

What is the domain of a function?

The domain is the set of all input values (x-values) for which the function produces a real output — formally, the set {x | f(x) is defined}. Three operations restrict it: a denominator cannot equal zero, the radicand of an even root cannot be negative, and the argument of a logarithm must be positive. Everything not excluded by those rules belongs to the domain.

What is the range of a function?

The range is the set of all output values (y-values) the function actually produces as x runs over the domain. Some functions reach every real number; others are bounded — a parabola stops at its vertex value, and a square root never drops below its starting height. Read off a graph, the range is the full vertical extent the curve covers.

How do you write domain in interval notation?

Use parentheses for endpoints that are excluded and square brackets for endpoints that are included: [0, ∞) means every x with x ≥ 0. Infinity always takes a parenthesis, never a bracket, because it is not a value that can be reached. When the domain splits into separate pieces, join them with the union symbol ∪, as in (−∞, 2) ∪ (2, ∞).

What is set-builder notation, and how does it differ from interval notation?

Set-builder notation describes a set by a rule, such as {x | x ≠ 2}, read as “the set of all x such that x is not equal to 2”. Interval notation describes the same set by its endpoints: (−∞, 2) ∪ (2, ∞). Both are correct. Intervals are quicker for continuous stretches, while set-builder handles conditions that endpoints alone cannot express neatly.

What is the domain and range of a square root function?

For f(x) = √(x − 3), the radicand must satisfy x − 3 ≥ 0, so the domain is [3, ∞). The principal square root is never negative, and it grows without bound as x grows, so the range is [0, ∞). Shifting the function shifts the answers: √(x − 3) + 2 keeps the same domain but its range becomes [2, ∞).

Is this domain and range calculator free?

Yes — every tool on Math Solver Free is free with no sign-up, and all calculations run in your browser. Type a function into the box above and you get its domain and range together with the reasoning steps that produced them, so the tool doubles as a checker for your own homework working, not just an answer machine.

Related Tools & Guides

About the MathSolverFree Team

The MathSolverFree Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team