Step-by-Step Math Tutorials · 9 min read

How to find the domain of a function, with worked examples

To understand how to find the domain of a function, identify inputs that make its formula undefined over the real numbers. Exclude zeros of denominators, negative even-root inputs, and nonpositive logarithm arguments when those forms appear.

Number line for the domain of √x/(x − 5): a closed dot at 0 and an open dot at 5, shaded from 0 to the right except at 5, beside the conditions x ≥ 0 and x − 5 ≠ 0.

What the domain of a function means

A function takes an input x and returns an output. The domain is every x for which that output is a real number. A polynomial such as x2+3xx^2 + 3x never breaks, so its domain is all real numbers, written (−∞,∞)(-\infty, \infty).

Other formulas have gaps. Division by zero is undefined, the square root of a negative number is not real, and ln⁡(0)\ln(0) does not exist. Finding a domain means listing those gaps and nothing more.

The natural domain

Unless a problem says otherwise, the domain is the largest set of real numbers the formula accepts. A word problem can shrink it further — a length cannot be negative — but that is a separate restriction you add on top.

How to find the domain of a function in three checks

  1. Denominators: set each denominator equal to zero, solve, and exclude those values.
  2. Even roots: the expression under a square root (or a fourth root) must be at least 0. If the root sits in a denominator, it must be greater than 0.
  3. Logarithms: the input of every log or ln must be greater than 0.

Each check produces one condition. The domain is where all of the conditions hold at the same time, so the last step is to intersect them: keep only the x-values that pass every test.

Functions built only from polynomials, sine, cosine, exponentials and absolute values pass all three checks automatically. Their domain is every real number, which is why a quick scan for fractions, roots and logs is the first thing to do.

Denominators: remove the values that give zero

For a fraction, solve "denominator = 0" and take those values out. In 1x2−4\frac{1}{x^2 - 4} the denominator factors as (x−2)(x+2)(x - 2)(x + 2), so x cannot be 2 or −2. Every other real number is allowed.

In interval notation that domain is three pieces joined by the union symbol: (−∞,−2)∪(−2,2)∪(2,∞)(-\infty, -2) \cup (-2, 2) \cup (2, \infty). Every bracket is round, because the excluded values are never part of the set.

A denominator with no real zeros removes nothing. Since x2+1x^2 + 1 is at least 1 for every x, the domain of 1x2+1\frac{1}{x^2 + 1} is all real numbers.

Example 1 · Two values removed by a denominator

domain of 1x2−4\text{domain }\allowbreak \text{of } \frac{1}{x^{2} - 4}
Solve it live

Setting x² − 4 = 0 gives x = −2 and x = 2, and both are excluded. The check evaluates the function at both values and at points on either side of them.

  1. List what each part needs
    x2−4≠0x^{2}-4 \ne 0
    A denominator cannot be 0.
  2. Solve where it is 0
    x2−4≠0 ⇒ x≠−2, x≠2\displaystyle x^{2}-4 \ne 0\ \Rightarrow\ x \ne -2,\allowbreak \ x \ne 2
    Those values are removed.
  3. Keep the values where every part works
    x≠−2,x≠2(−∞,−2)∪(−2,2)∪(2,∞)\displaystyle x \ne -2,\allowbreak x \ne 2\qquad (-\infty, -2) \cup (-2, 2) \cup (2, \infty)
    The domain is where all the conditions hold at once, shown again in interval notation.
x≠−2,x≠2\displaystyle x \ne -2,\allowbreak x \ne 2
✓ Verified

Square roots: the inside must not be negative

An even root needs an inside that is not negative, so its condition is an inequality rather than an equation. For 6−2x\sqrt{6 - 2x} the condition is 6−2x≥06 - 2x \geq 0. Subtracting 6 gives −2x≥−6-2x \geq -6, and dividing by −2 reverses the sign: x≤3x \leq 3.

Look closely at the endpoint. At x = 3 the root is 0=0\sqrt{0} = 0, a perfectly good output, so 3 belongs to the domain and takes a square bracket: (−∞,3](-\infty, 3].

Only even roots restrict the domain

Odd roots do not restrict x. The cube root x−83\sqrt[3]{x - 8} is real for every x, because the cube root of a negative number is negative. Only even roots need a condition.

Example 2 · A root condition that flips its sign

domain of 6−2x\text{domain }\allowbreak \text{of } \sqrt{6 - 2x}
Solve it live

The condition 6 − 2x ≥ 0 is solved like any linear inequality, and dividing by −2 reverses the direction.

  1. List what each part needs
    6−2x≥06-2x \ge 0
    A real square root needs an inside that is not negative.
  2. Solve where it is not negative
    6−2x≥0 ⇒ (−∞,3]6-2x \ge 0\ \Rightarrow\ (-\infty, 3]
    Find where the expression is 0, then test the sign on each side.
  3. Keep the values where every part works
    x≤3(−∞,3]x \le 3\qquad (-\infty, 3]
    The domain is where all the conditions hold at once, shown again in interval notation.
x≤3x \le 3
✓ Verified

Example 3 · A square root in the denominator

domain of 1x−1\text{domain }\allowbreak \text{of } \frac{1}{\sqrt{x - 1}}
Solve it live

Here the inside must be strictly positive: x − 1 = 0 would put a zero in the denominator, so the condition is x − 1 > 0 and the endpoint 1 is left out.

  1. List what each part needs
    x−1>0x-1 > 0
    A square root in a denominator needs a positive inside.
  2. Solve where it is positive
    x−1>0 ⇒ (1,∞)x-1 > 0\ \Rightarrow\ (1, \infty)
    Find where the expression is 0, then test the sign on each side.
  3. Keep the values where every part works
    x>1(1,∞)x > 1\qquad (1, \infty)
    The domain is where all the conditions hold at once, shown again in interval notation.
x>1x > 1
✓ Verified

Logarithms: the input must be positive

A logarithm accepts only positive inputs, and zero is not allowed either. For ln⁡(x2−9)\ln(x^2 - 9) the condition is x2−9>0x^2 - 9 > 0. Its boundary points are −3 and 3, and testing one value in each region shows that the inside is positive for x<−3x < -3 and for x>3x > 3.

The domain is two separate rays, (−∞,−3)∪(3,∞)(-\infty, -3) \cup (3, \infty). A domain written with "or" like this is a compound inequality, and reading it is the same skill taught in how to solve compound inequalities.

Example 4 · A logarithm of a quadratic

domain of ln⁡(x2−9)\text{domain }\allowbreak \text{of } \ln(x^{2} - 9)
Solve it live

The inside must be greater than 0. The quadratic is zero at x = −3 and x = 3, positive outside those values and negative between them.

  1. List what each part needs
    x2−9>0x^{2}-9 > 0
    A logarithm is defined only for positive inputs.
  2. Solve where it is positive
    x2−9>0 ⇒ (−∞,−3)∪(3,∞)x^{2}-9 > 0\ \Rightarrow\ (-\infty, -3) \cup (3, \infty)
    Find where the expression is 0, then test the sign on each side.
  3. Keep the values where every part works
    x<−3 or x>3(−∞,−3)∪(3,∞)\displaystyle x < -3\ \allowbreak \text{or}\ x > 3\qquad (-\infty, -3) \cup (3, \infty)
    The domain is where all the conditions hold at once, shown again in interval notation.
x<−3 or x>3\displaystyle x < -3 \ \allowbreak \text{or}\ x > 3
✓ Verified

When a function has more than one restriction

Many functions mix the cases, and this is where knowing how to find the domain of a function one part at a time pays off. In xx−5\frac{\sqrt{x}}{x - 5} the root needs x≥0x \geq 0 and the denominator needs x≠5x \neq 5. Both must hold, so start from [0,∞)[0, \infty) and remove the single value 5.

Written carefully, the domain is [0,5)∪(5,∞)[0, 5) \cup (5, \infty): a square bracket at 0, where the root is still defined, and round brackets on both sides of 5.

Example 5 · A root and a denominator together

domain of xx−5\text{domain }\allowbreak \text{of } \frac{\sqrt{x}}{x - 5}
Solve it live

Two conditions, x ≥ 0 and x − 5 ≠ 0, are intersected. The check tests a point below 0, the values 0 and 5 themselves, and points on either side of 5.

  1. List what each part needs
    x≥0,x−5≠0\displaystyle x \ge 0,\allowbreak \quad x-5 \ne 0
    A real square root needs an inside that is not negative; a denominator cannot be 0.
  2. Solve where it is not negative
    x≥0 ⇒ [0,∞)x \ge 0\ \Rightarrow\ [0, \infty)
    Find where the expression is 0, then test the sign on each side.
  3. Solve where it is 0
    x−5≠0 ⇒ x≠5x-5 \ne 0\ \Rightarrow\ x \ne 5
    Those values are removed.
  4. Keep the values where every part works
    0≤x<5 or x>5[0,5)∪(5,∞)\displaystyle 0 \le x < 5\ \allowbreak \text{or}\ x > 5\qquad [0, 5) \cup (5, \infty)
    The domain is where all the conditions hold at once, shown again in interval notation.
0≤x<5 or x>5\displaystyle 0 \le x < 5 \ \allowbreak \text{or}\ x > 5
✓ Verified

x = 0 is in the domain, where the output is 0; x = 5 is not.

Mistakes that change the answer

  • Simplifying before you look. x2−1x−1\frac{x^2 - 1}{x - 1} simplifies to x+1x + 1, but the original is still undefined at x = 1. Read the domain from the function as given — the simplify expression calculator keeps that restriction under its answer for the same reason.
  • Using ≥ for a logarithm. ln⁡(x+2)\ln(x + 2) needs x+2>0x + 2 > 0, so −2 itself is excluded, not included.
  • Forgetting to reverse the sign. Dividing by a negative number while solving a root condition flips the inequality, exactly as in 6−2x≥06 - 2x \geq 0.
  • Putting a square bracket on infinity. Infinity is never an endpoint you reach, so it always takes a round bracket.

To check your own work, type domain of followed by the function into the AI math solver on the home page or the algebra solver. It lists the condition each part needs before it solves anything, which is the order to follow on paper.

Be clear about its range of cases: it handles denominators, even roots and logarithms built on polynomials up to degree two. A function such as tan⁡(x)\tan(x) or 2xx−1\frac{2^x}{x - 1} is declined honestly rather than given a guessed domain.

FAQ

Questions about this guide

What is the domain of a function in simple terms?

It is the set of every input x that gives a real output. If plugging a number in would divide by zero, take an even root of a negative number or the log of a number that is not positive, that number is not in the domain.

What is the domain of a polynomial?

All real numbers. A polynomial has no denominator, root or logarithm that can fail, so every x works and the domain is (−∞, ∞).

Does simplifying a function change its domain?

It can hide part of it. Cancelling a common factor removes the value that made the original denominator zero, so find the domain from the function as it was first written.

How do I write a domain in interval notation?

Use a square bracket for an endpoint that is included, a round bracket for one that is excluded or for infinity, and the union symbol ∪ to join separate pieces — for example [0, 5) ∪ (5, ∞).

Put the method to work

Try the technique from this guide on a problem of your own — with every step shown and checked.