Domain and range of a function are two sets that describe every possible input and every possible output. The domain is the set of all real-number inputs that produce a defined output; the range is the set of all outputs the function actually produces. Both depend on the function's rule, not on whichever x-values happen to appear in a table. Finding them means checking three things: division by zero, even roots of negative numbers, and the behavior of the graph at its edges.

Domain vs. Range: What Each Set Actually Describes

Start with the vocabulary, because most confusion comes from mixing up which variable belongs to which set. Inputs are x-values and belong to the domain. Outputs are f(x)-values and belong to the range. For f(x) = xΒ², any real number can go in, so the domain is all real numbers, written as (βˆ’βˆž, ∞). The output is never negative, so the range is [0, ∞).

A function can share a domain with another function and still have a completely different range. Take f(x) = xΒ² and g(x) = xΒ² + 3. Both accept any real x, so both have domain (βˆ’βˆž, ∞). The square still never drops below zero, but g lifts every output by 3, so the range becomes [3, ∞). The domain came from the rule; the range shifted because of the constant outside.

Notation trips people up more than the algebra does. A bracket means the endpoint is included; a parenthesis means it is excluded. The domain of f(x) = 1/x is written (βˆ’βˆž, 0) βˆͺ (0, ∞) because x = 0 is excluded, while the domain of f(x) = √x is [0, ∞) because x = 0 is allowed. The union symbol joins separate intervals.

One boundary statement governs everything that follows. Unless a problem says otherwise, functions in algebra and precalculus are assumed to work on real numbers only, which is why every domain rule below is about keeping the arithmetic real and defined. Complex numbers are a separate setting and change the answers entirely, so treat any mention of them as a sign you are outside the standard problem.

Every Value That Breaks a Function: The Three Domain Restrictions

Only two operations force an exclusion in real-number algebra, and both can appear in the same expression. Division by zero is undefined, so any x that makes a denominator zero leaves the domain. An even root of a negative number is not real, so any interval making the inside of a square root (or fourth root, sixth root, and so on) negative must be removed.

Odd roots are the mirror case. A cube root accepts negatives freely: the cube root of βˆ’8 is βˆ’2, because (βˆ’2)Β³ = βˆ’8. That means f(x) = βˆ›x has domain (βˆ’βˆž, ∞). Students who apply the square-root rule to every radical end up deleting half the domain for nothing.

A fraction with a radical in the denominator stacks both rules. In f(x) = 1/√(x βˆ’ 4), the inside must be strictly positive, which gives x > 4 and the domain (4, ∞). If you allowed x = 4, the denominator would be zero. If you allowed x < 4, the root would be imaginary. Both restrictions point to the same boundary, and the bracket stays a parenthesis.

Logarithms are the third practical restriction, though they come from a slightly different place. A logarithm is only defined for positive arguments, so f(x) = ln(x βˆ’ 5) requires x > 5. The College Board's AP Calculus materials treat log and root domains with the same interval-testing method. Check each restriction separately when an expression has two, then take the overlap.

Finding the Domain From an Equation: A Step-by-Step Method

Apply the restrictions in a fixed order so nothing gets missed. The sequence below works for rational, radical, and combined expressions.

1: Identify the type of expression: a polynomial, a fraction, an even root, a log, or a mix. 2: For each denominator, set it equal to zero and solve. Every solution is excluded from the domain. 3: For each even root, set the expression inside β‰₯ 0 and solve the inequality. 4: For each logarithm, set the argument > 0. 5: Test one value inside each resulting interval to confirm the sign is correct, then write the domain in interval notation.

Worked example: f(x) = (x + 1)/(xΒ² βˆ’ 9). The numerator is fine everywhere, so the only restriction is the denominator. Solve xΒ² βˆ’ 9 = 0 to get x = 3 and x = βˆ’3. The domain is (βˆ’βˆž, βˆ’3) βˆͺ (βˆ’3, 3) βˆͺ (3, ∞). Testing x = 0 gives a denominator of βˆ’9, which is defined, confirming the middle interval belongs.

Failure handling: if two restrictions disagree, the stricter one wins. For f(x) = √(x βˆ’ 1)/(x βˆ’ 5), the root needs x β‰₯ 1 and the denominator needs x β‰  5. The domain is [1, 5) βˆͺ (5, ∞). Sketch both conditions on a number line when the overlap is unclear; the shared shaded region is your answer.

Reading Domain and Range Off a Graph

A graph shows both sets at a glance. Sweep left to right along the horizontal axis to read the domain; sweep bottom to top along the vertical axis to read the range. The leftmost and rightmost x-values that touch the curve define the domain's endpoints. A hole is an excluded x, drawn as an open circle. A vertical asymptote is a boundary the graph approaches but never crosses, and it always marks an excluded value.

The vertical line test is the source of the domain's deeper rule. If any vertical line crosses the graph more than once, that x has two outputs and the relation is not a function at all. For f(x) = √x, no vertical line hits twice, and the curve stops at x = 0, so the domain is [0, ∞). The horizontal line test plays the same role for the range: if a horizontal line hits the curve twice, the function is not one-to-one, even though its range can still be read from the curve's vertical extent.

Consider f(x) = x/(x βˆ’ 2). The graph approaches x = 2 from both sides but never reaches it, so 2 is excluded from the domain. The curve also levels off toward y = 1 as x grows large, meaning y = 1 is approached but never attained, so 1 is excluded from the range. Both exclusions show up as visual cues that the naked equation does not make obvious.

For a parabola opening downward, such as f(x) = βˆ’xΒ² + 4, the domain is still all real numbers because the curve runs left and right without end. The range, though, tops out at 4 and reaches down indefinitely, so it is (βˆ’βˆž, 4]. The direction of opening decides whether the vertex is a maximum or a minimum, and that choice decides the range's bracket placement.

The Difference Quotient and Function Meaning: Why Combining Functions Changes Both Sets

When functions combine, domains combine too, with one catch: an operation can introduce a new restriction. If f(x) = x and g(x) = √x, then f + g has domain [0, ∞) because the root inside g is still there. But f Β· g = x√x, which has the same domain. The catch appears in division: f/g adds the condition g(x) β‰  0 on top of everything else. Compose functions and the rule tightens again. For f(g(x)) with f(x) = √x and g(x) = x βˆ’ 5, the input to f must be nonnegative, so x βˆ’ 5 β‰₯ 0 and the domain is [5, ∞), even though g alone accepts any real number.

Students often assume the domain of a composition is just the domain of the inner function. That is wrong, and it is the most common source of lost points on function-combination questions. Always reapply the outer restriction to the inner output before writing the final answer.

The difference quotient isolates the same idea. Computing [f(x + h) βˆ’ f(x)]/h requires dividing by h, so h cannot equal zero. That single exception is why the difference quotient is defined for every h except 0 and why the derivative is obtained by taking a limit as h approaches 0. The domain restriction, not algebraic cleverness, is what makes the definition work.

For f(x) = xΒ², the difference quotient becomes [(x + h)Β² βˆ’ xΒ²]/h, which simplifies to 2x + h for h β‰  0. The domain of the quotient is all real x with h β‰  0, and letting h shrink toward zero produces the derivative 2x. Every step traces back to that one excluded value.

Range From an Equation: Vertex, Asymptote, and Endpoint Methods

Range is harder than domain because no universal checklist exists. Four methods cover nearly every precalculus problem:

Quadratics: complete the square or read the vertex, then check the direction of opening. Rational functions: identify horizontal asymptotes and any values the expression can never take. Radicals: set the inside expression's range first, then apply the root to it. Inverse functions: swap x and y and find the domain of the inverse, which becomes the range of the original.

For f(x) = xΒ² + 2x βˆ’ 3, completing the square yields (x + 1)Β² βˆ’ 4, so the vertex sits at (βˆ’1, βˆ’4) and the parabola opens upward. The range is [βˆ’4, ∞). For f(x) = βˆ’(x βˆ’ 2)Β² + 5, the vertex is (2, 5) and the parabola opens downward, so the range is (βˆ’βˆž, 5].

Rational functions need the asymptote work. For f(x) = 1/(x βˆ’ 3) + 2, the horizontal shift lifts the whole graph by 2, so the horizontal asymptote moves to y = 2 and the range is (βˆ’βˆž, 2) βˆͺ (2, ∞). Endpoints matter for radicals: f(x) = √(x + 1) + 3 has range [3, ∞) because the root bottoms out at zero and the +3 shifts the floor upward.

Word Problems: Domain Is the Context, Range Is the Consequence

Real-world problems add a layer the algebra does not show. Consider a taxi fare of $3 plus $2 per mile. The function f(d) = 2d + 3 has a theoretical domain of all real numbers, but a rider cannot travel a negative distance, so the practical domain is d β‰₯ 0. The practical range becomes f(d) β‰₯ 3, because the fare can never drop below the base charge. A domain that is algebraically valid but physically impossible is not the answer.

Area functions show the same constraint from another angle. A rectangle with width x and perimeter 20 has a length of 10 βˆ’ x, so the area A(x) = x(10 βˆ’ x) has a theoretical domain of all real numbers. Geometry cuts it to 0 < x < 10, because both dimensions must be positive. The range then becomes 0 < A ≀ 25, with the maximum at the square x = 5.

Time-based problems add their own edge. A function modelling the temperature of a cooling cup of coffee over t minutes may be defined by a formula for all t β‰₯ 0, but the sensible domain stops once the coffee reaches room temperature and stops changing. Context-driven domains are always narrower than or equal to the algebraic ones, never wider.

Two Domain-and-Range Questions Compared: Interval and Inequality Notation

The same answer looks different depending on the notation requested. The table below pairs the two formats so you can convert without recalculating.

Function Domain in interval notation Domain in inequality form Range in interval notation Range in inequality form
f(x) = xΒ² (βˆ’βˆž, ∞) βˆ’βˆž < x < ∞ [0, ∞) y β‰₯ 0
f(x) = 1/x (βˆ’βˆž, 0) βˆͺ (0, ∞) x β‰  0 (βˆ’βˆž, 0) βˆͺ (0, ∞) y β‰  0
f(x) = √x [0, ∞) x β‰₯ 0 [0, ∞) y β‰₯ 0
f(x) = ln(x) (0, ∞) x > 0 (βˆ’βˆž, ∞) βˆ’βˆž < y < ∞
f(x) = 1/(x βˆ’ 2) (βˆ’βˆž, 2) βˆͺ (2, ∞) x β‰  2 (βˆ’βˆž, 0) βˆͺ (0, ∞) y β‰  0

The verdict on notation: exam boards and online homework systems accept either format when both are marked correct, but AP Calculus and most US college placement tests ask for interval notation by default. Use the inequality form when a word problem asks for a practical domain in context. Check the exam's published conventions page before relying on either, since platforms differ in how they accept the union symbol in typed answers.

Five Mistakes That Cost Points on Domain and Range

A few errors appear repeatedly in graded work and in the College Board's released exam commentary. Fixing them is faster than learning the topic from scratch.

1: Assuming every polynomial has domain all real numbers, then forgetting that a polynomial inside a denominator does not. The domain of 1/(xΒ² βˆ’ 4) is not all real numbers. 2: Applying the square-root restriction to a cube root. The cube root of a negative is defined, so βˆ›(x βˆ’ 2) has domain (βˆ’βˆž, ∞). 3: Writing the range as the domain. Students copy the x-interval into the y-slot when the function is not one-to-one, which is exactly the case where the two sets differ. 4: Using brackets where the value is excluded. A vertical asymptote or a hole always takes a parenthesis, never a bracket. 5: Forgetting that a hole in the graph is an excluded x. The simplified form of a rational function may look defined at a point that the original expression removed.

Failure case worth naming: f(x) = (xΒ² βˆ’ 1)/(x βˆ’ 1) simplifies to x + 1 for x β‰  1. The simplified form is defined at x = 1, but the original is not, because the denominator was zero there. The correct domain is x β‰  1, and the graph shows a hole at (1, 2) rather than a solid point.

How Domain and Range Show Up in Calculus and Advanced Algebra

The domain rules do not disappear after precalculus; they become the foundation for continuity and differentiability. A function cannot be continuous at a point outside its domain, so the domain determines where continuity questions even make sense. The AP Calculus course description lists domain analysis as a prerequisite skill for limits, and released free-response questions routinely award points for a correctly stated domain.

Derivatives tighten the domain further. The derivative of f(x) = √x is 1/(2√x), which is undefined at x = 0 even though the original function was defined there. The original domain was [0, ∞), and the derivative's domain is (0, ∞). Failure to track that shrink is a common error in optimization problems.

Inverse functions reverse the sets. If f has domain A and range B, then its inverse has domain B and range A. Squaring and square-rooting are the classic pair: f(x) = x² on [0, ∞) has range [0, ∞), so f⁻¹(x) = √x has domain [0, ∞) and range [0, ∞). Restricting the original's domain is what makes the inverse a function at all.

Piecewise functions extend the idea. f(x) = x for x < 0 and xΒ² for x β‰₯ 0 has domain (βˆ’βˆž, ∞) because the two pieces meet at 0, but the range starts at 0 and climbs, giving [0, ∞). The domain is the union of the pieces' domains, and each piece contributes to the range only where it is defined.

FAQ

What is the domain of a function with a fraction and a square root?

The domain must satisfy both restrictions at once. For f(x) = √(x βˆ’ 2)/(x βˆ’ 4), the root requires x β‰₯ 2 and the denominator excludes x = 4. The final answer is [2, 4) βˆͺ (4, ∞). Test one value in each interval, such as x = 3 and x = 5, to confirm the signs before writing it down.

Is the range of a quadratic always written with a bracket at the vertex?

Yes, when the domain is all real numbers. The vertex is either the minimum or the maximum, so it is always included, which makes the endpoint a square bracket. For f(x) = xΒ² βˆ’ 6x + 5, the vertex is (3, βˆ’4) and the range is [βˆ’4, ∞). If the domain is restricted, the range endpoints change and may become parentheses.

Why is the domain of f(x) = 1/x not all real numbers?

Because x = 0 makes the denominator zero, and division by zero is undefined. The domain is every real number except 0, written (βˆ’βˆž, 0) βˆͺ (0, ∞). The graph has a vertical asymptote at x = 0 that the curve never touches. This is the single most common exclusion tested on standardized exams.

Can the range of a function be larger than the domain?

The sets can differ in size, though "larger" needs care because both are usually infinite intervals. For f(x) = 2x, the domain and range are both (βˆ’βˆž, ∞). For f(x) = xΒ² + 10, the domain is all reals but the range starts at 10. Counting elements is not meaningful for infinite sets; compare the intervals instead.

What is the difference between a hole and an asymptote in the domain?

A hole is one excluded x where the function is undefined but approaches a finite value, as in (xΒ² βˆ’ 1)/(x βˆ’ 1) at x = 1. An asymptote is an excluded x where the function's value grows without bound, as in 1/x at x = 0. Both exclude the same point from the domain, but the graph behaves differently on either side.

How do I find the range without graphing?

Use the vertex for quadratics, the horizontal asymptote for rational functions, and the inverse for anything one-to-one. For f(x) = 3/(x + 1), the horizontal asymptote is y = 0, so the range is (βˆ’βˆž, 0) βˆͺ (0, ∞). Swapping x and y to solve for the inverse gives the same answer, which is a useful check.

Does the difference quotient have the same domain as the function?

No. The difference quotient divides by h, so h β‰  0 is always an extra exclusion, and the quotient's domain can be narrower than the original function's. For f(x) = √x, the difference quotient is defined only for x > 0, whereas the original is defined at x = 0. That extra restriction is precisely what the derivative's limit works around.

What does the vertical line test actually prove?

It proves that each x has at most one y, which is the definition of a function. A curve that fails the vertical line test is a relation, not a function, and its "domain" as a set of inputs still exists but no longer maps to a single output. For example, the circle xΒ² + yΒ² = 25 fails the test at x = 0, where y = Β±5.