
Definition of Domain Codomain and Range with Examples and How to Find Them
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 of Functions in Mathematics
1. What is the domain of a function?
The domain of a function is the set of all input values (usually x-values) for which the function is defined.
In simple terms:
- It includes every value you can substitute into the function.
- It excludes values that make the function undefined (like division by zero).
2. What is the codomain of a function?
The codomain of a function is the set of all possible output values that are allowed according to the function’s definition.
Key points:
- The codomain is specified when the function is defined.
- It may include values the function never actually produces.
3. What is the range of a function?
The range of a function is the set of all actual output values the function produces from its domain.
In other words:
- Range = outputs you actually get.
- It is always a subset of the codomain.
4. What is the difference between domain, codomain, and range?
The domain is the set of inputs, the codomain is the set of allowed outputs, and the range is the set of actual outputs produced.
Comparison:
- Domain: All valid x-values.
- Codomain: Declared set of possible y-values.
- Range: Actual y-values obtained.
5. How do you find the domain of a function?
To find the domain of a function, identify values that make the expression undefined and exclude them.
Steps:
- Avoid division by zero.
- For square roots, ensure the expression inside is ≥ 0.
- For logarithms, ensure the argument is > 0.
6. How do you find the range of a function?
To find the range of a function, analyze how the output behaves as the input varies over the domain.
Common methods:
- Rewrite the function in a known form (like vertex form).
- Use graphs to observe output values.
- Check maximum and minimum values.
7. Can the range and codomain be different?
Yes, the range and codomain can be different because the codomain includes allowed outputs, while the range includes actual outputs.
Example:
- If f: ℝ → ℝ is defined by f(x) = x²,
- Codomain = all real numbers.
- Range = y ≥ 0.
8. What is the domain and range of a quadratic function?
For a quadratic function f(x) = ax² + bx + c, the domain is all real numbers, and the range depends on the vertex.
Details:
- Domain: (−∞, ∞)
- If a > 0, range is y ≥ minimum value.
- If a < 0, range is y ≤ maximum value.
9. What is the domain and range of a rational function?
For a rational function, the domain excludes values that make the denominator zero, and the range depends on the function’s behavior.
Example: For f(x) = 1/(x − 2):
- Domain: x ≠ 2
- Range: y ≠ 0
10. Why is the domain important in functions?
The domain is important because it determines where a function is valid and prevents undefined or meaningless results.
Reasons:
- Ensures calculations are mathematically correct.
- Defines the scope of the function.
- Helps in graphing and real-life modelling.





















