How to Find the Domain of a Function (Steps + Solver Check)

Your homework asks for the domain of f(x) = sqrt(5 − 2x), the textbook's three worked examples were all different functions, and the answer key gives (−∞, 5/2] without explaining the square bracket. The algebra isn't the hard part. Knowing which numbers to test is, and so is writing what's left in the form your teacher marks.
Short version: how to find the domain of a function is three checks repeated. Every input that gives a real output is in; every input that divides by zero, takes an even root of a negative, or takes a log of zero or a negative is out. Solve those cases as inequalities, then write the survivors in interval notation.
This post does each rule once with a worked example, then shows how to run your own function through the AI Math Solver so you can check your answer instead of a stranger's. It's for anyone in algebra, precalculus or a first calculus course who can do the algebra but keeps losing marks on the notation.
What the domain of a function is, in words and notation
The domain of a function is every input the function is defined for: put the number in, get a real number back, and it belongs to the domain.
f(x) = x² accepts every real number, so its domain is (−∞, ∞). g(x) = 1/x accepts everything except 0, so its domain is (−∞, 0) ∪ (0, ∞).
Interval notation is the same answer written as stretches of the number line, with the union symbol joining the stretches that don't touch. Homework and exams almost always want it that way, so read the two side by side until they look like the same thing.
The three rules that take a number out of the domain
There are exactly three, and every domain question is a search for them.
Division by zero. If an x makes a denominator equal 0, that x is out. 1/(x − 3) loses x = 3.
Even root of a negative. The square root of a negative number isn't real, so whatever sits under the radical has to be at least 0. sqrt(x + 4) needs x ≥ −4.
Log of zero or a negative. log(0) and log(−5) don't exist over the reals, so the argument of a log has to be strictly positive.
That's the whole list. Polynomials, odd roots, exponentials and sines take every real number, so a function with none of those three features has domain (−∞, ∞) and the question is a gift.
Check your own function in the AI math solver
Three worked examples from a textbook tell you nothing about whether your own f is right. The check that helps is running your own function, with your own coefficients.
1. Open the AI Math Solver
The AI Math Solver is a single page, headed Free Math Solver with Steps, and it promises the working shown step by step, free, with no sign-up needed to try. The input is one text box and one button. There's no photo or file control anywhere on it, so an equation photographed from a worksheet has to be typed out first.

The whole input: one text box and one dimmed button. 2. Write the question as a sentence
The box is labelled Type or upload your question, and Solve Problem stays dimmed until there's something in it. Type the whole request:
Find the domain of f(x) = (x^2 - 1)/(x - 1) and write the answer in interval notation.
That sentence is what gets sent, so asking for the domain in interval notation is part of the question. Write powers as x^2 and roots as sqrt(x), the plain notation the working comes back in.

Ask for the domain and for interval notation in the sentence itself. 3. Read the steps, then the last line
Press Solve Problem; the button reads Solving... while the answer is being written. Then the box is replaced by a card that echoes your request in a grey bubble, headed Fusion Chat Math Solver, with the working under [Solution].

The card echoes the request, then works the steps. Read it the way you'd read a classmate's work: which values did it exclude, and does the final line match the interval you got by hand? The steps are the useful part, and the last line is only as good as they are.
4. Clear it and run the next function
Enter New Problem puts the empty box back, and the copy icon beside the working copies the text for your notes. Keep it to one function per question, so that the excluded values in the answer plainly belong to the function you're checking.
When your one function checks out and you want the other cases (equations, systems, calculus), more AI Math Solver guides are collected in one place.
Domain of a rational function, step by step
Take f(x) = (x + 5)/(x² − 4).
Factor the denominator first. x² − 4 = (x − 2)(x + 2), so set it to zero and you get x = 2 and x = −2. Guessing at a denominator you haven't factored is where most of these go wrong.
Split the number line at every excluded value. Three stretches are left: below −2, between the two values, and above 2. Both excluded values take a parenthesis because neither can be used.
Write it. (−∞, −2) ∪ (−2, 2) ∪ (2, ∞).
The middle piece is the one people drop. A single excluded value doesn't cut the domain in half; it makes a hole with number line on both sides of it.
Domain of a square root function, step by step
Take f(x) = sqrt(5 − 2x).
Set the inside of the root at least 0. 5 − 2x ≥ 0.
Solve the inequality. Subtract 5 to get −2x ≥ −5, then divide by −2 and flip the sign: x ≤ 5/2.
Write it. (−∞, 5/2].
That square bracket is the point of the question. sqrt(0) is 0, a perfectly good real number, so 5/2 belongs to the domain and the interval closes on it. Watch the sign flip when you divide by a negative; it's the most common arithmetic slip in this family.
Domain of a log function, step by step
Take f(x) = log₃(7 − x).
Work with the argument, not the base. The restriction is on what's inside: 7 − x > 0.
Solve it. x < 7.
Write it. (−∞, 7).
The inequality is strict, so 7 gets a parenthesis. log(0) doesn't exist, which makes 7 exactly the value you can't include, and that's where a bracket slips in by habit. The base changes nothing here: log₃, log₁₀ and ln all need a positive argument.
How to find the domain of a piecewise function
Take f(x) = 1/(x − 1) for x < 1, and f(x) = sqrt(x − 4) for x ≥ 1.
Solve each branch inside its own window. The first branch has a denominator, so x ≠ 1, but the branch only applies below 1 anyway, which leaves (−∞, 1). The second needs x − 4 ≥ 0, so x ≥ 4, and it only applies from 1 upward, so the two conditions overlap as [4, ∞).
Union the pieces. (−∞, 1) ∪ [4, ∞).
The trap is assuming the pieces meet. Between 1 and 4 the second branch is the one in force, and there its root is negative, so nothing in that stretch is in the domain. A gap in the middle is normal for a piecewise function, and so is a bracket at the start of a piece.
Why (x²−1)/(x−1) still excludes x = 1
Cancel the common factor and you get x + 1, which accepts every real number. So the domain is all reals? It isn't.
x = 1 makes the original denominator zero. Simplifying is only valid where the original expression was defined, so the cancellation doesn't put x = 1 back: the domain is (−∞, 1) ∪ (1, ∞).
The graph is the line y = x + 1 with a single hole at (1, 2). That hole is why the example turns up in domain questions at all: the simplified version looks total, and the original isn't. Find your exclusions on the function as given, before you cancel anything.
How to find domain and range together
Domain is what goes in, range is what comes out, and they're separate answers. For sqrt(5 − 2x) the domain is (−∞, 5/2] and the range is [0, ∞), because a square root never returns a negative number.
Ask for both in the same sentence when you want both: "Find the domain and range of f(x) = sqrt(5 − 2x)". Then check the domain against your inequalities and the range against the graph, because the range depends on the shape of the function rather than only on the excluded values.
When working out the range turns into solving for x, you're back in equation territory, and How to solve quadratic equations: 5 methods, step by step covers that side of it.
Where marks are lost in interval notation
Brackets and parentheses. A square bracket includes the endpoint, a parenthesis excludes it. The endpoint is included only when the number itself works in the function: 5/2 under a square root, never 7 inside a log.
Infinity always takes a parenthesis. (−∞, 7) is right; [−∞, 7) never is, because infinity isn't a number you can include.
The union symbol joins the pieces. (−∞, −2) ∪ (−2, 2) ∪ (2, ∞). A comma between pieces, or the word "and", is a lost mark.
All real numbers is still an answer. Write (−∞, ∞) rather than leaving the line blank or writing "any".
Order, and no overlap. Pieces run from smallest to largest, and no value appears in two of them.
What to do next time you're stuck
Run the three checks on the function as written, before you simplify anything, and write the domain in interval notation as you go. That's the whole method. When the answer key disagrees with you, compare the excluded values rather than the last line, because that's where the disagreement actually is.
The thing to try next: take the function you got wrong most recently, ask the solver for its domain in interval notation, and check its steps against your own working.
Frequently asked questions
What is the domain of a function, in plain words?
Which values get excluded, and why?
Why does (x²−1)/(x−1) exclude x = 1 after simplifying?
How do I check my answer with the AI Math Solver?
Can I upload a photo of the problem instead of typing it?
Where do students lose marks in interval notation?
First published · Last updated : First published.

