# Domain, Range, and Codomain of a Function

When working with quantitative relationships, three concepts help “set the stage” in your thinking as you seek to understand the relationship’s behavior: domain, range, and codomain.

### Domain

The “domain” of a function or relation is:

• the set of all values for which it can be evaluated
• the set of  allowable “input” values
• the values along the horizontal axis for which a point can be plotted along the vertical axis

For example, the following functions can be evaluated for any value of  “x”:

$f(x)=2x+1\\*~\\*g(x)=x^2+5$

therefore their domains will be “the set of all real numbers”.

The following functions cannot be evaluated for all values of “x”, leading to restrictions on their Domains – as listed to the right of each one:

$h(x)=\dfrac{1}{x}~~~~~~~~~\text{x cannot be zero}\\*~\\*j(x)=\dfrac{1}{(x-2)(x+4)}~~~~~~\text{x cannot be 2 or -4}\\*~\\*k(x)=3x+2,~1

The values for which a function or relation cannot be evaluated are called “domain restrictions“, and they usually arise either because:

1. The person defining the function wished to exclude them, such as when creating a piecewise function.  The function k(x) above is an example of this situation.
2. The result of the function would be “undefined” for that value, such as when a value of “x” would require us to divide by zero at some point while evaluating the function.  Functions h(x) and j(x) above are examples of this situation.

When graphing a function or relation, domain restrictions will result in a “hole” in the graph: one or more values on the horizontal axis for which no point can be graphed along the vertical axis.

Some holes in a graph correspond to the location of an “asymptote“: a line that the graph gradually approaches, and gets infinitely close to, but never crosses. If you examine the graphs of h(x) and j(x) as defined above, they will both exhibit this behavior at their domain restrictions, while k(x) does not.

### Range

The “range” of a function or relation is:

• the set of all values that it can produce
• its “output” set of values
• the set of values along the vertical axis for which a point can be plotted on its graph

Range restrictions usually occur due to the nature of the function or the relation… they are not usually imposed by the author, as is often done with domain restrictions (such as in k(x) above). For example:

• f(x) above does not have any restrictions to its Range… it can produce all real numbers. Therefore its Range is “the set of all Real numbers”.
• g(x) above does not produce a real number less than 5 (since x squared can never be less than zero), therefore the Range of g(x) is “all real numbers greater than or equal to five”.

Note that the word “range” has a number of possible uses in the English language, many of which do NOT refer to “the range of a function”. So, please read questions carefully to determine what the word “range” refers to in the question. If you are being asked for the “range of a function” – the above description applies. However, if you are being asked for the “range of possible values for a coefficient”, then you are NOT being asked for the “range” as defined above.

### Codomain

The “codomain” of a function or relation is a set of values that includes the Range as described above, but may also include additional values beyond those in the range.

Codomains can be useful when:

• You need to restrict the output of a function. For example, by specifying a codomain to be “the set of positive Real numbers”, you are instructing any who use the function to ignore any negative values it produces.
• The Range might be difficult to specify exactly, but a larger set of numbers that includes the entire Range can be specified. For example, a codomain could specify the set of all positive Real numbers, even though the function does not generate all possible positive Real numbers.

If the Range is difficult to specify, thinking about a Codomain can serve the same purpose as thinking about the Range: thinking about which values the function or relation can, and cannot, produce helps one understand the overall behavior of the function or relation.

### Why bother with Domain and Range (or Codomain)?

While “domain”, “codomain”, and “range” are indeed “three more vocabulary terms you should know”, they are also useful concepts to master: thinking about them helps you understand the behavior of a function or relation. By determining the domain and range (or codomain) of a function before you begin to graph it, you will usually develop a mental image of the function that can help you avoid making errors, or wasting space, on your graph paper when graphing the function.

The knowledge that a function “never produces a value less than 5”, as is the case with g(x) above, will affect your choice of values to display along the vertical axis, as well as where you place the origin of your graph. Thinking about the domain and range (or co-domain) of a function before starting to use or graph it will improve your understanding of how it behaves, and should help you work more efficiently.

### Whit Ford

Math tutor since 1992. Former math teacher, product manager, software developer, research analyst, etc.

## 11 thoughts on “Domain, Range, and Codomain of a Function”

1. Thank you for the example!

Question “c” in this problem uses the term “Range” consistently with how it is used in the context of Functions as a whole.

However, questions “a” and “b” apply the term to coefficients in the problem, not the result (or output) of the function as a whole. This is a fair use of the word, and I cannot think of a better word or phrase to use in this situation.

Therefore, students should be careful to interpret the word “Range” in context. My post above describes the “Range of a Function”, or the “Range of a Relation”, as the set of possible output values. Two questions in your problem are asking for the “Range of allowable values for a parameter”, which is a very different question! One which also makes appropriate use of the same word…

1. Very nice explanation of domain and range! I recently also created a guide to these concepts (http://sk19math.blogspot.com/2013/03/domain-and-range.html), though I now realize that I neglected to specifically mention the term “domain restrictions,” though I believe I touched on the subject. I will have to go back and write a bit more, I guess. Thanks for the great post!

2. Why the neglect for the codomain? (http://en.wikipedia.org/wiki/File:Codomain2.SVG) I think it’s an opportunity to teach and reinforce a few good habits, and I think leaving it out creates a flawed view of a function that may cause confusion (however momentary) in the future…

By mentioning the codomain, it provides a useful way of defining a formal function (specifying its domain, codomain, and mapping procedure) and pins down the set theoretic perspective that functions map a set of inputs into a set of outputs. The range or image then is just a subset of the codomain, being the only realizable outputs for certain inputs. For this function with the same domain and codomain f: R->R, f(x) = x^2 the range is different, being the subset R+.

Maybe it’s not so useful a concept at this level, but it becomes more useful in linear algebra later. It’s also useful for making it obvious that a function maps to a lower/higher dimension, e.g. f: R^2 -> R, f(x,y) = x + y, or perhaps some function that takes a vector X as input and involves ∇·X in the mapping…

1. Good point! Co-Domains are seldom mentioned in high school classrooms, probably because they introduce a potential confusion at a time when students are just beginning to grapple with two concepts that are completely new to them (domain and range).

I will revisit this post next week and see if I can work the idea in.

Thank you!

3. nitish malang says:

how to understand which sign is used i have seen in book sometimes= sign is used sometimes< sign is used sometimes this sign is used >
how to understand what is this condition

1. Nitish,

= is called an “equal sign”, and means that the expression to its left “always has the same value as” the expression to its right.

> is called a “greater than sign”, and means that the expression to its left “always has a value greater than” the expression to its right.

< is called a “less than sign”, and means that the expression to its left “always has a value less than” the expression to its right.

Expressions that include < or > are called “inequalities”, because the left side is NOT equal to the right side. You can work with inequalities in very much the same way as you work with equalities, with one exception: when multiplying or dividing both sides by a negative quantity, you must change the direction of the inequality sign.

So, some examples:

3 < 5
3+2 < 5+2
5 < 7
(-1)(5) > (-1)(7)
-5 > -7

Inequalities are often used when specifying domains and ranges because they allow you easily specify a range of numbers. For example,

x > 3
means that the variable “x” can have any value greater than (but not equal to) 3.

x >= 3
means that the variable “x” can have any value 3 or greater (including 3).

2. Lucy Heartfilia says:

Is Codomain the same with counterdomain? or are they different terms?

1. Lucy,

I am not aware of the term “counterdomain”, and it does not produce any results when I searched various general and math-specific sites on the internet. Where have you come across this term?

Given I have not found uses of the term, I suspect it may not be synonymous with “codomain”.

4. Benita says:

What Exactly Is Co-domain,Element And Image

1. Benita,

Hopefully you are familar with the idea of “a set” of numbers, like the Integers, or the Real Numbers. An “element” is one member of a set. For example, 7 is an element of the Integers.

A function maps elements of its Domain to elements of its Range. Its Range is a sub-set of its Codomain. For example the function $f(x)~=~x^2$ has a Domain that consists of the set of all Real Numbers, and a Range of all Real Numbers greater than or equal to zero. f(x) maps the Element 7 (of the Domain) to the element 49 (of the Range, or of the Codomain).

The Codomain can be a larger set than the Range, and is used when the exact Range can be hard to specifiy. For example, if I did not understand the function f(x) well, and did not realize it can never generate a negative number, I might define its Codomain to be the set of all Real Numbers. This does include all possible results of the function, but turns out to be larger than the Range.

A function maps an Element of the Domain to its Image, which will be an Element of both the Codomain and the Range. In the example above, 49 is the Image of 7.