- What is the Domain and Range of a Function?
- Closed Domain
- Frequency Domain
- Domain of Integration
- Interval Domain
What is a Domain and Range?
- The domain is the set of x-values that can be put into a function. In other words, it’s the set of all possible values of the independent variable.
- The range is the set of y-values that are output for the domain.
- The codomain is similar to a range, with one big difference: A codomain can contain every possible output, not just those that actually appear.
Watch the video for a quick overview:
How to Find the Domain and Range of a Function
1. Check for Known Domains/Ranges
See if you can figure out what type of function you have first (this isn’t always clear).
Many functions have an infinite set for the domain. An “infinite set” is just the set of all possible numbers. For example, you could input any number you like into the function y = x2, and it will still give you an output. But what about the range? A negative number will never show for this function; a negative times a negative will always be positive. If you put, for example, -10 in, you get:
y = -102 = -10 * -10 = 100.
It makes sense that the range for x2 is 0 > ∞.
Certain functions have defined domains and range. A brief summary is below, or check out our playlist on YouTube which has a series of very short videos on finding domains and ranges for a variety of functions.
- Linear functions usually have the domain and range of all real numbers. See: Linear Functions (Video).
- Polynomial functions have the domain of all reals. The range depends on the degree and leading coefficient. See: Polynomial functions.
- Square (quadratic) functions have a domain of all real numbers. The range depends on the sign of the leading coefficient: y ≥ min (+) or y ≥ max, (-). See: Quadratic functions.
- Absolute value functions have a domain of all real numbers. The range depends on the vertex and sign of the absolute value expression. See: Absolute value function.
- The Square root function has a domain of x ≥ 0 and a range of y ≥ 0. For other square roots functions like √(x – 5), see: Square root and radical functions.
- Rational functions f(x) = 1/x have a domain of x ≠ 0 and a range of x ≠ 0. If you have a more complicated form, like f(x) = 1 / (x – 5), you can find the domain and range with the inverse function or a graph. See: Rational functions.
- Sine functions and cosine functions have a domain of all real numbers and a range of -1 ≤ y ≤ 1.
Tip: Become familiar with the shapes of basic functions like sin/cosine and polynomials. That way, you’ll be able to reasonably find the domain and range of a function just by looking at the equation.
2. Guess and Check
If you don’t have strong algebra skills, you may want to skip this method and try the graph or table methods instead.
Basically, use your algebra skills to find the domain and range for a function by guessing and checking! Some general tips:
- Division by zero is not allowed). As an example, let’s say you have the function:
f(x) = 1/(x2 – 9).
You can exclude any values of x (the domain) that make the denominator equal to zero.
- For a domain, the number under a square root sign can’t be negative. For example, you can’t find the domain for √-10, because the solution is an imaginary number.
- Try putting different x-values into the function for y to see what happens. Look for trends like: always positive, always negative, or sets of numbers that don’t work. Try putting in very large (e.g. a million), or very small (e.g. negative million) and see if those work.
Example: Find the domain and range of a function with algebra
Find the domain and range for:
- The numerator has a square root; numbers under this can’t be negative (see #2 above). So you can only have numbers for x greater than or equal to -2.
- The denominator: You can’t have division by zero, you can’t have -3 + 3 as this would result in zero. For example, 32 – 9 = 0.
The domain for this particular function is x > -2, x ≠ 3.
The range for this function is the set all values of f(x) excluding F(x) = 0. Here’s where your algebra skills get a workout!
- Numerator: By looking at the function, you should immediately see that the numerator becomes 0 when x = -2:
√(2 + 2) = √0 = 0.
- Working with -2 still, the denominator becomes: (-2)2 – 9 = 5.So f(-2) = 0/-5 = 0.
- If you insert a few x-values between 2 and 3 into (x2 – 9), you’ll see that the function approaches negative infinity.
- Insert some more x-values greater than x = 3, note that the function tends toward positive infinity.
- The larger the x-values get, the smaller the function values get (but they never actually get to zero).
Graph your function and see where your x-values and y-values lie. Most graphing calculators will help you see a function’s domain (or indicate which values might not be allowed). For example, if you graphed x2, it would be clear that the domain cannot include negative numbers. If you don’t have a graphing calculator, try this free online one. Always zoom in and zoom out of the graph to check for continuity or missing areas.
From the above graph, you can see that the range for x2 (green) and 4x2+25 (red graph) is positive; You can take a good guess at this point that it is the set of all positive real numbers, based on looking at the graph.
4. find the domain and range of a function with a Table of Values
Make a table of values on your graphing calculator (See: How to make a table of values on the TI89).
Include inputs of x from -10 to 10, then some larger numbers (like one million). Use the calculator to find values of y for values of x. If the calculator tells you the values or undefined, or that the values might be reaching a limit (a number that a function approaches, but never reaches), that should help you determine the range.
Definition of a Range (Statistics)
In statistics, the range is a measure of spread: it’s the difference between the highest value and the lowest value in a data set. To find it, subtract the smallest number from the largest.
For a few specific examples of finding statistical ranges, see: How to Find a Range in Statistics.
Other Meanings of “Range”
In calculus, the range is all of the output values of a function. In some areas of math, the range can—perhaps confusingly— also mean simply the entire range of numbers—for example, the range of cell phone prices might be $40 to $550. Evans et. al (2000, p. 5.) and Feller (1968, p. 200) use the term “range” to mean “domain”.
A closed domain is a domain that contains all of its boundary points. If the domain contains a set of all interior points (excluding the boundary), the domain is an open domain. A non-closed domain (which isn’t the same thing as an open domain) contains some of the boundary points, but not all of them.
If the domain contains all points within a bounded distance from the origin, it’s called a bounded domain. An unbounded domain has points that are not inside the boundary; In other words, they are an arbitrary distance from the origin.
A continuous function on a bounded, closed domain D, will have a maximum value and a minimum value on D.
Closed Domain in Other Contexts
In artificial intelligence, “closed domain” refers to a situation specific system in question answering (QA). For example, a system called AIRPLANE might be good at answering questions about air speed, acceleration and capacity of specific aircraft, it isn’t very good beyond that specific area. An open-domain QA on the other hand, is able to sift through an unlimited domain to find the answer to a question.
In software engineering, a closed domain is simply a domain where all boundaries are closed. An open domain is one where all boundaries are open.
Integrally closed domains are found in commutative algebra. An integrally closed domain A is an integral domain (a nonzero commutative ring where the product of any two nonzero elements is also nonzero) whose integral closure in its field of fractions is A itself.
What is a Codomain?
A codomain (or target set) contains all values (outputs) of a function.
When we say that a function f: X → Y, (which means “a set of X values outputs to a set of Y values”) the codomain is the Y. In other words, the output from a function is constrained to the codomain.
The range is similar, but the difference is that a range is the set of the actual values of the function (the actual outputs). A codomain or target set can contain every possible output, not just those that actually appear. For example, you might specify that a codomain is “the set of all real numbers (ℝ)”. However, that doesn’t mean that all real numbers are outputs for your function.
A Graphical View of a Codomain
The image below summarizes the relationship between a domain, co-domain, and range.
- The red oval is the domain. Every input for the function f is a member of this domain and can be represented by x.
- The blue oval (considered as a whole, inclusive of the yellow subsection) is the codomain. This represents every possible number that the output could take on. Every instance of the domain is mapped by the function f into this codomain.
- The yellow oval, a subset of this target domain, is the range and contains every actual instance of f(x).
Examples of a Codomain
Take the function f(x) = x2, constrained to the reals, so f: ℝ → ℝ.
Here the target set of f is all real numbers(ℝ), but since all values of x2 are positive*, the actual image, or range, of f is ℝ+0.
*Any negative input will result in a positive (e.g. -2 * -2 = +4).
Target Sets and Composition
Target sets become crucial when we begin to start discussing compositions of functions. The composition “f∘g” is read ‘f of g’ or ‘f following g’, and is a composite function that involves taking a member of the domain of g, sending it through the function g, and putting that output through f.
A composition is valid if and only if the co-domain of the second function is the same as the domain of the first function. In our example, the composition is only valid if the codomain of g is the same as the domain of f.
Frequency domain analysis is where a signal is studied with respect to frequency, rather than with respect to time. The data being studied is plotted with frequency on the x axis and amplitude on the y axis; this shows how the signal’s energy is distributed as a function of frequency.
A function can be represented by either a time domain or a frequency domain; each is useful for different purposes. A time domain representation of a signal can be converted into a frequency representation using a Fourier transform or similar manipulation.
Importance and Use of Frequency Domain Analysis
The term first made its appearance in 1953, in communications engineering. Today, though, this analysis is used in many different fields, including:
- Remote sensing,
- Image processing,
- Electrical engineering,
Frequency domain analysis has been called a cornerstone of systems engineering, and is an important part of the toolbox of almost any scientist, engineer or statistician.
This representation often allows us to characterize a signal or series of signals using simple algebra, as opposed to the complicated differential equations that go with a time-domain representation of a signal. The easy calculations involved with manipulating these signals make it especially useful for engineers. Perhaps more importantly, a frequency based analysis allows you to see cyclic behavior that might not have been immediately obvious in a time domain representation.
Domain and Range: What is a Domain of Integration?
When you integrate over a closed interval [a, b] of some function, the interval is called the domain of integration. For example:
A domain of integration can be infinite (i.e. from -∞ to ∞), as the following improper integral shows:
Improper integrals can’t be calculated directly; They are calculated as limits of ordinary integrals.
Things get a little more complicate in three dimensions, but most of the time the area on the base of the object is the domain of integration.
How to Sketch a Domain of Integration
Drawing a domain for any integral is easy if you only have one integral (see Step 1 below for an example). For multiple integrals, if you break it down into steps it becomes a lot less challenging.
Example problem: Sketch the domain of integration for the following iterated integral:
Step 1: Draw the bounds of integration for the first integral. The bounds are given as x = 0 to 1, so:
Step 2: Draw the bounds of the second integral on the same graph from Step 1. Note: If the bounds of integration aren’t integers (the second integral here has e, Euler’s number), you may want to use a graphing calculator (I used the one at Desmos.com to draw this graph) so you can more easily sketch the shape.
Step 3: Find the shaded area that meets the definition of both integrals. For this example, you’re only shading the area from 0 to 1 that is also within [e, ex].
Generally speaking, an interval domain is a domain restricted to an interval . For example, inputs (e.g. x-values) for a particular function might be restricted to the interval [0, 1]. Intervals can be closed, open, or half-closed/half-open.
Interval Domain in Domain Theory
In domain theory, the term “interval domain”, first proposed by D.S. Scott in 1972 , is a way to approximate real numbers. It gets its name because the reals are divided into intervals for calculations.
Approximations are sometimes needed for calculations over uncountable spaces, such as the Reals (ℝ) or some function spaces. Interval domains are not as straightforward to define as the “intervals” you come across in calculus; Algebraic structures, which consist of a set plus one or more binary operations that to satisfy certain axioms, are needed to show the differences between the many equivalent (and non-equivalent) versions of interval domain .
Scott’s domain-theoretic framework for differential calculus was originally designed for single variable functions. It has more recently been extended to functions of several variables . This extension carries the interval domain to approximations of curves and surfaces .
Domain theory and algebraic structures are beyond the scope of this article, but if you’re interested then read Jess Blanck’s Computer Journal article Interval Domains and Computable Sequences: A Case Study of Domain Reductions .
Interval Domain: References
 Klippert, J. (1989). Advanced Advanced Calculus: Counting the Discontinuities of a Real-Valued Function with Interval Domain. Mathematics Magazine
Vol. 62, No. 1 (Feb., 1989), pp. 43-48 (6 pages)
 Scott, D.S. (1972) Lattice Theory, Data Types and Semantics. In
Rustin, R. (ed.), Formal Semantics of Programming Languages,
 Edalat, A. (1995a) Domain theory and integration. Theoretical Computer Science 151 163–193.
 Edalat, A. & Lieutier, A. (2004). Domain theory and differential calculus(functions of one variable). Math. Struct. in Comp. Science, vol. 14, pp. 771–802. c2004 Cambridge University PressDOI: 10.1017/S0960129504004359 Printed in the United Kingdom
 Blanck, J. (2012). Interval Domains and Computable Sequences: A Case Study of Domain Reductions. The Computer Journal (Sep. 5) from: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.409.2974&rep=rep1&type=pdf
Domain and Range: Other References
Cassidy, Steve. COMP449 Course Notes. Speech Recognition: Chapter 6. Frequency Dom. Analysis. Retrieved from http://web.science.mq.edu.au/~cassidy/comp449/html/ch06.html on June 15, 2018
Kulkarni. Frequency Dom. and Fourier Transforms. Retrieved from https://www.princeton.edu/~cuff/ele201/kulkarni_text/frequency.pdf on June 16, 2018.
Liu, G. Calculus of Several Variables. Retrieved August 31, 2020 from: https://www.math.ucla.edu/~azhou/teaching/18W/hw-solutions.pdf
MIT Department of Mechanical Engineering. 2.14 Handout; Introduction to Freq. Domain Processing. Retrieved from http://web.mit.edu/2.14/www/Handouts/FreqDom.pdf on June 16, 2018.
Qi, P. (2019). Answering Complex Open-domain Questions at Scale. Retrieved January 7, 2020 from: http://ai.stanford.edu/blog/answering-complex-questions/
Rogawski, J.(2007). Multivariable Calculus. W. H. Freeman.
Tian, J. Software Quality Engineering: Testing, Quality Assurance, and Quantifiable Improvement.
Zhou, A. Problem. Retrieved August 31, 2020 from: https://www.math.ucla.edu/~azhou/teaching/18W/hw-problems.pdf