Sub topic 9
Finding the domain from an equation
This chapter assumes you can solve linear and simple quadratic inequalities, write answers in interval notation, and evaluate expressions with exponents and square roots. You should also know what a domain is: the set of inputs for which a function gives an output.
The default rule
When a function is given as an equation with no stated domain, the domain is every real number that the equation can accept. Start with all real numbers, then remove the inputs that break the arithmetic.
Over the real numbers, only two things break in the functions of this tutorial:
- Division by zero. A denominator that equals 0 is undefined.
- An even root of a negative number. A square root, fourth root, and so on needs a radicand (the expression under the root) that is zero or positive.
Polynomials such as f(x) = 2x + 3 or f(x) = x² − 5x have no such problems, so their domain is all real numbers, written (−∞, ∞).
Restriction 1: division by zero
Division by zero has no answer. So any x that makes a denominator zero must be removed.
Example. Find the domain of f(x) = (x + 1) / (x − 4).
- The denominator is x − 4.
- Set x − 4 = 0, which gives x = 4.
- Remove 4 from the real numbers.
The domain is all real numbers except 4. In set notation: {x | x ≠ 4}. In interval notation: (−∞, 4) ∪ (4, ∞).
The symbol ∪ means union: the set of numbers in either interval. Parentheses at 4 mean 4 is not included.
Denominators that factor
Often you must factor the denominator to find every zero.
Example. Find the domain of f(x) = 5 / (x² − 9).
Solve x² − 9 = 0. Factor it as (x − 3)(x + 3) = 0, so x = 3 or x = −3.
Domain: (−∞, −3) ∪ (−3, 3) ∪ (3, ∞).
Denominators with no real zeros
If the denominator never equals zero, nothing is removed. For f(x) = 1 / (x² + 1), the expression x² + 1 is at least 1 for every real x. The domain is (−∞, ∞).
Restriction 2: even roots
A square root of a negative number is not a real number. So the radicand must be at least 0.
Example. Find the domain of f(x) = √(x − 2).
- Require x − 2 ≥ 0.
- Solve: x ≥ 2.
Domain: [2, ∞). The bracket at 2 means 2 is included, because √0 = 0 is fine.
The same rule holds for fourth roots, sixth roots, and any even index. Odd roots (cube roots, fifth roots) accept negative numbers, so they add no restriction. The domain of f(x) = ∛(x − 2) is (−∞, ∞).
Roots with an inequality that flips
Solving the radicand inequality may require dividing by a negative number. Reverse the inequality sign when you do.
Example. Find the domain of f(x) = √(6 − 2x).
- Require 6 − 2x ≥ 0.
- Subtract 6: −2x ≥ −6.
- Divide by −2 and flip the sign: x ≤ 3.
Domain: (−∞, 3].
Roots with a quadratic radicand
Example. Find the domain of f(x) = √(x² − 4).
Require x² − 4 ≥ 0, so (x − 2)(x + 2) ≥ 0. The product is zero at x = −2 and x = 2. Test one value in each region:
| Region | Test value | (x − 2)(x + 2) | Sign |
|---|---|---|---|
| x < −2 | −3 | (−5)(−1) = 5 | positive |
| −2 < x < 2 | 0 | (−2)(2) = −4 | negative |
| x > 2 | 3 | (1)(5) = 5 | positive |
We need values that are zero or positive, so the domain is (−∞, −2] ∪ [2, ∞).
Combining restrictions
When a function has more than one restriction, an input must satisfy all of them. The domain is the intersection (the overlap) of the conditions.
Example. Find the domain of g(x) = √(x − 2) / (x − 5).
- The square root requires x ≥ 2.
- The denominator requires x ≠ 5.
Start with [2, ∞) and remove 5. The domain is [2, 5) ∪ (5, ∞).
The code below checks this. It rejects inputs outside the domain before computing.
import math
def g(x):
if x < 2 or x == 5:
raise ValueError("x is outside the domain of g")
return math.sqrt(x - 2) / (x - 5)
print(g(6)) # 2.0
print(g(3)) # -0.5For x = 6, the value is √4 / 1 = 2. For x = 3, it is √1 / (−2) = −0.5.
A root in the denominator
When a root sits in a denominator, both rules apply at once, and they combine into a strict inequality.
Example. Find the domain of f(x) = 1 / √(x − 2).
- The root needs x − 2 ≥ 0.
- The denominator √(x − 2) must not be 0, so x − 2 ≠ 0.
Together, x − 2 > 0, so x > 2. Domain: (2, ∞). Here 2 is excluded, unlike in √(x − 2) alone.
Restrictions that depend on the inside of another expression
Sometimes a denominator contains a root, or a root contains a fraction. Work from the outside in, and write each condition separately.
Example. Find the domain of f(x) = √(x / (x − 3)).
- The fraction needs x ≠ 3.
- The radicand needs x / (x − 3) ≥ 0.
For the second condition, the fraction changes sign only at x = 0 (numerator zero) and x = 3 (denominator zero). Test each region:
| Region | Test value | x / (x − 3) | Sign |
|---|---|---|---|
| x < 0 | −1 | −1 / −4 = 0.25 | positive |
| 0 < x < 3 | 1 | 1 / −2 = −0.5 | negative |
| x > 3 | 4 | 4 / 1 = 4 | positive |
At x = 0 the fraction equals 0, which is allowed. At x = 3 it is undefined, so 3 is excluded.
Domain: (−∞, 0] ∪ (3, ∞).
Checking a domain with code
You can test a proposed domain by trying many inputs and recording where the function fails. This is a check, not a proof, because it samples only some inputs.
import math
def f(x):
return math.sqrt(x / (x - 3))
def in_domain(x):
try:
f(x)
return True
except (ValueError, ZeroDivisionError):
return False
for x in [-2, 0, 1, 3, 4]:
print(x, in_domain(x))The output is:
-2 True
0 True
1 False
3 False
4 TrueThis matches (−∞, 0] ∪ (3, ∞). Note that x = 1 fails because the radicand is negative, and x = 3 fails because of division by zero.
Common errors
- Removing too little. Forgetting that a factored denominator has several zeros. Solve the whole denominator equation.
- Using > when you need ≥. A root alone allows radicand 0. A root in a denominator does not.
- Forgetting to flip the inequality when dividing by a negative number.
- Reading the domain from a simplified form. Always use the original equation.
- Restricting the numerator. A numerator that equals zero is fine. The function value is just 0. Only the denominator is a problem.
- Restricting odd roots. Cube roots accept every real number.
- Mixing up set and interval notation. {x | x ≥ 2} and [2, ∞) mean the same thing. Infinity always gets a parenthesis, never a bracket.
Quick reference
| Feature in the equation | Condition on x | Example | Domain |
|---|---|---|---|
| Polynomial | none | 2x + 3 | (−∞, ∞) |
| Denominator D(x) | D(x) ≠ 0 | 1 / (x − 4) | (−∞, 4) ∪ (4, ∞) |
| Even root of R(x) | R(x) ≥ 0 | √(x − 2) | [2, ∞) |
| Odd root of R(x) | none | ∛(x − 2) | (−∞, ∞) |
| Even root in a denominator | R(x) > 0 | 1 / √(x − 2) | (2, ∞) |
Practice
Exercise
Find the domain of f(x) = (x + 7) / (x² − 5x + 6). Write it in interval notation.
Show answer
Solve x² − 5x + 6 = 0. It factors as (x − 2)(x − 3) = 0, so x = 2 or x = 3. Remove both. The domain is (−∞, 2) ∪ (2, 3) ∪ (3, ∞).
Exercise
Find the domain of f(x) = √(10 − 5x).
Show answer
Require 10 − 5x ≥ 0. Then −5x ≥ −10, and dividing by −5 flips the sign, so x ≤ 2. The domain is (−∞, 2].
Exercise
Find the domain of h(x) = √(x + 1) / (x − 3), and then find the domain of k(x) = 1 / √(x + 1).
Show answer
For h, the root needs x ≥ −1 and the denominator needs x ≠ 3. The domain is [−1, 3) ∪ (3, ∞). For k, the root needs x + 1 ≥ 0 and the denominator √(x + 1) cannot be 0, so x + 1 > 0. The domain is (−1, ∞).
Exercise
A student says the domain of f(x) = (x² − 25) / (x − 5) is all real numbers, because the fraction simplifies to x + 5. What is wrong, and what is the correct domain?
Show answer
The original equation is undefined at x = 5, because the denominator is 0 there. Simplifying does not change the function's domain. The correct domain is (−∞, 5) ∪ (5, ∞).