Functions

RS Aggarwal Class 12 Maths Solutions Exercise 2A — Functions

RS Aggarwal, Class 12 Mathematics — Functions, Exercise 2A. All 17 questions solved.

Independent solutions by Shiwam’s Classes. Not affiliated with or endorsed by the author or publisher of the book.

Exercise 2A is about the vocabulary of functions. Questions 1 to 3 ask for definitions and examples. Questions 4 and 17 evaluate piecewise functions. Questions 5 to 13 classify a given function as one-one or many-one, onto or into. Questions 14 to 16 find a domain and range, and decide whether a set of ordered pairs is a function.

Key insight. Two separate tests decide the type of a function. For one-one, assume $f(a) = f(b)$ and see whether $a = b$ is forced; one equal-output pair with different inputs makes it many-one. For onto, compare the range with the stated codomain; a single codomain value that is never reached makes it into. Always read the domain and codomain before you start, because $x^2$ behaves differently on $N$, $Z$ and $R$.

Question 1

Define a function. What do you mean by the domain and range of a function? Give examples.

Solution. A function from a set $A$ to a set $B$ is a rule that attaches to every element of $A$ exactly one element of $B$. We write $f : A \to B$ and $y = f(x)$. Two things matter: every $x \in A$ must have an image, and no $x$ may have two different images.

The set $A$ is the domain, the set of all allowed inputs. The set $B$ is the codomain. The range is the set of outputs actually produced, $\{f(x) : x \in A\}$, and it is a subset of the codomain.

Example: $f : R \to R$, $f(x) = x^2$. The domain is $R$, the codomain is $R$, and the range is $[0, \infty)$, since a square is never negative. Another: $f = \{(1, 4), (2, 4), (3, 9)\}$ is a function with domain $\{1, 2, 3\}$ and range $\{4, 9\}$; two inputs may share an output, but one input cannot have two.

Function: each input has exactly one output. Domain = set of inputs; range = set of outputs actually obtained (a subset of the codomain).

Question 2

Define each of the following and give an example of each type.

Solution. Let $f : A \to B$.

  1. (i) Injective (one-one). Different inputs give different outputs: $f(a) = f(b) \Rightarrow a = b$. Example: $f : R \to R$, $f(x) = 2x + 1$.
  2. (ii) Surjective (onto). Every element of the codomain is an image, so range $=$ codomain. Example: $f : R \to R$, $f(x) = x + 5$, since $y = x + 5$ is reached from $x = y – 5$.
  3. (iii) Bijective. Both one-one and onto. Example: $f : R \to R$, $f(x) = 3x – 2$.
  4. (iv) Many-one. Some two different inputs share an output. Example: $f : R \to R$, $f(x) = x^2$, because $f(2) = f(-2) = 4$.
  5. (v) Into. Some codomain element is never an output. Example: $f : R \to R$, $f(x) = x^2$, because $-1$ is not a square.

Injective: $f(a) = f(b) \Rightarrow a = b$. Surjective: range $=$ codomain. Bijective: both. Many-one: two inputs, one output. Into: some codomain element is missed.

Question 3

Give an example of a function which is (i) one-one but not onto, (ii) one-one and onto, (iii) neither one-one nor onto, (iv) onto but not one-one.

Solution. Each example needs its domain and codomain stated.

(i) $f : N \to N$, $f(n) = n + 1$. If $n + 1 = m + 1$ then $n = m$, so it is one-one. But $1$ is never an output (it would need $n = 0$), so it is not onto.

(ii) $f : R \to R$, $f(x) = x + 1$. One-one because $x + 1 = y + 1$ gives $x = y$; onto because any $y$ equals $f(y – 1)$.

(iii) $f : R \to R$, $f(x) = x^2$. Not one-one since $f(1) = f(-1)$, and not onto since $-1$ has no real square root.

(iv) $f : R \to [0, \infty)$, $f(x) = x^2$. Every non-negative number $y$ is $f(\sqrt{y})$, so it is onto, but $f(1) = f(-1)$ so it is not one-one.

(i) $f(n) = n + 1$ on $N \to N$. (ii) $f(x) = x + 1$ on $R \to R$. (iii) $f(x) = x^2$ on $R \to R$. (iv) $f(x) = x^2$ on $R \to [0, \infty)$.

Question 4

A function $f : R \to R$ is given by three rules: $f(x) = 2x + 3$ when $x < -2$; $f(x) = x^2 – 2$ when $-2 \le x \le 3$; and $f(x) = 3x – 1$ when $x > 3$. Find $f(2)$, $f(4)$, $f(-1)$ and $f(-3)$.

Solution. For each input, first decide which interval it lies in, then use that rule only.

  • $x = 2$ lies in $-2 \le x \le 3$, so $f(2) = 2^2 – 2 = 2$.
  • $x = 4$ is greater than $3$, so $f(4) = 3(4) – 1 = 11$.
  • $x = -1$ lies in $-2 \le x \le 3$, so $f(-1) = (-1)^2 – 2 = -1$.
  • $x = -3$ is less than $-2$, so $f(-3) = 2(-3) + 3 = -3$.

$f(2) = 2$, $f(4) = 11$, $f(-1) = -1$, $f(-3) = -3$.

Question 5

Show that $f : R \to R$, $f(x) = 1 + x^2$ is many-one and into.

Solution. Many-one: $f(1) = 2$ and $f(-1) = 2$. Two different inputs give the same output, so $f$ is many-one.

Into: for every real $x$, $x^2 \ge 0$, so $f(x) \ge 1$. The range is $[1, \infty)$, which is smaller than the codomain $R$. For example $0$ is never obtained, because $1 + x^2 = 0$ has no real solution. So $f$ is into.

$f(1) = f(-1) = 2$, so many-one; range $= [1, \infty) \neq R$, so into.

Question 6

Show that $f : R \to R$, $f(x) = x^4$ is many-one and into.

Solution. Many-one: $f(2) = 16 = f(-2)$, with $2 \neq -2$.

Into: an even power is never negative, so $f(x) \ge 0$ for every real $x$. A negative number such as $-1$ in the codomain is not an image, since $x^4 = -1$ has no real root. The range is $[0, \infty) \neq R$.

$f(2) = f(-2) = 16$ (many-one), and $-1$ is never attained (into).

Question 7

Show that $f : R \to R$, $f(x) = x^5$ is one-one and onto.

Solution. One-one: suppose $a^5 = b^5$ for real $a, b$. An odd power is strictly increasing on $R$, so two different reals cannot have equal fifth powers; formally $a^5 – b^5 = (a – b)(a^4 + a^3b + a^2b^2 + ab^3 + b^4)$, and the second factor is positive unless $a = b = 0$, so $a = b$.

Onto: take any real $y$. The real number $x = y^{1/5}$ (the real fifth root, which exists for negative $y$ too, since $5$ is odd) satisfies $f(x) = y$. So every element of the codomain is an image.

$a^5 = b^5 \Rightarrow a = b$, and every real $y$ equals $f(y^{1/5})$: one-one and onto.

Question 8

Let $f : \left[0, \dfrac{\pi}{2}\right] \to R$, $f(x) = \sin x$ and $g : \left[0, \dfrac{\pi}{2}\right] \to R$, $g(x) = \cos x$. Show that $f$ and $g$ are each one-one, but $f + g$ is not one-one.

Solution. On $\left[0, \dfrac{\pi}{2}\right]$ the sine function increases strictly from $0$ to $1$, so different angles give different sines: $\sin a = \sin b \Rightarrow a = b$. Cosine decreases strictly from $1$ to $0$ on the same interval, so it is also one-one.

Now $(f + g)(x) = \sin x + \cos x$. At the two ends,

$$(f+g)(0) = 0 + 1 = 1,\qquad (f+g)\!\left(\tfrac{\pi}{2}\right) = 1 + 0 = 1.$$

Two different inputs, $0$ and $\dfrac{\pi}{2}$, give the same output, so $f + g$ is not one-one. (The sum rises to $\sqrt{2}$ at $x = \dfrac{\pi}{4}$ and falls again.)

$f$ and $g$ are strictly monotonic, hence one-one; $(f+g)(0) = (f+g)(\pi/2) = 1$, so $f + g$ is not one-one.

Question 9

Show that (i) $f : N \to N$, $f(x) = x^2$ is one-one and into; (ii) $f : Z \to Z$, $f(x) = x^2$ is many-one and into.

Solution. (i) Let $a, b \in N$ with $a^2 = b^2$. Natural numbers are positive, so $a = b$ and $f$ is one-one. It is into because $2$ is a natural number but not a perfect square, so nothing maps to it.

(ii) On $Z$, $f(2) = 4 = f(-2)$, so $f$ is many-one. It is into because $-1 \in Z$ is not a square of any integer (squares are $\ge 0$).

(i) One-one (positive $a, b$ with $a^2 = b^2$ are equal) and into (2 is missed). (ii) Many-one ($f(2) = f(-2)$) and into ($-1$ is missed).

Question 10

Show that (i) $f : N \to N$, $f(x) = x^3$ is one-one and into; (ii) $f : Z \to Z$, $f(x) = x^3$ is one-one and into.

Solution. (i) For natural numbers, $a^3 = b^3$ gives $a = b$ because cubing is strictly increasing. The number $2$ is not a perfect cube, so it is not an image: into.

(ii) For integers, $a^3 = b^3$ again forces $a = b$, since $a^3 – b^3 = (a – b)(a^2 + ab + b^2)$ and the bracket is positive unless $a = b = 0$. So $f$ is one-one. But $2 \in Z$ is not the cube of any integer ($1^3 = 1$, $2^3 = 8$), so $f$ is into.

In both cases $a^3 = b^3 \Rightarrow a = b$ (one-one), and $2$ is not a cube (into).

Question 11

Show that $f : R \to R$, $f(x) = \sin x$ is neither one-one nor onto.

Solution. Not one-one: $\sin 0 = 0$ and $\sin \pi = 0$, yet $0 \neq \pi$.

Not onto: $-1 \le \sin x \le 1$ for every real $x$, so the range is $[-1, 1]$. The number $2 \in R$ is never obtained, so the range is not the whole codomain.

$\sin 0 = \sin \pi$ (not one-one); range $[-1, 1] \neq R$ (not onto).

Question 12

Prove that $f : N \to N$, $f(n) = n^2 + n + 1$ is one-one but not onto.

Solution. One-one: suppose $f(a) = f(b)$. Then $a^2 + a = b^2 + b$, so $a^2 – b^2 + a – b = 0$, that is

$$(a – b)(a + b + 1) = 0.$$

For natural numbers $a + b + 1 \ge 3 > 0$, so $a – b = 0$ and $a = b$.

Not onto: the smallest value is $f(1) = 3$, and $f$ increases from there. So $1$ and $2$ in the codomain $N$ are never outputs (solving $n^2 + n + 1 = 1$ gives $n = 0$ or $-1$, not natural).

$(a – b)(a + b + 1) = 0 \Rightarrow a = b$ (one-one); the least value is $f(1) = 3$, so $1$ is not attained (not onto).

Question 13

Show that $f : N \to Z$ given by $f(n) = \dfrac{n – 1}{2}$ when $n$ is odd and $f(n) = -\dfrac{n}{2}$ when $n$ is even is both one-one and onto.

Solution. Look at what each branch produces. For odd $n = 1, 3, 5, 7, \dots$ the values are $0, 1, 2, 3, \dots$, the non-negative integers. For even $n = 2, 4, 6, 8, \dots$ the values are $-1, -2, -3, -4, \dots$, the negative integers.

One-one: an odd input never gives a negative value and an even input never gives a non-negative one, so outputs from different branches never coincide. Within the odd branch, $\dfrac{a – 1}{2} = \dfrac{b – 1}{2}$ gives $a = b$; within the even branch, $-\dfrac{a}{2} = -\dfrac{b}{2}$ gives $a = b$.

Onto: given an integer $m \ge 0$, take $n = 2m + 1$ (odd), and $f(n) = m$. Given an integer $m < 0$, take $n = -2m$ (even and positive), and $f(n) = -\dfrac{-2m}{2} = m$. So every integer is hit.

Odd $n$ give $0, 1, 2, \dots$ and even $n$ give $-1, -2, \dots$ without repeats: one-one and onto.

Question 14

Find the domain and range of $f : R \to R$, $f(x) = x^2 + 1$.

Solution. The expression is defined for every real number, so the domain is $R$. Since $x^2 \ge 0$, we get $f(x) = x^2 + 1 \ge 1$, and the value $1$ is reached at $x = 0$. For any $y \ge 1$, $x = \sqrt{y – 1}$ gives $f(x) = y$, so every number from $1$ upwards occurs.

Domain $= R$; range $= \{y \in R : y \ge 1\} = [1, \infty)$.

Question 15

Which of the following relations are functions? Give reasons. For a function, find its domain and range. (i) $f = \{(-1, 2), (1, 8), (2, 11), (3, 14)\}$; (ii) $g = \{(1, 1), (1, -1), (4, 2), (9, 3), (16, 4)\}$; (iii) $h = \{(a, b), (b, c), (c, b), (d, c)\}$.

Solution. A relation is a function when no first element is paired with two different second elements.

(i) The first elements $-1, 1, 2, 3$ are all different, so $f$ is a function. Domain $\{-1, 1, 2, 3\}$, range $\{2, 8, 11, 14\}$.

(ii) The first element $1$ appears in both $(1, 1)$ and $(1, -1)$, with different images. So $g$ is not a function.

(iii) The first elements $a, b, c, d$ are all different, so $h$ is a function. Domain $\{a, b, c, d\}$; the second elements are $b, c, b, c$, so the range is $\{b, c\}$.

(i) Function; domain $\{-1, 1, 2, 3\}$, range $\{2, 8, 11, 14\}$. (ii) Not a function ($1$ has two images). (iii) Function; domain $\{a, b, c, d\}$, range $\{b, c\}$.

Question 16

Find the domain and range of the real function $f(x) = \dfrac{x^2}{1 + x^2}$, and show that $f$ is many-one.

Solution. The denominator $1 + x^2$ is at least $1$, never zero, so the domain is $R$.

For the range, put $y = \dfrac{x^2}{1 + x^2}$. Then $y + yx^2 = x^2$, so $x^2 = \dfrac{y}{1 – y}$. A real $x$ exists exactly when this is $\ge 0$ with $y \neq 1$, which holds for $0 \le y < 1$. So the range is $[0, 1)$. (Equivalently, $f(x) = 1 – \dfrac{1}{1 + x^2}$, which is at least $0$ and always below $1$.)

Many-one: $f(2) = \dfrac{4}{5} = f(-2)$, with $2 \neq -2$.

Domain $= R$, range $= [0, 1)$; $f(2) = f(-2) = \tfrac{4}{5}$, so $f$ is many-one.

Question 17

Show that $f : R \to R$, defined by $f(x) = 1$ when $x$ is rational and $f(x) = -1$ when $x$ is irrational, is many-one and into. Find (i) $f\!\left(\tfrac12\right)$, (ii) $f(\sqrt2)$, (iii) $f(\pi)$, (iv) $f(2 + \sqrt3)$.

Solution. Many-one: $f(1) = f(2) = 1$, since both are rational. Into: the only outputs are $1$ and $-1$, so, for example, $0$ in the codomain $R$ is never obtained.

Values: $\tfrac12$ is rational, so $f\!\left(\tfrac12\right) = 1$. The numbers $\sqrt2$ and $\pi$ are irrational, so $f(\sqrt2) = f(\pi) = -1$. Finally $2 + \sqrt3$ is irrational (a rational plus an irrational is irrational), so $f(2 + \sqrt3) = -1$.

Many-one and into (range $\{1, -1\}$). (i) $1$ (ii) $-1$ (iii) $-1$ (iv) $-1$.

Common mistakes

  • Ignoring the domain and codomain. $x^2$ is many-one on $Z$ and $R$ but one-one on $N$ (Question 9). Changing the set changes the answer, so always read the arrow $f : A \to B$ first.
  • Testing one-one with a single example. Showing $f(2) \neq f(3)$ proves nothing. To prove one-one you must start from $f(a) = f(b)$ and derive $a = b$; to disprove it, one pair of equal outputs is enough.
  • Confusing “into” with “many-one”. The first concerns outputs missed in the codomain, the second concerns inputs sharing an output. Question 12 is one-one yet into, and Question 6 is both many-one and into.
  • Using the wrong branch of a piecewise rule (Questions 4, 13). Decide which interval or parity the input lies in before substituting. Putting $x = -3$ into $x^2 – 2$ gives $7$ instead of the correct $-3$.
  • Forgetting that cubes and fifth powers hit negatives. In Question 7 the real fifth root of a negative number exists, so $x^5$ is onto $R$, unlike $x^4$.
  • Calling a relation a function by its domain only (Question 15). Check for a repeated first element with different second elements; repeated second elements are allowed.

Practise next

  • Find the range of $f : R \to R$, $f(x) = \dfrac{1}{1 + x^2}$, and say whether it is one-one or onto.
Show answer

Range $(0, 1]$; many-one and into. Put $y = \dfrac{1}{1 + x^2}$, so $x^2 = \dfrac{1 – y}{y}$, which is $\ge 0$ exactly when $0 < y \le 1$. Since $f(1) = f(-1) = \tfrac12$ it is many-one, and $2$ is not attained, so it is into.

  • Continue with Exercise 2B for composition of functions.

Shiwam's Classes: IIT JEEJEE Main and Advanced, worked in full

Subscribe