The domain of a function is the set of inputs (x-values) it accepts; the range is the set of outputs (y-values) it produces. To find the domain, exclude x-values that divide by zero, take an even root of a negative number, or take the log of a number that isn’t positive. For example: ( f(x) = sqrt{x – 3} ) has domain ( x ge 3 ) and range ( y ge 0 ).
A function is a rule that assigns exactly one output to each input. The domain is the set of all inputs the function accepts, and the range is the set of all outputs it actually produces.
For ( f(x) = sqrt{x} ), you can’t take the square root of a negative number (in the real numbers), so the domain is ( x ge 0 ). The outputs are never negative and can be any non-negative number, so the range is ( y ge 0 ).
What is a function?
A relation is a function if no input has two different outputs. On a graph, that’s the vertical line test: if any vertical line hits the graph more than once, it isn’t a function. A circle ( x^2 + y^2 = 1 ) fails (the line ( x = 0 ) hits it at ( y = 1 ) and ( y = -1 )); a parabola ( y = x^2 ) passes.
A linear function ( f(x) = mx + b ) is the simplest example: its graph is a line with slope m (see the slope formula). If ( m neq 0 ), both its domain and range are all real numbers.
Interval notation
| Inequality | Interval notation | Meaning |
|---|---|---|
| ( x ge 3 ) | ( [3, infty) ) | 3 included |
| ( x > 3 ) | ( (3, infty) ) | 3 excluded |
| ( -2 < x le 5 ) | ( (-2, 5] ) | |
| all real numbers | ( (-infty, infty) ) | |
| ( x neq 1 ) | ( (-infty, 1) cup (1, infty) ) | everything except 1 |
Square brackets include the endpoint; round brackets exclude it. Infinity always gets a round bracket.
How to find the domain
Start by assuming the domain is all real numbers, then remove anything that breaks a rule:
- No division by zero. Exclude x-values that make a denominator zero.
- No even roots of negatives. The expression under ( sqrt{ } ) must be ( ge 0 ).
- No logs of zero or negatives. The input to ( ln ) or ( log ) must be ( > 0 ).
- Context. A length or a time can’t be negative, even if the formula allows it.
Example 1: a rational function
( f(x) = frac{x + 2}{x^2 – 9} ). The denominator is zero at ( x = pm3 ), so the domain is
$$(-infty, -3) cup (-3, 3) cup (3, infty)$$
Example 2: a square root
( g(x) = sqrt{6 – 2x} ). Require ( 6 – 2x ge 0 ), so ( x le 3 ). Domain: ( (-infty, 3] ).
Example 3: a log
( h(x) = ln(x – 4) ). We require ( x – 4 > 0 ). So, the Domain: ( (4, infty) ). See logarithm rules.
Example 4: combined restrictions
( k(x) = frac{1}{sqrt{x – 1}} ). The root needs ( x ge 1 ), and the denominator can’t be zero, so ( x neq 1 ). Domain: ( (1, infty) ).
How to find the range
The range is often harder. Useful methods:
- Know the parent function. ( x^2 ge 0 ), ( sqrt{x} ge 0 ), ( e^x > 0 ), ( -1 le sin x le 1 ).
- Find the vertex or extreme points. For parabolas and other curves with a highest or lowest point.
- Solve for x. Write ( y = f(x) ), then solve for x in terms of y, and see which y-values are allowed.
- Read it from the graph. Look at the lowest and highest points the graph reaches.
Example 5: a parabola
( f(x) = x^2 – 4x + 7 = (x – 2)^2 + 3 ). The squared term is at least 0, so ( f(x) ge 3 ). Range: ( [3, infty) ). The vertex ( (2, 3) ) is the lowest point (see the quadratic formula guide for vertex form).
Example 6: solving for x
( f(x) = frac{2x + 1}{x – 3} ). Set ( y = frac{2x + 1}{x – 3} ) and solve: ( y(x – 3) = 2x + 1 ), so ( x(y – 2) = 3y + 1 ) and ( x = frac{3y + 1}{y – 2} ). This fails only when ( y = 2 ). Range: all real numbers except 2.
Example 7: shifted functions
( g(x) = 5 – sqrt{x + 1} ). Domain ( x ge -1 ). Since ( sqrt{x + 1} ge 0 ), ( g(x) le 5 ). Range: ( (-infty, 5] ).
Domain and range of common functions
| Function | Domain | Range |
|---|---|---|
| ( mx + b ), ( m neq 0 ) | ( (-infty, infty) ) | ( (-infty, infty) ) |
| ( x^2 ) | ( (-infty, infty) ) | ( [0, infty) ) |
| ( x^3 ) | ( (-infty, infty) ) | ( (-infty, infty) ) |
| ( sqrt{x} ) | ( [0, infty) ) | ( [0, infty) ) |
| ( frac1x ) | ( x neq 0 ) | ( y neq 0 ) |
| ( e^x ) | ( (-infty, infty) ) | ( (0, infty) ) |
| ( ln x ) | ( (0, infty) ) | ( (-infty, infty) ) |
| ( sin x ), ( cos x ) | ( (-infty, infty) ) | ( [-1, 1] ) |
| ( tan x ) | ( x neq frac{pi}{2} + kpi ) | ( (-infty, infty) ) |
| ( arcsin x ) | ( [-1, 1] ) | ( left[ -frac{pi}{2}, frac{pi}{2} right] ) |
Types of functions: graph each one and identify the domain and range
A frequent exercise asks you to sketch a function and read its domain and range from the graph.

Example A: ( f(x) = lvert x – 2rvert + 1 ). An absolute value function makes a V shape. This one has its vertex at ( (2, 1) ) and opens upward. Domain: all real numbers. Range: ( [1, infty) ).
Example B: ( g(x) = -(x + 1)^2 + 4 ). A quadratic function whose graph is a downward parabola with vertex ( (-1, 4) ). Domain: all real numbers. Range: ( (-infty, 4] ).
Example C: ( h(x) = frac{1}{x – 2} + 3 ). A rational function: the graph of ( frac1x ) shifted right 2 and up 3, with a vertical asymptote at ( x = 2 ) and a horizontal asymptote at ( y = 3 ). Domain: ( x neq 2 ). Range: ( y neq 3 ).
Example D: ( k(x) = sqrt{4 – x^2} ). The upper half of a circle of radius 2. Domain: ( [-2, 2] ). Range: ( [0, 2] ).
Example E: a polynomial function such as ( x^3 – 3x ) has domain and range of all real numbers (odd degree). An even-degree polynomial like ( x^4 – 2x^2 ) has a lowest point, here ( y = -1 ), so its range is ( [-1, infty) ). See polynomials.
Asymptotes
An asymptote is a line the graph approaches but (usually) doesn’t reach. Asymptotes often mark the edges of the domain and range.

- Vertical asymptotes occur where a rational function’s denominator is zero and the numerator isn’t. For example, ( frac{1}{x – 2} ) has one at ( x = 2 ).
- Horizontal asymptotes describe the behavior as ( x to pminfty ). For ( frac{2x + 1}{x – 3} ), the leading terms give ( y = frac{2x}{x} = 2 ), which is why 2 was missing from the range in Example 6. Calculus makes this precise with limits at infinity.
- ( e^x ) has the horizontal asymptote ( y = 0 ); ( ln x ) has the vertical asymptote ( x = 0 ).
Oblique (slant) asymptotes. When the numerator’s degree is exactly one more than the denominator’s, the graph approaches a slanted line. Divide to find it: ( frac{x^2 + 1}{x} = x + frac1x ), so the oblique asymptote is ( y = x ).
Graph it
Domain and range are easiest to see on a graph. Read the domain left to right along the x-axis. Also, read the range bottom to top along the y-axis. Try changing the function below to <code>sqrt(x + 1)</code> or <code>1/(x – 2)</code>.

2D Visual Lab·Live coordinate sandbox
See derivatives and integrals take shape
Plot any function, slide a tangent line along the curve, shade the signed area under it, and watch Riemann rectangles converge to the exact integral.
The full graphing calculator lets you plot several functions at once, and graphs of functions shows how to sketch any graph by hand from its parent function.
Inverse functions
An inverse function ( f^{-1} ) undoes f: if ( f(a) = b ), then ( f^{-1}(b) = a ). Only one-to-one functions (passing the horizontal line test) have inverses. To find one, swap x and y and solve for y.
Example 8. ( f(x) = 2x + 6 ). Swap: ( x = 2y + 6 ). Solve: ( f^{-1}(x) = frac{x – 6}{2} ).
The domain of ( f^{-1} ) is the range of f, and the range of ( f^{-1} ) is the domain of f. Also, the graph of ( f^{-1} ) is the reflection of the graph of f across ( y = x ). This is how ( ln x ) relates to ( e^x ) (see exponential functions) and how the inverse trig functions are built.
One-to-one functions. A function is one-to-one if different inputs always give different outputs; graphically, every horizontal line hits the graph at most once. ( x^3 ) is one-to-one; ( x^2 ) is not (both 2 and ( -2 ) give 4), but it becomes one-to-one if you restrict its domain to ( x ge 0 ), which is how ( sqrt{x} ) is defined as its inverse.
Domain vs range: a quick comparison
| Domain | Range | |
|---|---|---|
| What it is | allowed inputs (x) | resulting outputs (y) |
| On a graph | horizontal extent | vertical extent |
| Usually found by | excluding bad x-values | finding minimum/maximum or solving for x |
Common mistakes
- Swapping domain and range. Domain is x, range is y.
- Forgetting to combine restrictions. A root in a denominator needs a strict inequality.
- Wrong brackets. An excluded endpoint needs a round bracket; infinity always does.
- Assuming the range is everything. ( x^2 + 1 ) never goes below 1.
Practice problems
Find the domain and range.

- ( f(x) = 3x – 5 )
- ( f(x) = sqrt{x + 4} )
- ( f(x) = frac{1}{x + 1} )
- ( f(x) = -x^2 + 6x )
- ( f(x) = ln(2x) )
- Find the inverse of ( f(x) = frac{x + 1}{3} ).
Answers: (1) both ( (-infty, infty) ); (2) domain ( [-4, infty) ), range ( [0, infty) ); (3) domain ( x neq -1 ), range ( y neq 0 ); (4) domain ( (-infty, infty) ), range ( (-infty, 9] ); (5) domain ( (0, infty) ), range ( (-infty, infty) ); (6) ( f^{-1}(x) = 3x – 1 ).
FAQ
What is domain and range?
The domain is the set of inputs a function accepts; the range is the set of outputs it produces.
How do you find the domain of a function?
Start with all real numbers and remove values that cause division by zero, even roots of negatives, or logs of non-positive numbers.
How do you find the range from a graph?
Look at the lowest and highest y-values the graph reaches, including any values it approaches but never hits.
What is the domain of a square root function?
The values that make the expression under the root zero or positive. For ( sqrt{x – a} ), it’s ( x ge a ).
Can the domain and range be the same?
Yes. For ( f(x) = x ), ( f(x) = x^3 ) and ( f(x) = frac1x ), the domain and range match.
Further reading
- Domain of a function (Wikipedia) — formal definitions and examples.
- Range of a function (Wikipedia) — range, image and codomain explained.
Calculators for this topic
Keep learning
The Unit Circle: Angles, Coordinates and Trig Values
The unit circle explained: why the coordinates are cos and sin, every special angle in degrees and radians, tangent on the unit circle, and memory tricks.
Trigonometric Functions: Sin, Cos, Tan, Table and Graphs
The six trig functions with SOH-CAH-TOA and the unit circle, a table of exact values (sin 30, cos 180, sec 45), graphs, period and amplitude.

