

How to Identify Domain, Codomain, and Range of a Function with Visuals and Practice Problems
The concept of domain, codomain, and range of a function plays a key role in mathematics and is widely applicable to both real-life situations and exam scenarios. By understanding how inputs (domain) relate to possible and actual outputs (codomain and range), students develop the toolkit needed for advanced maths, science, and competitive exams like JEE or Olympiads.
What Is Domain, Codomain, and Range of a Function?
Domain, codomain, and range are core terms in functions and mapping. The domain is the set of all input values for which the function is defined. The codomain is the set of potential output values as declared when defining the function. The range is the actual set of output values that come out of the function when using the domain. You’ll find these ideas in topics such as set mapping, relation types, and visualizing input/output graphs.
Key Points and Formulae
Function notation: If \( f: A \to B \), then:
- Domain = \( A \)
- Codomain = \( B \)
- Range = set of all \( f(x) \) where \( x \) is in \( A \), i.e., \( \{f(x) | x \in A\} \subseteq B \)
Tabular Difference: Domain vs Codomain vs Range
Property | Domain | Codomain | Range |
---|---|---|---|
Definition | All possible inputs | All possible outputs (declared) | Actual outputs (from domain) |
Set notation | Usually "A" in \( f: A \to B \) | "B" in \( f: A \to B \) | Subset of codomain |
Depends on | Function definition | How the function is declared | Values actually achieved |
How to Find Domain, Codomain, and Range
- Look at the function formula, e.g., \( f(x) = \frac{1}{x-2} \).
Domain: Exclude values making denominator zero (\( x \ne 2 \)). So, Domain: \( \mathbb{R} \setminus \{2\} \).
- Codomain is usually stated. For example, “All real numbers”.
Codomain: \( \mathbb{R} \) (unless stated otherwise).
- Range: Find values actually possible by plugging in domain values or solving for \( y \).
For \( y = \frac{1}{x-2} \), solving for all real \( x \ne 2 \) gives \( y \ne 0 \), so Range: \( \mathbb{R} \setminus \{0\} \).
Examples by Function Type
Function | Domain | Codomain (typical) | Range |
---|---|---|---|
\( f(x) = 2x + 1 \) | \( \mathbb{R} \) | \( \mathbb{R} \) | \( \mathbb{R} \) |
\( f(x) = x^2 \) | \( \mathbb{R} \) | \( \mathbb{R} \) | \( [0, \infty) \) |
\( f(x) = \sqrt{x} \) (real numbers) | \( [0, \infty) \) | \( \mathbb{R} \) | \( [0, \infty) \) |
\( f(x) = \frac{1}{x} \) | \( \mathbb{R} \setminus \{0\} \) | \( \mathbb{R} \) | \( \mathbb{R} \setminus \{0\} \) |
\( f(x) = \sin x \) | \( \mathbb{R} \) | \( \mathbb{R} \) | \( [-1, 1] \) |
Step-by-Step Solution Example
Find the domain, codomain, and range for \( f(x) = \sqrt{3 - x} \).
1. Check for which \( x \) values expression inside root is non-negative: \( 3 - x \geq 0 \)2. So, \( x \leq 3 \). Domain: \( (-\infty, 3] \)
3. Codomain: Typically all real numbers unless specified. Here, \( f(x) \) produces only non-negative numbers, so codomain can be \( \mathbb{R} \) or \( [0, \infty) \).
4. Range: Output values are from \( 0 \) (when \( x = 3 \)) up to \( \sqrt{3 - x} \to \infty \) as \( x \to -\infty \), but the square root of a real number at its maximum is \( \sqrt{3} \) (when \( x = 0 \)). Actually, as \( x \) goes from \( -\infty \) to 3, \( \sqrt{3 - x} \) goes from very large to 0. So, Range: \( [0, \sqrt{3}] \).
Quick Revision Table
Function Type | Domain | Range |
---|---|---|
Linear (\( ax + b \)) | \( \mathbb{R} \) | \( \mathbb{R} \) |
Quadratic (\( x^2 \)) | \( \mathbb{R} \) | \( [0, \infty) \) |
Rational (\( 1/x \)) | \( \mathbb{R} \setminus \{0\} \) | \( \mathbb{R} \setminus \{0\} \) |
Sqrt (\( \sqrt{x} \)) | \( [0, \infty) \) | \( [0, \infty) \) |
Trigonometric (\( \sin x \)) | \( \mathbb{R} \) | \( [-1, 1] \) |
Common Mistakes and Misunderstandings
- Assuming the range is always the same as the codomain (Range is a subset of codomain).
- Not checking for domain restrictions (e.g., negative inside a square root, zero in denominator).
- Ignoring the context when the codomain is different than the range.
- Forgetting that a function's domain is not always “all real numbers”.
Speed Trick: How to Spot Domain Fast in Exams
For rational functions, exclude values that make the denominator zero. For square roots in real numbers, make sure the expression inside is greater than or equal to zero. For trigonometric functions, check where outputs are undefined (e.g., tan x is undefined at odd multiples of \( \frac{\pi}{2} \)). Practicing with a domain codomain range calculator or summary tables saves revision time!
Try These Yourself
- Find the domain and range of \( f(x) = \sqrt{x - 1} \).
- If \( f(x) = \frac{2}{x+5} \), what are the domain and range?
- Sketch or list the mapping diagram for \( f: \{1, 2, 3\} \to \{3, 5, 6\} \) given by \( f(x) = 2x + 1 \).
Relation to Other Concepts
Knowing the domain, codomain, and range of a function builds a base for function types (injective, surjective), relations, and set theory. This is especially useful for Class 11–12, JEE, and competitive maths.
Classroom Tip
A good way to remember: “Domain Dives In, Codomain Covers Completely, Range is the Real Result”. Visual cues like arrow diagrams or Venn diagrams help make the differences clear. Teachers at Vedantu show plenty of mapping diagrams so students can see which outputs are “reached”.
We explored domain, codomain, and range of a function—from definitions, formulas, examples, mistakes, and connections to other subjects. To strengthen your mastery, try more solved examples and problem sets at Vedantu’s domain and range practice pages.
Useful Vedantu Links for Further Study
- Types of Functions
- Relations and Its Types
- Set Theory Symbols
- Onto Function
- Domain and Range of a Function Examples and Answers
FAQs on Domain, Codomain, and Range: Definitions, Differences & Examples
1. What is the difference between the domain, codomain, and range of a function?
The domain of a function is the set of all possible input values. The codomain is the set of all possible output values as defined by the function. The range is the actual set of output values obtained when the function is applied to every element in the domain. The range is always a subset of the codomain.
2. How can you identify the domain of a function from its equation?
To find the domain, determine all input values for which the function's formula produces a valid result. For example, avoid values that create division by zero or result in the square root of a negative number (when working with real numbers). Look for any restrictions on the independent variable (x) stated explicitly in the function definition.
3. Why is the range always a subset of the codomain in functions?
The range includes only the output values that result from applying the function to each element within the domain. The codomain is the larger set of possible outputs; the function may not map any input to every element in this set. Therefore, the range is a subset of, but not necessarily equal to, the codomain.
4. What are injective, surjective, and bijective functions?
An injective (one-to-one) function assigns each element of the domain to a unique element in the codomain. A surjective (onto) function maps at least one element from the domain to every element in the codomain. A bijective function is both injective and surjective—a one-to-one correspondence between the domain and codomain.
5. How does the concept of 'natural domain' help in solving real functions?
The natural domain is the set of all real numbers for which a given function is defined without any restrictions. Identifying the natural domain helps avoid inputs that lead to undefined operations (like division by zero or the square root of a negative number), ensuring correct solutions and graphs.
6. Can a function have the same domain and codomain, but a range that is different? Explain with an example.
Yes. Consider the function f(x) = x², where both the domain and codomain are the set of all real numbers. However, the range is only the set of non-negative real numbers since squaring any real number always yields a non-negative result.
7. How can you visually differentiate domain, codomain, and range on a function mapping diagram?
In a mapping diagram: the domain is represented by the set of elements on the left; the codomain is represented by the set of elements on the right; the range consists only of those elements in the codomain that are actually mapped to by arrows from the domain elements.
8. What common mistakes do students make when determining the range of a composite function?
Students often incorrectly assume the range of a composite function is the same as the codomain, without carefully considering the effect of the inner function on the output of the outer function. They might also fail to account for domain restrictions imposed by the inner function, which can limit the actual output values. Stepwise analysis is crucial.
9. Why is understanding the domain and range important in real-world applications of functions?
Understanding the domain ensures only valid inputs are used (e.g., time cannot be negative). Knowing the range helps predict possible outputs, ensuring the function's results are meaningful and applicable within the context of the real-world problem.
10. What distinguishes a partial function from a total function within the context of domain, range, and codomain?
A total function assigns every element in its domain to an element in its codomain. A partial function is only defined for some elements of its potential domain; for others, it has no defined output. This distinction is crucial for precise problem-solving.
11. How do you find the range of a function graphically?
Graphically, the range of a function can be identified by observing the y-values (vertical axis) covered by the graph. The range consists of all the y-coordinates that the graph passes through. Look for the lowest and highest y-values reached by the graph to define the range's boundaries.

















