Domain and Range Calculator

A function’s domain tells you which x‑values you can plug into an expression without breaking it. The range shows the possible y‑outputs you get back. Enter your function below to see both instantly, complete with a graph and step‑by‑step reasoning.

Function Input Use x as the variable. Examples: x**2 - 4, 1/(x-2), sqrt(x+1), log(x), sin(x), exp(x).

What Is Domain and Range?

Every function has an input‑output relationship. The domain is the set of all real numbers that work as inputs. The range is the collection of all outputs the function actually produces. If you think of a function as a machine, the domain is what you can safely feed it, and the range is what comes out.

For example:

  • f(x) = x² − 4 Domain: all real numbers (you can square anything). Range: y ≥ −4 because the smallest value the square gives is 0, then subtract 4.

  • g(x) = 1 / (x − 2) Domain: x ≠ 2 (division by zero is undefined). Range: y ≠ 0 (a fraction can never equal zero).

  • h(x) = √(x + 1) Domain: x ≥ −1 (inside the square root must be non‑negative). Range: y ≥ 0 (square roots always give non‑negative results).

How to Find Domain Algebraically

The calculator above applies the same logic you would use by hand. It checks three restrictions:

  1. Denominators cannot be zero – solve denominator = 0 and exclude those x’s.
  2. Even‑indexed roots must have a non‑negative radicand – set the inside ≥ 0.
  3. Logarithms (and ln) require a positive argument – set the inside > 0.

For more complex functions, the tool also considers inverse operations, piecewise definitions, and trigonometric constraints. The final domain is the intersection of all allowed intervals.

Understanding Range Through Graphs

While domain often follows straightforward algebraic rules, range usually needs a look at the function’s shape. The calculator plots the graph and reads the vertical extent automatically. Manually, you would:

  • Find the minimum and maximum y-values from the graph.
  • Check for horizontal asymptotes (lines the function approaches but never touches).
  • Identify any gaps or jumps.

For instance, the range of f(x) = eˣ is (0, ∞) because exponential growth never hits zero.

When to Use This Calculator

The tool saves time when you face functions with multiple parts, logarithms, trigonometric expressions, or nested radicals. Instead of solving inequalities by hand, you get an instant result and a visual confirmation.

It’s particularly helpful if you’re:

  • Checking homework or exam answers.
  • Preparing a graph without using a full CAS system.
  • Learning how domain restrictions affect a function’s behavior.
  • Working with functions that mix polynomial, rational, and transcendental elements.

Tips for Reading the Output

The calculator shows domain and range in interval notation and set‑builder notation. A closed bracket [ means the endpoint is included, a parenthesis ( means it’s not. Infinity is always open. For example, (−2, 5] means x > −2 but x ≤ 5. The graph highlights the valid input and output regions in different colors.

Remember that the tool interprets functions in standard mathematical form. Use ** for exponents, sqrt() for square roots, and log() for base‑10 logs. Trigonometric functions like sin(x) and cos(x) are recognized with radian arguments unless you specify deg.

Disclaimer: This calculator provides general mathematical results. For critical applications, verify manually or consult a qualified mathematician.

Frequently Asked Questions

What is the domain of a function?
The domain is the set of all possible input values (x) for which the function is defined and produces a real output. It excludes values that cause division by zero or the square root of a negative number.
What is the range of a function?
The range is the set of all output values (y) the function can produce by substituting every valid x from the domain. It depends on the function’s behavior, such as minimums, maximums, and asymptotes.
How do you find the domain of a rational function?
Set the denominator equal to zero and solve for x. The domain is all real numbers except those solutions. For example, f(x)=1/(x-3) has domain x ≠ 3.
Why is the domain important in mathematics?
Knowing the domain ensures you only use inputs that give real, meaningful outputs. It’s essential for graphing, solving equations, and applying functions in real‑world contexts like physics or engineering.
Can a function have an empty domain?
Yes, if no real input makes the expression valid–for instance f(x)=√(-x²-1) has no real domain because -x²-1 is always negative under a square root.
How does the calculator handle composite functions?
The tool evaluates the innermost function’s range, then checks which of those values are valid inputs for the outer function, using the same domain rules step by step.
Is the domain always all real numbers for polynomial functions?
Yes, polynomials like f(x)=x³+2x-5 have no denominators or even‑root restrictions, so their domain is all real numbers (-∞, ∞). Their range may be limited if the degree is even.
Do logarithmic functions have special domain restrictions?
Logarithms (log, ln) are defined only for positive arguments. So for f(x)=log(x-2), the domain is x > 2 because the inside expression must be greater than zero.
  1. X Intercept Calculator
  2. Percentage Growth Calculator
  3. Percentage Difference Calculator - Free Online
  4. Calculate Weighted Average, Online Calculator
  5. Calculator for Surds
  6. Cube Root Calculator