Domain Calculator

Whether you're working through a tricky algebra problem or trying to make sense of a function for the first time, figuring out the domain is often the first real challenge. This calculator and guide are here to make that process straightforward. The domain of a function tells you exactly which input values are allowed. Get it wrong, and the rest of your work falls apart. Get it right, and everything else clicks into place. Use the sections below to understand what domain means, how to find it for different types of functions, and how to work through real examples step by step.

Enter Details

Result

Pick a function form to find its domain in interval notation.

Covers the most common single-term function forms with a linear inner expression ax + b.

What Is the Domain of a Function?

The domain of a function is the complete set of possible input values, usually represented by x, that produce a valid output. Think of a function as a machine: the domain is every value you're allowed to feed into it. Some values work fine. Others break the machine entirely.

In formal notation, if you have a function f(x), the domain is the set of all x values for which f(x) is defined and produces a real number. No undefined outputs, no imaginary results (unless you're working in complex number territory).

For a simple function like f(x) = 2x + 3, you can plug in any real number and get a perfectly valid answer. The domain is all real numbers, written as (-∞, ∞) in interval notation. But plenty of functions aren't that flexible. Division, square roots, and logarithms all introduce restrictions that shrink the domain down to a specific subset of real numbers.

Understanding domain is foundational. It shows up in graphing, calculus, applied math, and anywhere functions are used to model real situations.

How to Calculate Domain Step by Step

Finding the domain isn't guesswork. There's a reliable process you can follow for virtually any function.

  1. Start with all real numbers. Assume the domain is (-∞, ∞) and then look for reasons to exclude values.
  2. Identify any denominators. Set each denominator equal to zero and solve. Those x values are excluded from the domain.
  3. Identify any even roots (square roots, fourth roots, etc.). The expression under the radical must be greater than or equal to zero. Set it ≥ 0 and solve for x.
  4. Identify any logarithms. The argument of a log must be strictly greater than zero. Set it > 0 and solve.
  5. Combine your restrictions. Whatever values remain after excluding the problematic ones make up your domain.
  6. Write your answer. Use interval notation, set-builder notation, or a number line depending on what's required.

It helps to work through each type of restriction separately, then combine them at the end. If a function has both a fraction and a square root, handle each one on its own before putting the pieces together.

Domain vs Range Explained

Domain and range are two sides of the same coin, and it's easy to mix them up if you're not careful.

The domain is the set of all valid inputs: the x values you can put into a function. The range is the set of all possible outputs: the y values (or f(x) values) that come out the other side. If the domain is what you feed in, the range is what you get back.

ConceptDefinitionExample (f(x) = √x)
DomainAll valid input values (x)x ≥ 0, so [0, ∞)
RangeAll possible output values (f(x))f(x) ≥ 0, so [0, ∞)

For f(x) = √x, both the domain and range happen to be [0, ∞), but that's a coincidence of this particular function. Try something like f(x) = x²: the domain is all real numbers, but the range is only [0, ∞) because squaring any real number always gives a non-negative result.

When you're analyzing a function, always clarify which one you're being asked about. They require different approaches and often produce different answers.

Domain Restrictions (Fractions, Roots, Logs)

Most domain problems come down to three specific situations. Each one has a clear rule.

Fractions (Rational Functions)
You can never divide by zero. For any function with a variable in the denominator, set the denominator equal to zero and solve. Those solutions are removed from the domain.

Example: f(x) = 1/(x - 4). Setting x - 4 = 0 gives x = 4. The domain is all real numbers except 4, written as (-∞, 4) ∪ (4, ∞).

Square Roots and Even Roots
You can't take the square root of a negative number and get a real result. The expression inside an even-index radical must be zero or greater.

Example: f(x) = √(x + 5). Setting x + 5 ≥ 0 gives x ≥ -5. The domain is [-5, ∞).

Logarithms
The argument of any logarithm must be strictly positive. Log of zero is undefined, and log of a negative number doesn't produce a real value.

Example: f(x) = log(x - 2). Setting x - 2 > 0 gives x > 2. The domain is (2, ∞).

When a single function combines multiple restrictions, apply every rule and then take the intersection of all the resulting conditions. That intersection is your domain.

Find Domain of Algebraic Functions

Algebraic functions include polynomials, rational functions, and radical functions. Each behaves a little differently when it comes to domain.

Polynomials are the easiest case. Functions like f(x) = 3x³ - 2x + 7 have no restrictions at all. You can plug in any real number. Domain: all real numbers, (-∞, ∞).

Rational functions have a polynomial in the denominator, which creates restrictions. Factor the denominator completely, set each factor equal to zero, and exclude those values.

Example: f(x) = (x + 1) / (x² - 9). Factor the denominator: (x - 3)(x + 3) = 0, giving x = 3 and x = -3. Domain: all real numbers except ±3, or (-∞, -3) ∪ (-3, 3) ∪ (3, ∞).

Radical functions with even roots require the radicand to be non-negative. If the index is odd (like a cube root), there's no restriction since cube roots are defined for all real numbers.

Example: f(x) = ∛(x - 1). Cube root, so domain is all real numbers: (-∞, ∞).

Example: f(x) = √(4 - x²). Set 4 - x² ≥ 0, which means x² ≤ 4, so -2 ≤ x ≤ 2. Domain: [-2, 2].

Find Domain of Trigonometric Functions

Trig functions have their own domain quirks, and they come up constantly in precalculus and beyond.

Sine and Cosine are defined for all real numbers. No restrictions. Domain of sin(x) and cos(x): (-∞, ∞).

Tangent is where it gets interesting. Since tan(x) = sin(x)/cos(x), the function is undefined wherever cos(x) = 0. That happens at x = π/2 + nπ for any integer n. The domain excludes all those points.

Cotangent is undefined where sin(x) = 0, which is at x = nπ for any integer n.

Secant shares the same restricted values as tangent (undefined where cos(x) = 0). Cosecant shares the same restricted values as cotangent (undefined where sin(x) = 0).

FunctionDomain
sin(x), cos(x)All real numbers (-∞, ∞)
tan(x), sec(x)All real numbers except x = π/2 + nπ
cot(x), csc(x)All real numbers except x = nπ

For inverse trig functions, the domains are restricted by definition. arcsin(x) and arccos(x) only accept inputs between -1 and 1. arctan(x) accepts all real numbers.

Domain in Real-World Mathematical Problems

Domain isn't just an abstract math concept. It shows up any time you use a function to model something real, and in those cases, the domain often has to be narrowed down even further based on context.

Take a function that models the height of a projectile over time: h(t) = -16t² + 64t. Mathematically, you could plug in any real number for t. But physically, time can't be negative, and the projectile hits the ground at some point. So the realistic domain is restricted to the interval where t ≥ 0 and h(t) ≥ 0.

Another common example: revenue and cost functions in business math. If R(x) represents revenue from selling x units of a product, x has to be a non-negative integer. You can't sell -5 units or 3.7 units. The mathematical domain might be all real numbers, but the practical domain is the set of non-negative whole numbers.

When you're working with applied problems, always ask yourself two questions. First, what values does the math allow? Second, what values does the situation actually allow? The real domain is whichever set is more restrictive. Sometimes those match up perfectly. Often they don't.

Examples of Domain Calculations

Here are several worked examples covering different function types. Each one shows the full reasoning so you can see how the process plays out.

Example 1: Polynomial
f(x) = 5x² - 3x + 1
No fractions, no roots, no logs. Domain: (-∞, ∞).

Example 2: Rational Function
f(x) = (2x + 3) / (x² - 5x + 6)
Factor the denominator: (x - 2)(x - 3) = 0, so x = 2 and x = 3 are excluded.
Domain: (-∞, 2) ∪ (2, 3) ∪ (3, ∞).

Example 3: Square Root
f(x) = √(3x - 9)
Set 3x - 9 ≥ 0, so x ≥ 3.
Domain: [3, ∞).

Example 4: Logarithm
f(x) = ln(5 - x)
Set 5 - x > 0, so x < 5.
Domain: (-∞, 5).

Example 5: Combined Restrictions
f(x) = √(x + 2) / (x - 1)
From the square root: x + 2 ≥ 0, so x ≥ -2.
From the denominator: x ≠ 1.
Combine: x ≥ -2 and x ≠ 1.
Domain: [-2, 1) ∪ (1, ∞).

Working through a variety of examples is genuinely the fastest way to get comfortable with domain calculations. The more function types you practice, the quicker you'll spot the restrictions the moment you see a new problem.

Other Maths Calculators

Explore all