• Foundation
  • About 17 min
  • 5 practice questions

Functions: when a relation becomes a function

Test whether a relation is a function, use f(x) notation for images and preimages, and find the domain and range of real functions given by formulas.

If something looks wrong, please tell us.

By the end of this lesson you can

  • State the definition of a function from A to B and test relations against it.
  • Use the notation f : A → B and f(a) = b, image and preimage.
  • Recognise real valued functions and real functions.
  • Find the domain of a real function given by a formula, and its range in simple cases.

A function is a special relation in which every input has exactly one output. It is the single most important idea in mathematics after number itself: a formula for the area of a circle, the conversion from Celsius to Fahrenheit and the height of a thrown ball over time are all functions.

Definition

A relation f from a non-empty set A to a non-empty set B is a function if every element of A has one and only one image in B. Two things must hold: (1) the domain of f is the whole of A, so no element of A is left without an image; and (2) no element of A has two different images, so no two distinct pairs in f share the same first element.

We write f : A → B. If (a, b) ∈ f we write f(a) = b; b is the image of a under f and a is a preimage of b. Other words for a function are map and mapping. A is the domain, B the codomain, and the set of all images is the range.

Relation or function?

  • A function
    • Every element of A has an image
    • Each has exactly one image
    • Two inputs may share an output
    • Example: {(1, 4), (2, 4), (3, 9)} from {1, 2, 3}
  • Not a function
    • Some element of A has no image
    • Or some element has two images
    • Example: {(1, 4), (1, 5), (2, 6)}
    • Example: y² = x on positive numbers, x ↦ ±√x

Worked example 1: testing relations

Which of these relations, each on the set of first elements listed, are functions? (i) {(1, 5), (2, 5), (3, 5), (4, 5)}: each first element appears once, so it is a function; it is a constant function with range {5}. (ii) {(2, 3), (2, 7), (5, 1)}: the element 2 has two images, 3 and 7, so it is not a function. (iii) {(−1, 1), (0, 0), (1, 1), (2, 4)}: each first element appears once, so it is a function with domain {−1, 0, 1, 2} and range {0, 1, 4}. Note that two inputs, −1 and 1, sharing the output 1 is allowed.

Worked example 2: a relation that is not a function

Let A = {1, 2, 3, 4, 5} and R = {(x, y) : y = x + 2, x, y ∈ A}. Working: R = {(1, 3), (2, 4), (3, 5)}. The elements 4 and 5 of A have no image in A (6 and 7 are outside A). So R is not a function from A to A, even though no element has two images.

Real functions

A function whose range is R or a subset of R is called a real valued function. If its domain is also R or a subset of R, it is a real function. For real functions given by a formula, the domain is taken to be the set of all real x for which the formula gives a real number, unless it is stated otherwise.

Finding the domain of a real function
Formula containsCondition for the domainExample
A fraction p(x)/q(x)q(x) ≠ 01/(x − 3): x ≠ 3
A square root √g(x)g(x) ≥ 0√(x − 1): x ≥ 1
√g(x) in a denominatorg(x) > 01/√(x + 2): x > −2
Only a polynomialNo restrictionx² + 1: all of R

Worked example 3: values of a function

Let f(x) = 3x − 4. Then f(0) = −4, f(2) = 2, f(−1) = −7. To find the preimage of 11, solve 3x − 4 = 11: 3x = 15, so x = 5.

Worked example 4: temperature conversion

The function t(C) = 9C/5 + 32 converts degrees Celsius to degrees Fahrenheit. Working: t(0) = 32, t(100) = 180 + 32 = 212, and t(−40) = −72 + 32 = −40. To find C when t(C) = 104: 9C/5 = 72, so C = 72 × 5/9 = 40.

Worked example 5: domain of a rational function

Find the domain of f(x) = (x² + 1)/(x² − 7x + 10). Working: the denominator factorises as (x − 2)(x − 5), which is zero at x = 2 and x = 5. So the domain is R − {2, 5}.

Worked example 6: domain and range with a square root

Find the domain and range of f(x) = √(16 − x²). Working: we need 16 − x² ≥ 0, that is x² ≤ 16, so −4 ≤ x ≤ 4 and the domain is [−4, 4]. For x in this interval, 16 − x² runs from 0 (at x = ±4) to 16 (at x = 0), so √(16 − x²) runs from 0 to 4. The range is [0, 4].

f : A → B is a function when every element of A has exactly one image in B. Many-to-one is allowed; one-to-many is not.

— Definition of a function

Key takeaways: a function gives every element of its domain exactly one image. Check two things: nothing is left out, and nothing has two images. For a real function given by a formula, the domain excludes values that make a denominator zero or a square root negative.

Check your understanding

  1. 1. Which relation is a function on the set {1, 2, 3}?

    1. {(1, 2), (1, 3), (2, 3), (3, 1)}
    2. {(1, 3), (2, 3), (3, 3)}
    3. {(1, 1), (2, 2)}
    4. {(1, 2), (2, 1), (2, 3), (3, 3)}
    Show answer

    Answer: B. In {(1, 3), (2, 3), (3, 3)} each of 1, 2, 3 has exactly one image (all go to 3), so it is a function. The first and last relations give 1 or 2 two images, and {(1, 1), (2, 2)} leaves 3 with no image.

  2. 2. If f(x) = x² − 3x, what is f(−2)?

    1. −2
    2. 10
    3. −10
    4. 2
    Show answer

    Answer: B. f(−2) = (−2)² − 3 × (−2) = 4 + 6 = 10. A common slip is to write −3 × −2 as −6, which would give −2.

  3. 3. What is the domain of f(x) = 1/(x² − 9)?

    1. R − {9}
    2. R − {3}
    3. R − {−3, 3}
    4. (−3, 3)
    Show answer

    Answer: C. The denominator x² − 9 = (x − 3)(x + 3) is zero at x = 3 and x = −3. Every other real number gives a real value, so the domain is R − {−3, 3}.

  4. 4. What is the range of f(x) = 3 − x², x ∈ R?

    1. (−∞, 3]
    2. [3, ∞)
    3. R
    4. (−∞, 3)
    Show answer

    Answer: A. x² ≥ 0 for every real x, so 3 − x² ≤ 3, with equality at x = 0. Every value below 3 is also reached, so the range is (−∞, 3]. The bracket at 3 is square because 3 itself is attained.

  5. 5. Assertion (A): The relation {(x, y) : y² = x, x, y ∈ R, x > 0} is not a function of x. Reason (R): For x = 4, both y = 2 and y = −2 satisfy y² = x.

    1. Both A and R are true, and R is the correct explanation of A.
    2. Both A and R are true, but R is not the correct explanation of A.
    3. A is true, but R is false.
    4. A is false, but R is true.
    Show answer

    Answer: A. A function must give each input one image. Here the input 4 is related to both 2 and −2, so the relation is not a function. Both statements are true and R is exactly why A holds.

Privacy · Terms · Refunds · Delivery