A function is a relation that assigns to each element of a set (called the domain) exactly one element of another set (called the codomain). Denoted f: A → B, it is a rule that maps every input to a unique output without ambiguity. Functions are among the most central concepts in mathematics and appear in calculus, linear algebra, programming, and virtually every applied science.
f: A → B, where f(x) = y for each x in A
LaTeX: f: A \to B, \quad f(x) = y
| Symbol | Meaning | Unit |
|---|---|---|
| f | The function | mapping |
| A | Domain (set of inputs) | set |
| B | Codomain (set of possible outputs) | set |
| x | Input element | element of A |
| y | Output element | element of B |
Problem
Let f: ℝ → ℝ be defined by f(x) = 2x² − 3x + 1. Find f(0), f(1), and f(−2).
Solution
Step 1: Substitute x = 0. — f(0) = 2(0)² − 3(0) + 1 = 0 − 0 + 1 = 1 Step 2: Substitute x = 1. — f(1) = 2(1)² − 3(1) + 1 = 2 − 3 + 1 = 0 Step 3: Substitute x = −2. — f(−2) = 2(−2)² − 3(−2) + 1 = 2(4) + 6 + 1 = 8 + 6 + 1 = 15
Answer
f(0) = 1, f(1) = 0, f(−2) = 15.
| Type | Definition | Example | Property |
|---|---|---|---|
| Injective (One-to-One) | Different inputs → different outputs | f(x) = 2x | No two x give same f(x) |
| Surjective (Onto) | Every element of B is mapped to | f(x) = x³ on ℝ | Range = Codomain |
| Bijective | Both injective and surjective | f(x) = x + 1 | Has an inverse |
| Constant | All inputs map to same output | f(x) = 5 | Range is a single element |
| Identity | Every input maps to itself | f(x) = x | f∘f = f |
Wikimedia Commons, CC BY-SA
The domain of a function is the complete set of all possible input values (x-values) for which the function is defined and produces a valid output. For a function f: A → B, the domain is the set A. Identifying the domain is a critical first step in analysing any function, as inputs outside the domain can lead to undefined expressions such as division by zero or square roots of negative numbers.
The range of a function is the set of all actual output values produced when the function is applied to every element of its domain. Unlike the codomain (which is the set of all possible outputs), the range is the set of values that are actually achieved. Determining the range is essential in understanding a function's behaviour and is applied in signal processing, statistics, and optimisation problems.
A bijection (or bijective function) is a function that is both injective (one-to-one) and surjective (onto), meaning every element of the domain maps to a unique element of the codomain, and every element of the codomain is mapped to by exactly one element of the domain. Bijections establish a perfect one-to-one correspondence between two sets and are fundamental in defining cardinality, invertible functions, and isomorphisms across mathematics.
From Latin "functio" (performance, execution), from "fungi" (to perform). The formal mathematical definition was developed by Leonhard Euler in the 18th century; the modern notation f(x) was introduced by him around 1734.