Domain of a Function Calculator – Step-by-Step with Interval Notation

Domain of a Function Calculator D = {x ∈ ℝ | f(x) is defined}

Enter a function f(x) to find its domain D in interval notation. The calculator lists every restriction (denominator ≠ 0, radicand ≥ 0, log argument > 0, tan/cot), solves each one with a sign chart, intersects them and draws the result on a number line.

📚 Pick a function type to see its rule:

💡 Syntax: sqrt(x) or √x, x^2, abs(x) or |x|, log_2(x), ln(x), log(x) (base 10), pi or π; you may write 2x instead of 2*x.

🎯 Domain Quiz

Question 1: The domain of y = (x + 1)/(x − 3) is:

Question 2: The domain of y = √(2x − 6) is:

Question 3: The domain of y = tan x is:

Finding the domain of a function is the first step in almost every function problem in algebra, precalculus and calculus: before you study monotonicity, find extrema, evaluate limits or solve equations, you must know for which values of x the function is defined. The calculator above accepts any function built from fractions, roots, trigonometric functions, logarithms and powers. It lists every restriction, solves each one with a sign chart, intersects the solution sets and draws the domain on a number line, giving the answer in interval notation. Click a function-type card to see its rule, use the symbol keyboard to type roots, powers and logs, or click an example button to see a worked solution.

Number line of the domain [2, 5) ∪ (5, ∞): shading starts at a closed dot at 2 and runs to the right, with an open dot at 5.−1012345678[D = [2, 5) ∪ (5, ∞)
Domain of y = √(3x − 6) + 1/(x − 5) on a number line: a closed dot at 2 because 3x − 6 ≥ 0 allows x = 2, and an open dot at 5 because the denominator x − 5 must not be 0.

📚 What is the domain of a function?

Let y = f(x) be given by a formula. The domain D of the function is the set of all real numbers x for which f(x) is defined:

D = {x ∈ ℝ | f(x) is defined}

When only a formula is given, the domain is understood to be the largest set of real numbers for which every operation in the formula can be carried out (the natural or implied domain). Addition, subtraction, multiplication and the functions sin, cos, eˣ work for every real number, so a polynomial such as y = x³ − 2x + 1 has domain (−∞, ∞). Only four things can make a real function undefined: division by zero, an even root of a negative number, the logarithm of a number that is not positive, and tan or cot where cos or sin equals zero.

The inequalities and “not equal” conditions that rule out these cases are called domain restrictions. Finding the domain means writing every restriction, solving the system, and writing the solution set in interval notation.

📐 Domain rules at a glance

ExpressionRestrictionExample
Fraction A(x)/B(x)B(x) ≠ 0y = 1/(x − 2): (−∞, 2) ∪ (2, ∞)
Square root √A(x)A(x) ≥ 0y = √(x − 1): [1, ∞)
Root in a denominator A(x)/√B(x)B(x) > 0y = 1/√(x − 1): (1, ∞)
Cube root ∛A(x)A(x) definedy = ∛(x − 1): (−∞, ∞)
Logarithm log_b A(x), 0 < b ≠ 1A(x) > 0y = ln(x + 3): (−3, ∞)
tan u(x)u(x) ≠ π/2 + kπy = tan x: x ≠ π/2 + kπ
cot u(x)u(x) ≠ kπy = cot x: x ≠ kπ
Power xʳpositive integer r: all reals; r a negative integer or 0: x ≠ 0; r not an integer: x > 0y = x⁻²: (−∞, 0) ∪ (0, ∞)

When a function contains several of these pieces, write all the restrictions and intersect them. One piece can create two restrictions: 1/log₂ x needs both x > 0 (the log is defined) and log₂ x ≠ 0 ⟺ x ≠ 1 (the denominator is not zero).

A note on non-integer powers: many textbooks, and this calculator, define xʳ with a non-integer exponent only for x > 0, so x^(1/3) has domain (0, ∞) while the cube root ∛x is defined for all real x. If your course treats x^(1/3) as the cube root, enter it as cbrt(x) or ∛x.

🔢 How to find the domain in 4 steps

  1. Spot the dangerous parts of the formula: denominators, even roots, logarithms, tan, cot, and powers with negative or non-integer exponents.
  2. Write one restriction for each part; don’t miss denominators hidden inside a root or a logarithm.
  3. Solve each restriction: solve B(x) = 0 to find excluded points, solve linear, quadratic or rational inequalities with a sign chart, and solve trigonometric restrictions with the general solution in k ∈ ℤ.
  4. Intersect the solution sets (a number line helps) and write the domain in interval notation or set-builder notation.

The calculator’s solution follows exactly these steps: the “Domain conditions” block lists the system, the “Solve each condition” block shows the equivalent transformations and sign charts, and the result ends with a number line and the final interval. The function-type cards get a ✓ to show which types your function contains.

➗ Type 1. Rational functions: the denominator is not zero

Example 1. Find the domain of y = (2x − 1)/(x² − 4).

  • Restriction: x² − 4 ≠ 0 ⟺ x ≠ ±2.
  • Domain: (−∞, −2) ∪ (−2, 2) ∪ (2, ∞), also written ℝ \ {−2, 2}.

The numerator plays no role: at x = 1/2 the function is defined and equals 0. If the denominator is a quadratic with no real roots, such as x² + x + 1 (discriminant −3 < 0), it is never zero and the domain is all real numbers. This is the “Ex1” button in the calculator.

√ Type 2. Radical functions: the radicand is non-negative

Example 2. Find the domain of y = √(3x − 6) + 1/(x − 5).

  • Restrictions: 3x − 6 ≥ 0 and x − 5 ≠ 0 ⟺ x ≥ 2 and x ≠ 5.
  • Domain: [2, 5) ∪ (5, ∞) — the number line at the top of this page, with a closed dot at 2 (included) and an open dot at 5 (excluded).

Example 3. Find the domain of y = √((x − 1)/(x + 2)).

Restriction: (x − 1)/(x + 2) ≥ 0 (this already forces x + 2 ≠ 0). Build a sign chart with the zero of the numerator at x = 1 and the zero of the denominator at x = −2:

x(−∞, −2)−2(−2, 1)1(1, ∞)
(x − 1)/(x + 2)+undefined−0+

So the domain is (−∞, −2) ∪ [1, ∞): x = 1 is included because the radicand equals 0 there, while x = −2 is excluded because the denominator is 0. A very common mistake is to split the condition into x − 1 ≥ 0 and x + 2 > 0, which loses the interval (−∞, −2).

Example 4. y = 1/√(4 − x²): the root is in the denominator, so 4 − x² > 0 ⟺ −2 < x < 2 and the domain is (−2, 2).

∿ Type 3. Trigonometric functions: tan, cot and sin/cos in denominators

y = sin x and y = cos x are defined for every real number. Because tan x = sin x / cos x and cot x = cos x / sin x, these two functions are really fractions and need a non-zero denominator.

Example 5. Find the domain of y = tan(2x − π/3).

  • Restriction: cos(2x − π/3) ≠ 0 ⟺ 2x − π/3 ≠ π/2 + kπ.
  • ⟺ 2x ≠ 5π/6 + kπ ⟺ x ≠ 5π/12 + kπ/2, k ∈ ℤ.
  • Domain: {x ∈ ℝ | x ≠ 5π/12 + kπ/2, k ∈ ℤ}.

When you divide by the coefficient 2, the period term kπ is divided too and becomes kπ/2 — forgetting this is the most common error with this type. An infinite family of excluded points cannot be listed as a finite union of intervals, so set-builder notation is the standard way to write the answer.

Example 6. y = 1/(2cos x − 1) needs cos x ≠ 1/2 ⟺ x ≠ ±π/3 + 2kπ. For y = tan x + cot x, the two restrictions cos x ≠ 0 and sin x ≠ 0 combine into sin 2x ≠ 0 ⟺ x ≠ kπ/2; the calculator merges overlapping families like this automatically.

📈 Type 4. Logarithmic functions: the argument is positive

Example 7. Find the domain of y = log₂(x² − 3x + 2).

  • Restriction: x² − 3x + 2 > 0. The quadratic has roots x = 1 and x = 2 and leading coefficient 1 > 0, so it is positive outside the roots.
  • ⟺ x < 1 or x > 2. Domain: (−∞, 1) ∪ (2, ∞).

Example 8. y = ln x + √(2 − x) needs x > 0 and 2 − x ≥ 0, so the domain is (0, 2].

Example 9. y = √(x + 1)/log(3 − x) has three restrictions: x + 1 ≥ 0, 3 − x > 0 and log(3 − x) ≠ 0 ⟺ x ≠ 2. Intersecting them gives [−1, 2) ∪ (2, 3).

📏 Writing the domain in interval notation

  • Use a square bracket [ or ] when an endpoint is included (≥, ≤) and a parenthesis ( or ) when it is excluded (>, <, ≠). Infinity always gets a parenthesis: [2, ∞).
  • Join separate pieces with the union sign ∪. Single excluded points can also be removed with a set difference, e.g. [2, ∞) \ {5} is the same set as [2, 5) ∪ (5, ∞); the calculator shows both forms.
  • On a number line, a closed dot marks an included point, an open dot an excluded one, and the shaded part is the domain. Set-builder notation, {x | x ≥ 2, x ≠ 5}, is also correct and is the natural choice for infinite families of excluded points.

🎓 Checking with a calculator

Casio fx-991EX / fx-991CW (ClassWiz): to solve a quadratic restriction such as x² − 3x + 2 > 0, press MENU, choose Inequality, pick degree 2 and the “> 0” form, and enter 1, −3, 2; the calculator answers x < 1, 2 < x. To find the zeros of a denominator use MENU → Equation/Func → Polynomial. To double-check a domain, open Table mode, enter f(x) and step through x values: where x is outside the domain the table shows ERROR instead of a number. A graphing calculator or Desmos shows the same thing as gaps or vertical asymptotes in the graph.

Calculators are only for checking; on a written test you still need to show the restrictions and the algebra, as in the calculator’s solution.

⚠️ Common mistakes

  1. Forgetting the denominator when a function has both a root and a fraction, or missing a denominator inside a root or a logarithm.
  2. Using the wrong inequality: a root in the numerator needs ≥ 0, a root in the denominator needs > 0, and a logarithm always needs > 0 (never ≥).
  3. Splitting a quotient incorrectly: A/B ≥ 0 is not the same as “A ≥ 0 and B > 0”; both sign cases must be considered.
  4. Not dividing kπ when solving tan or cot restrictions with u(x) = ax + b.
  5. Excluding zeros of the numerator in a rational function.
  6. Simplifying before finding the domain: y = (x² − 1)/(x − 1) has domain ℝ \ {1}, even though it simplifies to y = x + 1.
  7. Putting a bracket next to infinity or using a bracket at an excluded point.

❓ Frequently asked questions (FAQ)

What is the difference between the domain and the range of a function?

The domain is the set of input values x for which the function is defined; the range is the set of output values y that the function actually takes. For y = √(x − 1) the domain is [1, ∞) and the range is [0, ∞). This calculator finds the domain; the range usually requires studying the function’s behaviour, for example with derivatives.

Why should I check the domain before solving an equation with a square root?

Because squaring both sides can create extraneous solutions. For √(x − 1) = x − 3, the domain needs x ≥ 1 and the right side must be non-negative, so x ≥ 3. Squaring gives x − 1 = x² − 6x + 9, i.e. x² − 7x + 10 = 0, with roots x = 2 and x = 5. x = 2 satisfies x ≥ 1 but makes the right side −1, so it is rejected; the only solution is x = 5. Besides the domain, add a sign condition for the other side or check every root.

Are all trigonometric functions defined for every real number?

No. sin x and cos x are defined for all real x, but tan x needs cos x ≠ 0, i.e. x ≠ π/2 + kπ, and cot x needs sin x ≠ 0, i.e. x ≠ kπ (k an integer). Any function with sin or cos in a denominator also needs that denominator to be non-zero; for example y = 1/sin x has domain {x | x ≠ kπ, k ∈ ℤ}.

Is a square root in the denominator > 0 or ≥ 0?

Strictly greater than 0. The radicand must be ≥ 0 for the root to exist, and the root in the denominator must also be non-zero, so together the condition is > 0. For example y = 1/√(x − 2) has domain (2, ∞), while y = √(x − 2) has domain [2, ∞).

How do I write a domain in interval notation?

Use square brackets for included endpoints, parentheses for excluded endpoints and always parentheses next to ∞ or −∞. Join separate pieces with ∪. For example x ≥ 2 with x ≠ 5 is written [2, 5) ∪ (5, ∞), and all real numbers except −2 and 2 is (−∞, −2) ∪ (−2, 2) ∪ (2, ∞).

Can I simplify a function before finding its domain?

No. The domain must be found from the original formula. y = (x² − 1)/(x − 1) simplifies to y = x + 1, but the original function is undefined at x = 1, so its domain is (−∞, 1) ∪ (1, ∞), not all real numbers. Its graph is the line y = x + 1 with a hole at (1, 2).

🔗 Related tools