Class 12 Maths, Worked in Full Past papersGet updates
Chapter 1 · Relations and Functions

Exercise 1.2 · Q2: Injectivity and surjectivity of x2x^2 and x3x^3

Exercise 1.2Types of functions · Exercise 1.2
The question

Check the injectivity and surjectivity of the following functions:

(i) f:N→Nf : \N\to\N given by f(x)=x2f(x) = x^2
(ii) f:Z→Zf : \Z\to\Z given by f(x)=x2f(x) = x^2
(iii) f:R→Rf : \R\to\R given by f(x)=x2f(x) = x^2
(iv) f:N→Nf : \N\to\N given by f(x)=x3f(x) = x^3
(v) f:Z→Zf : \Z\to\Z given by f(x)=x3f(x) = x^3

Exam answer

(i) Let x1,x2∈Nx_1, x_2 \in \N with x12=x22x_1^2 = x_2^2⁠. Then (x1−x2)(x1+x2)=0(x_1 - x_2)(x_1 + x_2) = 0⁠. As x1+x2>0x_1 + x_2 > 0⁠, x1=x2x_1 = x_2⁠. So ff is injective.

2∈N2 \in \N⁠, but 12=11^2 = 1 and x2≥4x^2 \ge 4 for x≥2x \ge 2⁠. So no x∈Nx \in \N has x2=2x^2 = 2⁠, and ff is not surjective.

Injective but not surjective.

(ii) f(−1)=1=f(1)f(-1) = 1 = f(1)⁠, but −1≠1-1 \ne 1⁠. So ff is not injective. −1∈Z-1 \in \Z⁠, but x2≥0x^2 \ge 0 for all xx⁠, so −1-1 has no preimage. So ff is not surjective.

Neither injective nor surjective.

(iii) f(−1)=1=f(1)f(-1) = 1 = f(1)⁠, but −1≠1-1 \ne 1⁠. So ff is not injective. −1∈R-1 \in \R⁠, but x2≥0x^2 \ge 0 for all xx⁠, so −1-1 has no preimage. So ff is not surjective.

Neither injective nor surjective.

(iv) Let x1,x2∈Nx_1, x_2 \in \N with x13=x23x_1^3 = x_2^3⁠. Then x13−x23=(x1−x2)Q=0x_1^3 - x_2^3 = (x_1 - x_2)Q = 0⁠, where Q=x12+x1x2+x22Q = x_1^2 + x_1x_2 + x_2^2⁠. As x1,x2≥1x_1, x_2 \ge 1⁠, Q≥3Q \ge 3⁠, so x1=x2x_1 = x_2⁠. So ff is injective.

2∈N2 \in \N⁠, but 13=11^3 = 1 and x3≥8x^3 \ge 8 for x≥2x \ge 2⁠. So 22 has no preimage, and ff is not surjective.

Injective but not surjective.

(v) Let x1,x2∈Zx_1, x_2 \in \Z with x13=x23x_1^3 = x_2^3⁠. Again (x1−x2)Q=0(x_1 - x_2)Q = 0⁠, where, completing the square,

Q=(x1+x22)2+34x22≥0Q = \Big(x_1 + \frac{x_2}{2}\Big)^2 + \frac34x_2^2 \ge 0

If Q=0Q = 0⁠, then x2=0x_2 = 0 and x1=0x_1 = 0⁠. So in every case x1=x2x_1 = x_2⁠, and ff is injective.

2∈Z2 \in \Z⁠, but the cubes of −1,0,1-1, 0, 1 are −1,0,1-1, 0, 1⁠, and ∣x3∣≥8|x^3| \ge 8 for ∣x∣≥2|x| \ge 2⁠. So 22 has no preimage, and ff is not surjective.

Injective but not surjective.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Only two formulas appear, but there are five different functions, because the domain and codomain change. Two factorisations decide every injectivity question:

x12−x22=(x1−x2)(x1+x2),x13−x23=(x1−x2)(x12+x1x2+x22).\begin{aligned} x_1^2 - x_2^2 &= (x_1-x_2)(x_1+x_2),\\ x_1^3 - x_2^3 &= (x_1-x_2)(x_1^2+x_1x_2+x_2^2). \end{aligned}

Squaring loses the sign, so it is one-one only when negative inputs are absent (on N\N⁠); cubing keeps the sign, so it is one-one everywhere. Surjectivity fails in all five parts, each time for a value we can name: 22 is not the square or cube of any whole number, and −1-1 is not the square of anything.

Given, to find, and the plan
Given
Five functions: x2x^2 with domain = codomain N\N⁠, Z\Z⁠, R\R⁠; and x3x^3 with domain = codomain N\N⁠, Z\Z⁠.
To find
For each, whether it is injective (one-one) and whether it is surjective (onto), with proof.
Plan
First set up the two factorisations, valid for all real numbers. Then, part by part: (1) injective? prove it from f(x1)=f(x2)f(x_1)=f(x_2) for arbitrary inputs, or disprove with one explicit pair; (2) surjective? name a codomain value and prove nothing in the domain maps to it; (3) state the verdict.

Basics you need

1The function includes its domain and codomain

f:X→Yf : X\to Y means: inputs come from XX⁠, outputs must lie in YY⁠. The same formula with a different XX or YY is a different function and can behave differently. Basics: what a function is

2Injective and surjective

Injective (one-one): f(x1)=f(x2)⇒x1=x2f(x_1)=f(x_2) \Rightarrow x_1=x_2 for all x1,x2x_1, x_2 in the domain. Surjective (onto): every yy in the codomain equals f(x)f(x) for some xx in the domain. Basics: one-one and onto

3Proving versus disproving

A "for all" claim is proved with arbitrary elements and disproved by one counterexample. So "not injective" needs one pair x1≠x2x_1\ne x_2 with equal images; "not surjective" needs one codomain value with no preimage, and a proof that it has none. Basics: how to prove and disprove

4Zero products

If ab=0ab = 0 for real numbers a,ba, b⁠, then a=0a = 0 or b=0b = 0⁠. So if ab=0ab = 0 and b≠0b \ne 0⁠, then a=0a = 0⁠. This turns a factorisation into a proof that x1=x2x_1 = x_2⁠.

5Squares are never negative

For every real xx⁠, x2≥0x^2 \ge 0⁠: if x≥0x\ge0 it is a product of two non-negative numbers, and if x<0x<0 it is a product of two negative numbers, which is positive. Also, if a≥b>0a\ge b > 0 then a2≥b2a^2 \ge b^2 and a3≥b3a^3\ge b^3⁠. Basics: integers, even and odd

Solution

  1. Two factorisations used in every part

    For all real numbers x1,x2x_1, x_2⁠, expanding the right-hand sides gives

    x12−x22=(x1−x2)(x1+x2),x13−x23=(x1−x2)(x12+x1x2+x22).\begin{aligned} x_1^2 - x_2^2 &= (x_1 - x_2)(x_1 + x_2),\\ x_1^3 - x_2^3 &= (x_1 - x_2)(x_1^2 + x_1x_2 + x_2^2). \end{aligned}

    The second bracket of the cube identity can be rewritten by completing the square:

    x12+x1x2+x22=(x1+x22)2+3x224.x_1^2 + x_1x_2 + x_2^2 = \left(x_1 + \frac{x_2}{2}\right)^2 + \frac{3x_2^2}{4}.

    (Check: (x1+x22)2=x12+x1x2+x224\left(x_1 + \frac{x_2}{2}\right)^2 = x_1^2 + x_1x_2 + \frac{x_2^2}{4}⁠, and x224+3x224=x22\frac{x_2^2}{4} + \frac{3x_2^2}{4} = x_2^2⁠.) Both terms on the right are squares times non-negative numbers, so this bracket is always ≥0\ge 0⁠.

    To test injectivity we assume f(x1)=f(x2)f(x_1) = f(x_2)⁠, which means x12−x22=0x_1^2 - x_2^2 = 0 or x13−x23=0x_1^3 - x_2^3 = 0⁠. Factoring pulls out (x1−x2)(x_1 - x_2)⁠. If we can show the other bracket is not zero, the zero-product rule forces x1−x2=0x_1 - x_2 = 0⁠. If the other bracket can be zero for different inputs, that tells us exactly where to look for a counterexample. Doing this algebra once, for all reals, lets every part reuse it.
    Zero-product rule (Basic 4) and squares are non-negative (Basic 5).

Part (i): f:N→Nf : \N\to\N⁠, f(x)=x2f(x) = x^2

  1. It is a function from N\N to N\N

    If x∈Nx\in\N⁠, then x2=x⋅xx^2 = x\cdot x is a product of natural numbers, so x2∈Nx^2\in\N⁠. Each input has exactly one square.

    Outputs must lie in the codomain before onto can even be asked. Natural numbers are closed under multiplication.
  2. Injective? Yes

    Let x1,x2∈Nx_1, x_2\in\N with x12=x22x_1^2 = x_2^2⁠. Then by Step 1 of the Solution,

    (x1−x2)(x1+x2)=0.(x_1 - x_2)(x_1 + x_2) = 0.

    Since x1≥1x_1 \ge 1 and x2≥1x_2 \ge 1⁠, we have x1+x2≥2x_1 + x_2 \ge 2⁠, so x1+x2≠0x_1 + x_2 \ne 0⁠. By the zero-product rule, x1−x2=0x_1 - x_2 = 0⁠, that is, x1=x2x_1 = x_2⁠. So ff is injective.

    The only way two different numbers can have the same square is x1=−x2x_1 = -x_2 (the second bracket vanishing). In N\N every number is positive, so x1+x2x_1 + x_2 can never be zero, and that escape route is closed.
    If ab=0ab=0 and b≠0b\ne0⁠, then a=0a=0 (Basic 4).
  3. Surjective? No: 22 is not a square of a natural number

    The number 22 is in the codomain N\N⁠. Look for x∈Nx\in\N with x2=2x^2 = 2⁠:

    • x=1x = 1 gives 12=1≠21^2 = 1 \ne 2⁠;
    • every other natural number has x≥2x\ge 2⁠, so x2≥22=4>2x^2 \ge 2^2 = 4 > 2⁠.

    Every natural number falls into one of these two cases, and neither gives 22⁠. So 22 has no preimage, and ff is not surjective.

    "Not onto" needs one specific codomain value and a proof that no input reaches it. Trying a few inputs is not a proof; splitting N\N into "x=1x = 1" and "x≥2x\ge2" covers every natural number, so the argument is complete. (The squares 1,4,9,16,…1, 4, 9, 16, \dots skip 2,3,5,6,7,8,…2, 3, 5, 6, 7, 8, \dots⁠; any of these would do.)
    If a≥b>0a \ge b > 0 then a2≥b2a^2 \ge b^2 (Basic 5).
  4. Verdict for part (i)

    Injective but not surjective.

Part (ii): f:Z→Zf : \Z\to\Z⁠, f(x)=x2f(x) = x^2

  1. Injective? No: −1-1 and 11 have the same square

    Both −1-1 and 11 are integers, and

    f(−1)=(−1)2=1=12=f(1),while −1≠1.f(-1) = (-1)^2 = 1 = 1^2 = f(1), \qquad\text{while } -1 \ne 1.

    So ff is not injective.

    The factorisation (x1−x2)(x1+x2)=0(x_1 - x_2)(x_1 + x_2) = 0 shows equal squares happen when x1+x2=0x_1 + x_2 = 0⁠, that is, x2=−x1x_2 = -x_1⁠. In part (i) this was impossible, but Z\Z contains negative numbers, so any pair x,−xx, -x with x≠0x\ne0 is a counterexample. One such pair is enough to disprove a "for all" claim.
    One counterexample disproves injectivity (Basic 3). Basics: how to prove and disprove
  2. Surjective? No: −1-1 is not a square

    The number −1-1 is in the codomain Z\Z⁠. For every integer xx⁠, x2≥0x^2 \ge 0 (Basic 5), so x2≠−1x^2 \ne -1⁠. No integer is mapped to −1-1⁠, and ff is not surjective.

    Choosing a negative target makes the proof one line, because squares are never negative. (The value 22 would also work: the argument of part (i) applies to ∣x∣|x|⁠, since x2=∣x∣2x^2 = |x|^2 and ∣x∣|x| is 00⁠, 11 or at least 22⁠.)
  3. Verdict for part (ii)

    Neither injective nor surjective. Compare part (i): same formula, but allowing negative inputs destroys injectivity.

Part (iii): f:R→Rf : \R\to\R⁠, f(x)=x2f(x) = x^2

  1. Injective? No

    −1,1∈R-1, 1\in\R⁠, −1≠1-1\ne1⁠, but f(−1)=1=f(1)f(-1) = 1 = f(1)⁠. So ff is not injective.

    Enlarging the domain from Z\Z to R\R keeps the old counterexample available: −1-1 and 11 are still inputs. A pair that breaks injectivity on a smaller domain breaks it on any larger domain too.
  2. Surjective? No: −1-1 is still unreached

    −1∈R-1\in\R is in the codomain, but x2≥0x^2 \ge 0 for every real xx⁠, so x2≠−1x^2 \ne -1⁠. Hence ff is not surjective.

    Notice what changed from part (ii). Over R\R⁠, the value 22 is reached (by x=2x = \sqrt2⁠), and in fact every y≥0y \ge 0 is reached (by y\sqrt y⁠). So over R\R only the negative values are missed, but missing even one is enough.

    −3−2−1123 xy x ≈ ±1.41 y = 1: hit twice y = 2 y = −1: never reached 1249
    The graph of y=x2y = x^2 (scales differ); black dots mark integer inputs. The line y=1y = 1 meets the graph twice, at x=±1x = \pm1⁠: not one-one on Z\Z or R\R⁠. The line y=−1y = -1 misses the graph: not onto on Z\Z or R\R⁠. The line y=2y = 2 meets the graph only at x=±2≈±1.41x = \pm\sqrt2 \approx \pm1.41⁠, between the dots, so 22 is reached over R\R but not over N\N or Z\Z⁠.
    The horizontal line test pictures both properties: one-one means no horizontal line at a codomain height meets the graph twice; onto means every such line meets it at least once. The textbook settles exactly this function in Example 11, using f(−1)=f(1)f(-1) = f(1) and the value −2-2⁠, which has no real square root. Any negative number works.
    Squares of real numbers are ≥0\ge 0 (Basic 5). Example 11: x2x^2 on R\R
  3. Verdict for part (iii)

    Neither injective nor surjective.

Part (iv): f:N→Nf : \N\to\N⁠, f(x)=x3f(x) = x^3

  1. Injective? Yes

    Let x1,x2∈Nx_1, x_2\in\N with x13=x23x_1^3 = x_2^3⁠. By Step 1 of the Solution,

    (x1−x2)(x12+x1x2+x22)=0.(x_1 - x_2)(x_1^2 + x_1x_2 + x_2^2) = 0.

    Since x1,x2≥1x_1, x_2 \ge 1⁠, each of x12x_1^2⁠, x1x2x_1x_2⁠, x22x_2^2 is at least 11⁠, so the second bracket is at least 33⁠, and in particular not zero. Hence x1−x2=0x_1 - x_2 = 0⁠, so x1=x2x_1 = x_2 and ff is injective.

    We need an argument for all natural x1,x2x_1, x_2⁠, and the factorisation supplies it: the difference of the cubes is (x1−x2)(x_1-x_2) times a bracket that is plainly positive for natural numbers. "It is obvious that different numbers have different cubes" is the claim we are asked to prove, so we cannot use it as a reason.
    If ab=0ab = 0 and b≠0b \ne 0 then a=0a = 0 (Basic 4).
  2. Surjective? No: 22 is not a cube of a natural number

    22 is in the codomain N\N⁠. For x∈Nx\in\N⁠: if x=1x = 1⁠, x3=1≠2x^3 = 1 \ne 2⁠; if x≥2x\ge2⁠, then x3≥23=8>2x^3 \ge 2^3 = 8 > 2⁠. Every natural number is in one of these cases, so no x∈Nx\in\N has x3=2x^3 = 2⁠, and ff is not surjective.

    The cubes of natural numbers are 1,8,27,64,…1, 8, 27, 64, \dots⁠, which skip 22⁠. The two-case split covers all of N\N⁠, which is what makes this a proof rather than a few trials.
    If a≥b>0a\ge b>0 then a3≥b3a^3 \ge b^3 (Basic 5): multiply a≥ba \ge b by positive numbers three times.
  3. Verdict for part (iv)

    Injective but not surjective.

Part (v): f:Z→Zf : \Z\to\Z⁠, f(x)=x3f(x) = x^3

  1. Injective? Yes, even with negative inputs

    Let x1,x2∈Zx_1, x_2\in\Z with x13=x23x_1^3 = x_2^3⁠. Then

    (x1−x2) Q=0,where Q=x12+x1x2+x22=(x1+x22)2+3x224.(x_1 - x_2)\,Q = 0, \qquad\text{where } Q = x_1^2 + x_1x_2 + x_2^2 = \left(x_1 + \frac{x_2}{2}\right)^2 + \frac{3x_2^2}{4}.

    There are two cases.

    • Q≠0Q \ne 0⁠. Then the zero-product rule gives x1−x2=0x_1 - x_2 = 0⁠, so x1=x2x_1 = x_2⁠.
    • Q=0Q = 0⁠. QQ is a sum of two non-negative terms, so both are zero: 3x224=0\frac{3x_2^2}{4} = 0 gives x2=0x_2 = 0⁠, and then (x1+0)2=0\left(x_1 + 0\right)^2 = 0 gives x1=0x_1 = 0⁠. So again x1=x2x_1 = x_2⁠.

    In both cases x1=x2x_1 = x_2⁠, so ff is injective.

    In part (iv) the bracket QQ was obviously positive because all numbers were positive. With negative integers allowed, x1x2x_1x_2 can be negative, so we need a better reason: completing the square shows QQ is a sum of non-negative terms and vanishes only when x1=x2=0x_1 = x_2 = 0⁠. Unlike the square, the cube keeps the sign ((−x)3=−x3(-x)^3 = -x^3⁠), so the pair x,−xx, -x does not collide.
    A sum of non-negative numbers is zero only if each of them is zero; here both terms are non-negative because squares are ≥0\ge 0 (Basic 5).
  2. Surjective? No: 22 is not the cube of an integer

    22 is in the codomain Z\Z⁠. Split the integers into two cases:

    • x∈{−1,0,1}x\in\{-1, 0, 1\}⁠: the cubes are −1,0,1-1, 0, 1⁠, none equal to 22⁠;
    • ∣x∣≥2|x| \ge 2⁠: then ∣x3∣=∣x∣3≥23=8|x^3| = |x|^3 \ge 2^3 = 8⁠, so x3x^3 is ≥8\ge 8 or ≤−8\le -8⁠, and cannot be 22⁠.

    So no integer has cube 22⁠, and ff is not surjective.

    −2−112 xy x ≈ 1.26 y = 2 81−1−8
    The graph of y=x3y = x^3 (scales differ); black dots mark the integer inputs −2,…,2-2, \dots, 2⁠, with heights −8,−1,0,1,8-8, -1, 0, 1, 8⁠. The graph always rises, so every horizontal line meets it at most once: one-one. The line y=2y = 2 meets it at x=23≈1.26x = \sqrt[3]{2} \approx 1.26⁠, which lies strictly between the dots at x=1x = 1 and x=2x = 2⁠, so no integer (and no natural number) has cube 22⁠.
    The case split ∣x∣≤1|x|\le1 or ∣x∣≥2|x|\ge2 covers every integer, so the argument is complete. It also explains part (iv), which is the special case of positive inputs. Over R\R the answer would change: every real yy has a real cube root y3\sqrt[3]{y}⁠, so x3:R→Rx^3 : \R\to\R is onto (and one-one, by the same factorisation), hence bijective. The integers simply have gaps between consecutive cubes.
    ∣x3∣=∣x∣3|x^3| = |x|^3⁠, and ∣x∣≥2⇒∣x∣3≥8|x|\ge2 \Rightarrow |x|^3 \ge 8 (Basic 5). Miscellaneous Q2: x3x^3 is injective
  3. Verdict for part (v)

    Injective but not surjective. Compare part (ii): over Z\Z⁠, the square fails one-one but the cube passes, because cubing keeps the sign.

Result
PartFunctionInjective?Surjective?
(i)x2, N→Nx^2,\ \N\to\NYesNo (22 unreached)
(ii)x2, Z→Zx^2,\ \Z\to\ZNo (f(−1)=f(1)f(-1)=f(1)⁠)No (−1-1 unreached)
(iii)x2, R→Rx^2,\ \R\to\RNo (f(−1)=f(1)f(-1)=f(1)⁠)No (−1-1 unreached)
(iv)x3, N→Nx^3,\ \N\to\NYesNo (22 unreached)
(v)x3, Z→Zx^3,\ \Z\to\ZYesNo (22 unreached)

(Textbook answers: (i) injective but not surjective; (ii) neither; (iii) neither; (iv) injective but not surjective; (v) injective but not surjective. All agree.)

Check it with numbers

Squares of 1,…,51, \dots, 5⁠: 1,4,9,16,251, 4, 9, 16, 25⁠, all different, and 2,3,52, 3, 5 are skipped. Squares of −3,…,3-3, \dots, 3⁠: 9,4,1,0,1,4,99, 4, 1, 0, 1, 4, 9⁠, with repeats. Cubes of −3,…,3-3, \dots, 3⁠: −27,−8,−1,0,1,8,27-27, -8, -1, 0, 1, 8, 27⁠, all different, and 22 is skipped. A computer check over all integers from −1000-1000 to 10001000 confirms: the 20012001 cubes are all different, the squares take only 10011001 different values, no square is negative, and neither 22 appears as a square or as a cube.

Common mistakes
  1. Giving one answer for "x2x^2". Parts (i), (ii), (iii) are three different functions; (i) is injective, the others are not.
  2. Saying x2x^2 on R\R is not onto "because 22 has no preimage". Over R\R⁠, 2\sqrt2 is a preimage. You must pick a value that really is missed, such as −1-1⁠.
  3. "Different numbers have different cubes, obviously." That is the statement to be proved. Use the factorisation and show the second bracket is non-zero (or deal with the case where it is zero).
  4. Checking a few inputs and concluding "not onto". You must show every input misses the chosen value, for example by splitting into ∣x∣≤1|x|\le1 and ∣x∣≥2|x|\ge2⁠.
What to take away
  1. Injectivity of a polynomial: write f(x1)−f(x2)f(x_1) - f(x_2) as (x1−x2)×(something)(x_1 - x_2)\times(\text{something}) and study when the something can be zero.
  2. Shrinking the domain can create injectivity (x2x^2 on N\N⁠); enlarging the domain can destroy it (x2x^2 on Z\Z⁠).
  3. Surjectivity depends on the codomain: x3x^3 is onto R\R but not onto Z\Z or N\N⁠, and x2x^2 misses every negative number.

Every fact used, and where it comes from

FactUsed inSource
x12−x22=(x1−x2)(x1+x2)x_1^2 - x_2^2 = (x_1-x_2)(x_1+x_2)⁠;
x13−x23x_1^3 - x_2^3 =(x1−x2)(x12+x1x2+x22)= (x_1-x_2)(x_1^2+x_1x_2+x_2^2)
Solution Step 1; parts (i), (ii), (iv), (v)Algebraic identities (expand to check)
x12+x1x2+x22x_1^2 + x_1x_2 + x_2^2 =(x1+x22)2+3x224= (x_1 + \frac{x_2}{2})^2 + \frac{3x_2^2}{4}Part (v)Completing the square
Zero-product ruleParts (i), (iv), (v)Property of real numbers
x2≥0x^2 \ge 0 for real xx⁠; powers preserve order on positive numbersParts (i) to (v)Order properties of real numbers
Definitions of one-one (injective) and onto (surjective)All partsDefinitions 5 and 6, Section 1.3 (Lesson: types of functions)
x2:R→Rx^2 : \R\to\R is neither one-one nor ontoPart (iii)Example 11, Section 1.3
All numerical values and graph coordinatesCheck, figuresRecomputed in the site's verification script
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →