Functions
NCERT Class 11 Mathematics Chapter 2 Section 2.4
Quick answer
A function f from a set A to a set B is a relation in which every element of A has exactly one image in B; we write f : A → B, and f(a) = b when b is the image of a. A is the domain, B the codomain, and the set of images is the range. Real functions can be added, subtracted, multiplied and divided (where g(x) ≠ 0) value by value, for example (f + g)(x) = f(x) + g(x).
With your textbook
NCERT Mathematics (Class 11), Chapter 2 “Relations and Functions”, Section 2.4 “Functions”, pages 30–38.
Open the official NCERT chapter (PDF, 2.0 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
What is a function?
Function
A relation f from a set A to a set B is said to be a function if every element of set A has one and only one image in set B.
NCERT Mathematics (Class 11), Section 2.4, page 30
- We write f : A → B and f(a) = b when (a, b) ∈ f.
- A is the domain of f, B is its codomain, and the set of all images is its range; the range is a subset of B.
In plain words: a function is a rule that takes each input from A and gives back exactly one output in B. Two things can go wrong, and either one stops a relation from being a function: some element of A has no image, or some element of A has two or more images. Two inputs sharing the same output is allowed.
In other words, a function f is a relation from a non-empty set A to a non-empty set B such that the domain of f is A and no two distinct ordered pairs in f have the same first element.
NCERT Mathematics (Class 11), Section 2.4, page 30
If f is a function from A to B and (a, b) ∈ f, then f (a) = b, where b is called the image of a under f and a is called the preimage of b under f.
NCERT Mathematics (Class 11), Section 2.4, page 30
Which relations are functions?
NCERT checks its earlier relations (page 31):
- y = x + 1 on {1, 2, 3, 4, 5, 6} (Example 7, drawn as an arrow diagram) is not a function: 6 has no image.
- “x is the square of y” (Example 8, see domain and range) is not a function: 9 has two images, 3 and −3.
- The relation y = 2x on N (Example 10) is a function: every natural number has exactly one double. Its domain and codomain are N, and its range is the even natural numbers. A function with domain N is a sequence: this one lists the even numbers 2, 4, 6, … in order.
In NCERT Example 11, R = {(2, 1), (3, 1), (4, 2)} is a function (each first entry appears once, and 2 and 3 sharing the image 1 is fine), while R = {(2, 2), (2, 4), (3, 3), (4, 4)} is not, because 2 has the two images 2 and 4.
When a function is drawn as a graph, the same test becomes the vertical line test: a curve is the graph of a function of x exactly when no vertical line meets it more than once; for f : A → B, every line x = a with a ∈ A must meet it exactly once. A vertical line x = a that meets the curve twice means two outputs for the one input a.
Real functions, domain and range
A function which has either R or one of its subsets as its range is called a real valued function. Further, if its domain is also either R or a subset of R, it is called a real function.
NCERT Mathematics (Class 11), Section 2.4, page 31
Most functions in this chapter are real functions given by a formula, such as f(x) = 2x + 1 (NCERT Example 12: f(1) = 3, f(2) = 5, …, f(7) = 15). Domains and ranges are often intervals, such as [0, ∞) for the non-negative real numbers.
Finding the domain. When only the formula is given, the domain is taken to be every real x for which the formula gives a real number. Two rules cover most questions:
- a denominator must not be 0;
- the expression under a square root must be ≥ 0; for √(x − 2) that is the inequality x − 2 ≥ 0, so x ≥ 2.
NCERT Example 21 (page 39): f(x) = (x2 + 3x + 5)/(x2 − 5x + 4). The denominator factorises as (x − 4)(x − 1), so it is 0 at x = 1 and x = 4, and the domain is R − {1, 4}.
Finding the range. Set y = f(x) and ask which values of y actually occur. For f(x) = 3 − x2, x2 takes every value ≥ 0, so y takes every value ≤ 3: the range is (−∞, 3]. When the formula can be solved for x, solve it and see which y give an allowed x (Example 4 below).
Some functions and their graphs
NCERT Section 2.4.1 (pages 32–36) draws seven standard real functions. Each graph below is the set of points (x, f(x)) in the plane R × R, plotted from its equation.
Identity function, f(x) = x: domain and range R; its graph is the straight line through the origin at 45° to the axes when both axes use equal scales.
Constant function, f(x) = c: domain R, range {c}; its graph is a line parallel to the x-axis, at height 3 for f(x) = 3.
Polynomial function: f(x) = a0 + a1x + a2x2 + … + anxn, where n is a non-negative integer and the coefficients are real (NCERT page 33). x3 − x2 + 2 and x4 + √2 x are polynomial functions; x2/3 + 2x is not, because the power 2/3 is not a whole number.
- f(x) = x2 (NCERT Example 13): domain R; range {x2 : x ∈ R}, that is, all non-negative reals, [0, ∞).
- f(x) = x3 (NCERT Example 14): f(±1) = ±1, f(±2) = ±8, f(±3) = ±27. Domain and range R.
Rational function: f(x)/g(x), where f and g are polynomials, defined where g(x) ≠ 0 (NCERT page 34). For f(x) = 1/x (NCERT Example 15), domain and range are both R − {0}: 1/x is never 0, and any y ≠ 0 is reached at x = 1/y. The dots in the second figure are values from NCERT’s table.
Modulus function, f(x) = |x|. Domain R; range [0, ∞).
Modulus function
|x| = x, for x ≥ 0
|x| = −x, for x < 0
On the number line, |x| is the distance of x from 0 and |x − a| its distance from a, the idea behind the mean deviation in statistics.
Signum function, often written sgn x:
Signum function
sgn x = 1, for x > 0
sgn x = 0, for x = 0
sgn x = −1, for x < 0
Domain R; range {−1, 0, 1} (NCERT page 36). For x ≠ 0 it equals |x|/x. The caption of NCERT Fig 2.14 says exactly this, but a misprint shows a stray mark where the ≠ sign should be.
Greatest integer function, f(x) = [x]: the greatest integer less than or equal to x. So [x] = −1 for −1 ≤ x < 0, [x] = 0 for 0 ≤ x < 1, [x] = 1 for 1 ≤ x < 2, and so on (NCERT page 36). For example [2.7] = 2, [5] = 5 and [−2.7] = −3, not −2. Domain R; range Z, the integers.
Linear function: f(x) = mx + c, with m and c constants; its graph is a straight line of slope m. NCERT Example 18 (page 38) draws f(x) = x + 10, which passes through (0, 10) and (−10, 0). NCERT Example 20 (page 39) finds a linear function from four of its pairs; try it as Q6 below. (NCERT’s solution writes “(1, 1), (0, −1) ∈ R” where it means ∈ f; there is no relation R in that example.)
A function can use different formulas on different parts of its domain. NCERT Example 22 (page 39) defines
NCERT Example 22
f(x) = 1 − x, for x < 0
f(x) = 1, for x = 0
f(x) = x + 1, for x > 0
This is the same as f(x) = 1 + |x|: a V with its corner at (0, 1).
The trigonometric functions of the next chapter, sin x, cos x and the rest, are further real functions with graphs of their own.
Algebra of real functions
Real functions with a common domain X ⊂ R can be combined value by value (NCERT Section 2.4.2, pages 36–37). For f, g : X → R and a real number α:
Algebra of real functions
(f + g)(x) = f(x) + g(x)
(f − g)(x) = f(x) − g(x)
(αf)(x) = α f(x)
(fg)(x) = f(x) g(x)
(f/g)(x) = f(x)/g(x), where g(x) ≠ 0
This is also called pointwise multiplication.
NCERT Mathematics (Class 11), Section 2.4.2, page 37
The domain of f/g leaves out every x with g(x) = 0, even when f(x) = 0 there too.
NCERT Example 16 (page 37): f(x) = x2 and g(x) = 2x + 1.
- (f + g)(x) = x2 + 2x + 1 and (f − g)(x) = x2 − 2x − 1;
- (fg)(x) = x2(2x + 1) = 2x3 + x2;
- (f/g)(x) = x2/(2x + 1), for x ≠ −1/2.
NCERT Example 17 (page 37): f(x) = √x and g(x) = x on the non-negative reals.
- (f + g)(x) = √x + x and (f − g)(x) = √x − x;
- (fg)(x) = x√x = x3/2;
- (f/g)(x) = √x/x = x−1/2, for x ≠ 0.
In JEE Main, real-valued functions, the algebra of functions, polynomial and rational functions and graphs of simple functions are in Unit 7; Unit 1 adds one-one, into and onto functions and the composition of functions, which are taught in the Class 12 NCERT book.
Solved examples
Example 1: Functions or not? (NCERT Exercise 2.3, Q1)
Which of these relations are functions? For each function give its domain and range. (i) {(2, 1), (5, 1), (8, 1), (11, 1), (14, 1), (17, 1)}; (ii) {(2, 1), (4, 2), (6, 3), (8, 4), (10, 5), (12, 6), (14, 7)}; (iii) {(1, 3), (1, 5), (2, 5)}.
Look for a first entry that appears twice. In (i) and (ii) every first entry appears once; in (iii) 1 appears twice.
Answer: (i) a function, domain {2, 5, 8, 11, 14, 17}, range {1}; (ii) a function, domain {2, 4, 6, 8, 10, 12, 14}, range {1, 2, 3, 4, 5, 6, 7}; (iii) not a function, since 1 has the two images 3 and 5.
Example 2: Domain and range from the formula (NCERT Exercise 2.3, Q2)
Find the domain and range of (i) f(x) = −|x|; (ii) f(x) = √(9 − x2).
(i) |x| is defined for every real x and takes every value ≥ 0, so −|x| takes every value ≤ 0. (ii) We need 9 − x2 ≥ 0, that is −3 ≤ x ≤ 3. On this interval 9 − x2 runs from 0 (at x = ±3) up to 9 (at x = 0), so its square root runs from 0 to 3.
Answer: (i) domain R, range (−∞, 0]; (ii) domain [−3, 3], range [0, 3].
Example 3: Ranges (NCERT Exercise 2.3, Q5)
Find the range of (i) f(x) = 2 − 3x, x ∈ R, x > 0; (ii) f(x) = x2 + 2, x real; (iii) f(x) = x, x real.
(i) x > 0 gives 3x > 0, so 2 − 3x < 2, and every value below 2 occurs (take x = (2 − y)/3). (ii) x2 ≥ 0, so x2 + 2 ≥ 2. (iii) Every real number is its own image.
Answer: (i) (−∞, 2); (ii) [2, ∞); (iii) R.
Example 4: Solving for x to find a range (NCERT Miscellaneous Exercise, Q6)
f(x) = x2/(1 + x2) for all real x. Find the range of f.
Put y = x2/(1 + x2). Then y + yx2 = x2, so x2(1 − y) = y. Here y = 1 is impossible (it would give 0 = 1), and otherwise x2 = y/(1 − y). A real x exists exactly when y/(1 − y) ≥ 0, that is 0 ≤ y < 1.
Answer: the range is [0, 1). The value 0 occurs at x = 0; values close to 1 occur for large x, but 1 itself never does.
Example 5: Two rules that must agree (NCERT Miscellaneous Exercise, Q1)
Show that f is a function and g is not, where
- f(x) = x2 for 0 ≤ x ≤ 3, and 3x for 3 ≤ x ≤ 10;
- g(x) = x2 for 0 ≤ x ≤ 2, and 3x for 2 ≤ x ≤ 10.
Each rule covers its own interval, so the only question is the point where the intervals overlap. For f, at x = 3: 32 = 9 and 3 × 3 = 9, so the two rules give the same single image. For g, at x = 2: 22 = 4 but 3 × 2 = 6.
Answer: f gives every x in [0, 10] exactly one image, so it is a function; g gives 2 two images, 4 and 6, so it is not (see the bottom panels of the third figure).
Example 6: Sum, difference and quotient (NCERT Miscellaneous Exercise, Q7)
f, g : R → R with f(x) = x + 1 and g(x) = 2x − 3. Find f + g, f − g and f/g.
Add, subtract and divide the values; for the quotient leave out the zero of g, x = 3/2.
Answer: (f + g)(x) = 3x − 2; (f − g)(x) = −x + 4; (f/g)(x) = (x + 1)/(2x − 3), for x ≠ 3/2.
Example 7: A rule with two answers (NCERT Miscellaneous Exercise, Q11)
Let f = {(ab, a + b) : a, b ∈ Z}. Is f a function from Z to Z?
The first entry ab does not determine a + b. Take a = 0: then ab = 0 for every b, while a + b = b changes. So (0, 1) and (0, 2) are both in f.
Answer: no; 0 has more than one image. (Another clash: 6 = 2 × 3 = 1 × 6 gives both (6, 5) and (6, 7).)
Common mistakes to avoid
Common mistake
Thinking two inputs may not share an output
A function may send different inputs to the same image: f(x) = x2 gives f(2) = f(−2) = 4. What is not allowed is one input with two images.
Common mistake
Calling the codomain the range
For f : R → R, f(x) = x2, the codomain is R but the range is only [0, ∞). The range is the set of values actually reached.
Common mistake
Rounding towards zero with [x]
[x] is the greatest integer not more than x, so for negative numbers it goes down: [−2.7] = −3, not −2. Dropping the decimal part works only for x ≥ 0 and for integers.
Common mistake
Simplifying before finding the domain
(x2 − 1)/(x − 1) equals x + 1 only for x ≠ 1. The domain of the original function is R − {1}; cancelling first would wrongly put 1 back in.
Quick revision summary
- A function f : A → B gives every a ∈ A exactly one image f(a) = b in B. Domain A; codomain B; range = set of images ⊂ B.
- A real function has its domain and range inside R. Domain: avoid zero denominators and negatives under square roots. Range: the values f(x) actually takes.
- Standard functions: x, c, polynomials, 1/x, |x|, sgn x and [x], with the domains and ranges above.
- Algebra: (f + g)(x) = f(x) + g(x), and likewise for −, × and ÷ (with g(x) ≠ 0).
Formula sheet
- f : A → B, f(a) = b: one image for each a ∈ A
- (f ± g)(x) = f(x) ± g(x); (fg)(x) = f(x) g(x)
- (αf)(x) = α f(x)
- (f/g)(x) = f(x)/g(x), where g(x) ≠ 0
- |x| = x for x ≥ 0 and −x for x < 0
- greatest integer: [x] = n, the integer with n ≤ x < n + 1
Questions students ask
What is the difference between a relation and a function?
Every function is a relation, but a relation from A to B is a function only when every element of A has exactly one image in B. A relation may leave an element of A with no image or give it two or more; a function may do neither, though two elements of A may share an image. For A = {1, 2, 3} and B = {4, 5, 6}, {(1, 4), (2, 4), (3, 6)} is a function from A to B, while {(1, 4), (1, 5), (3, 6)} is only a relation, because 1 has two images and 2 has none.
How many functions are there from a set A to a set B?
For finite non-empty sets A and B, if n(A) = p and n(B) = q, there are qp functions from A to B, because each of the p elements of A picks its one image from the q elements of B, independently of the others. The base is n(B) and the power is n(A), so the direction matters: for n(A) = 3 and n(B) = 5 there are 53 = 125 functions from A to B but 35 = 243 from B to A. There are more relations, 2pq from A to B, since a relation may give an element any number of images; counting one-one and onto functions is Class 12 work.
What are the domain and range of a quadratic function?
A quadratic function f(x) = ax2 + bx + c, with a ≠ 0, has domain R, and its range is [k, ∞) when a > 0 or (−∞, k] when a < 0, where k is the least or greatest value of f, taken at the vertex of its parabola. Completing the square finds k: x2 − 4x + 7 = (x − 2)2 + 3, and (x − 2)2 takes every value ≥ 0, so the range of x2 − 4x + 7 is [3, ∞), with the least value 3 at x = 2. The parabola opens upwards when a > 0, like y = x2 in the graphs above, and downwards when a < 0.
Is the greatest integer function the same as the floor function?
Yes, the greatest integer function [x] is the floor function, also written ⌊x⌋: both give the greatest integer less than or equal to x, so [4.2] = 4 and [−1.5] = −2. Its partner, the least integer or ceiling function ⌈x⌉, gives the smallest integer greater than or equal to x: ⌈4.2⌉ = 5 and ⌈−1.5⌉ = −1. Floor and ceiling agree at integers and differ by exactly 1 everywhere else, and the fractional part x − [x] lies in [0, 1) for every real x, for example −1.5 − (−2) = 0.5.
What is the difference between the modulus function and the signum function?
The modulus function gives the size of a number and the signum function gives only its sign: |x| is x or −x, whichever is not negative, so its range is [0, ∞), while sgn x is 1, 0 or −1 as x is positive, zero or negative, so its range is {−1, 0, 1}. Both have domain R, and each can be written with the other: |x| = x sgn x for every real x, and sgn x = |x|/x for x ≠ 0, with sgn 0 = 0. For example, sgn(−6) = −1, so |−6| = (−6) × (−1) = 6.
Are the modulus, signum and greatest integer functions continuous?
The modulus function is continuous everywhere, but the signum and greatest integer functions are not: sgn x jumps from −1 to 1 at x = 0, and [x] jumps up by 1 at every integer, so their graphs cannot be drawn there without lifting the pen. Each is continuous at every other point; in the graphs above, the filled dots mark the values at the jumps, sgn 0 = 0 and [n] = n at each integer n. The modulus function has a different weak point: the sharp corner of its V means |x| is not differentiable at x = 0. Continuity and differentiability are taught in Class 12 and are in Unit 7 of the JEE Main 2027 syllabus.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. f(x) = 2x − 5. Find (i) f(0); (ii) f(7); (iii) f(−3) (NCERT Exercise 2.3, Q3).
Show answerHide answer
(i) −5; (ii) 14 − 5 = 9; (iii) −6 − 5 = −11.
-
Q2. t(C) = 9C/5 + 32 changes degrees Celsius to degrees Fahrenheit. Find (i) t(0); (ii) t(28); (iii) t(−10); (iv) C when t(C) = 212 (NCERT Exercise 2.3, Q4).
Show answerHide answer
(i) 32; (ii) 50.4 + 32 = 82.4; (iii) −18 + 32 = 14; (iv) 9C/5 = 180, so C = 100.
-
Q3. Find the domain of f(x) = (x2 + 2x + 1)/(x2 − 8x + 12) (NCERT Miscellaneous Exercise, Q3).
Show answerHide answer
x2 − 8x + 12 = (x − 2)(x − 6), which is 0 at 2 and 6. Domain R − {2, 6}.
-
Q4. Find the domain and range of (i) f(x) = √(x − 1); (ii) f(x) = |x − 1| (NCERT Miscellaneous Exercise, Q4 and Q5).
Show answerHide answer
(i) x − 1 ≥ 0, so the domain is [1, ∞); the square root takes every value ≥ 0, so the range is [0, ∞). (ii) |x − 1| ≥ 0, is 0 at x = 1, and any y ≥ 0 is reached at x = 1 + y: domain R, range [0, ∞).