NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

Functions: Domain, Codomain and Range Explained | NIMCET

Learn what a function is, how it differs from a relation, how to find the domain and range, and the standard real functions such as modulus, greatest integer and signum, for NIMCET.

5 min read

SP

SHIVAM PRADHAN

Updated 25 October 2026

On this page

Quick answer: A function f:A→Bf : A \to B is a relation in which every element of A is paired with exactly one element of B. A is the domain, B the codomain, and the set of actual outputs f(A)f(A) is the range, so range ⊆ codomain. To find the domain of a real function, remove values that make a denominator zero, an even root negative, or a logarithm's argument non-positive.

Functions are special relations; see types of relations for the general idea.

Function or not?

A relation from A to B is a function when:

  • every element of A has an image, and
  • no element of A has two different images.
Relation on A = {1, 2, 3} to B = {p, q}Function?
{(1,p),(2,q),(3,p)}\{(1, p), (2, q), (3, p)\}Yes
{(1,p),(2,q)}\{(1, p), (2, q)\}No, 3 has no image
{(1,p),(1,q),(2,p),(3,q)}\{(1, p), (1, q), (2, p), (3, q)\}No, 1 has two images

Vertical line test: a curve is the graph of a function of x if every vertical line meets it at most once.

Number of functions from A to B with n(A)=mn(A) = m and n(B)=nn(B) = n is nmn^m.

Finding the domain

Expression containsCondition
1g(x)\frac{1}{g(x)}g(x)≠0g(x) \ne 0
g(x)\sqrt{g(x)}g(x)≥0g(x) \ge 0
1g(x)\frac{1}{\sqrt{g(x)}}g(x)>0g(x) > 0
log⁡g(x)\log g(x)g(x)>0g(x) > 0
sin⁡−1g(x)\sin^{-1}g(x) or cos⁡−1g(x)\cos^{-1}g(x)−1≤g(x)≤1-1 \le g(x) \le 1

For sums and products of functions, the domain is the intersection of the individual domains.

Example: f(x)=x−1+1x−3f(x) = \sqrt{x - 1} + \frac{1}{x - 3} needs x≥1x \ge 1 and x≠3x \ne 3, so the domain is [1,3)∪(3,∞)[1, 3) \cup (3, \infty).

Finding the range

Common methods:

  1. Write y=f(x)y = f(x), solve for x, and find the values of y for which x is real and in the domain.
  2. Use known bounds, such as −1≤sin⁡x≤1-1 \le \sin x \le 1 or x2≥0x^2 \ge 0.
  3. Complete the square for quadratics.

Example: Range of f(x)=xx+1f(x) = \frac{x}{x + 1}, x≠−1x \ne -1.

Step 1: y(x+1)=xy(x + 1) = x, so x=y1−yx = \frac{y}{1 - y}.

Step 2: This is defined for every y≠1y \ne 1. Range: R−{1}\mathbb{R} - \{1\}.

Standard real functions

FunctionRuleDomainRange
Identityf(x)=xf(x) = xℝℝ
Constantf(x)=cf(x) = cℝ{c}\{c\}
Modulus∣x∣\lvert x\rvertℝ[0,∞)[0, \infty)
Greatest integer[x][x], the largest integer ≤ xℝℤ
Signum11 if x>0x > 0, 00 if x=0x = 0, −1-1 if x<0x < 0ℝ{−1,0,1}\{-1, 0, 1\}
Reciprocal1x\frac{1}{x}R−{0}\mathbb{R} - \{0\}R−{0}\mathbb{R} - \{0\}
Square rootx\sqrt{x}[0,∞)[0, \infty)[0,∞)[0, \infty)
Exponentialaxa^x, a>0a > 0, a≠1a \ne 1ℝ(0,∞)(0, \infty)
Logarithmlog⁡ax\log_a x(0,∞)(0, \infty)ℝ

Greatest integer function facts

  • [2.7]=2[2.7] = 2 and [−2.7]=−3[-2.7] = -3.
  • [x+n]=[x]+n[x + n] = [x] + n for any integer nn.
  • x−1<[x]≤xx - 1 < [x] \le x.
  • The fractional part {x}=x−[x]\{x\} = x - [x] lies in [0,1)[0, 1).

Worked examples

Example 1: domain with a logarithm

Find the domain of f(x)=log⁡(4−x2)f(x) = \log(4 - x^2).

4−x2>04 - x^2 > 0, so −2<x<2-2 < x < 2. Domain: (−2,2)(-2, 2).

Example 2: range by bounds

Find the range of f(x)=3+2sin⁡xf(x) = 3 + 2\sin x.

Since −1≤sin⁡x≤1-1 \le \sin x \le 1, the range is [1,5][1, 5].

Example 3: counting functions

How many functions are there from a 3-element set to a 2-element set?

23=82^3 = 8.

Example 4: greatest integer equation

Solve [x]=3[x] = 3.

3≤x<43 \le x < 4, so x∈[3,4)x \in [3, 4).

Summary table

IdeaKey point
FunctionEach input has exactly one output
Range vs codomainRange ⊆ codomain
Domain rulesNo zero denominators, no negative even roots, log argument > 0
Number of functionsnmn^m
[x][x]Largest integer ≤ x

Exam tips

  • For domain questions, list every restriction and take the intersection.
  • For range questions, solving for x in terms of y is the most reliable method.
  • Be careful with negative numbers in [x][x]: [−0.5]=−1[-0.5] = -1.

Next, read one-one, onto and composite functions, or browse the NIMCET Set Theory chapter.

Common mistakes

  • Treating the codomain as the range.
  • Forgetting x≠x \ne values that make the denominator zero after simplifying.
  • Writing [−2.3]=−2[-2.3] = -2 instead of −3-3.
  • Counting functions from A to B as mnm^n instead of nmn^m.

Frequently Asked Questions

What is the difference between codomain and range?

The codomain is the set B in f : A → B. The range is the set of outputs actually produced, which is a subset of the codomain.

How do you find the domain of a function?

Find all real x for which the expression is defined: no zero denominators, no negative values under even roots, and positive arguments for logarithms.

How many functions are there from A to B?

If n(A) = m and n(B) = n, there are nᵐ functions.

What is the greatest integer function?

[x] is the largest integer less than or equal to x. For example, [2.7] = 2 and [−2.7] = −3.

Is every relation a function?

No. A relation is a function only if every element of the domain has exactly one image.

Concept Check

MEDIUM

The sum of the areas of two squares is 468 m2468\text{ m}^2. If the difference of their perimeters is 24 m24\text{ m}, what are the side lengths of the two squares?

Suggested for you