Introduction
A function is a special type of relation where every input has exactly one output. Functions are one of the most important concepts in mathematics, appearing in calculus, algebra, and beyond.
Interactive: Explore Function Graphs
Click different function types to see their graphs:
Definition of a Function
Formal Definition
A function $f$ from set $A$ to set $B$, written $f: A \to B$, is a relation such that:
$$\boxed{\text{Every element of } A \text{ is related to exactly one element of } B}$$Two Key Requirements
- Every element in $A$ must have an image in $B$
- Each element in $A$ can have only one image
Examples
Valid Functions:
$f: \{1, 2, 3\} \to \{a, b, c\}$
$f = \{(1, a), (2, b), (3, c)\}$ (valid)
$g = \{(1, a), (2, a), (3, a)\}$ (valid - same output is OK)
Not Functions:
$R = \{(1, a), (2, b)\}$ ✗ (3 has no image)
$R = \{(1, a), (1, b), (2, c), (3, d)\}$ ✗ (1 has two images)
Terminology
| Term | Definition | Notation |
|---|---|---|
| Domain | Set of all inputs (set $A$) | $\text{Dom}(f)$ |
| Co-domain | Set of possible outputs (set $B$) | - |
| Range | Set of actual outputs | $\text{Range}(f)$ |
| Image | Output for a specific input | $f(x)$ |
| Pre-image | Input(s) that give a specific output | $f^{-1}(\{y\})$ |
Important Relationship
$$\text{Range}(f) \subseteq \text{Co-domain}$$The range is always a subset of the co-domain!
Example
$f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = x^2$
- Domain: $\mathbb{R}$ (all real numbers)
- Co-domain: $\mathbb{R}$ (all real numbers)
- Range: $[0, \infty)$ (only non-negative reals are outputs)
- Image of 3: $f(3) = 9$
- Pre-image of 4: $\{-2, 2\}$ (since $f(-2) = f(2) = 4$)
Finding Domain and Range
Finding Domain
The domain is the set of all $x$ for which $f(x)$ is defined.
Common Restrictions:
| Expression | Restriction |
|---|---|
| $\frac{1}{g(x)}$ | $g(x) \neq 0$ |
| $\sqrt{g(x)}$ | $g(x) \geq 0$ |
| $\log(g(x))$ | $g(x) > 0$ |
| $\tan(x)$ | $x \neq \frac{\pi}{2} + n\pi$ |
Examples
Example 1: $f(x) = \frac{1}{x - 2}$
Domain: $x \neq 2$, so $\text{Dom}(f) = \mathbb{R} - \{2\}$ or $(-\infty, 2) \cup (2, \infty)$
Example 2: $f(x) = \sqrt{4 - x^2}$
Need: $4 - x^2 \geq 0 \Rightarrow x^2 \leq 4 \Rightarrow -2 \leq x \leq 2$
Domain: $[-2, 2]$
Example 3: $f(x) = \log(x - 1) + \sqrt{5 - x}$
Need: $x - 1 > 0$ AND $5 - x \geq 0$
So: $x > 1$ AND $x \leq 5$
Domain: $(1, 5]$
Finding Range
Method 1: Find all possible output values
Method 2: Set $y = f(x)$ and solve for $x$. The values of $y$ for which $x$ is valid form the range.
Example: $f(x) = \frac{x}{x + 1}$, Domain: $\mathbb{R} - \{-1\}$
Let $y = \frac{x}{x + 1}$
$y(x + 1) = x$
$yx + y = x$
$y = x - yx = x(1 - y)$
$x = \frac{y}{1 - y}$
This is defined for all $y \neq 1$.
Range: $\mathbb{R} - \{1\}$
Ways to Define Functions
1. Explicit Formula
$f(x) = x^2 + 2x + 1$
2. Piecewise Definition
$$f(x) = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$$This is the absolute value function $|x|$.
3. Implicit Definition
$x^2 + y^2 = 1$ defines $y$ as a function of $x$ only if we restrict to upper or lower semicircle.
4. Parametric Definition
$x = \cos(t)$, $y = \sin(t)$ for $t \in [0, 2\pi)$
Special Functions
Identity Function
$$I(x) = x$$- Domain: $A$
- Range: $A$
- Graph: Line through origin with slope 1
Constant Function
$$f(x) = c$$(where $c$ is a constant)
- Domain: $A$
- Range: $\{c\}$
- Graph: Horizontal line
Modulus (Absolute Value) Function
$$f(x) = |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$$- Domain: $\mathbb{R}$
- Range: $[0, \infty)$
Greatest Integer Function (Floor)
$$f(x) = \lfloor x \rfloor = \text{greatest integer} \leq x$$Examples: $\lfloor 2.7 \rfloor = 2$, $\lfloor -1.3 \rfloor = -2$
Fractional Part Function
$$\{x\} = x - \lfloor x \rfloor$$Always in the range $[0, 1)$.
Signum Function
$$\text{sgn}(x) = \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x = 0 \\ -1 & \text{if } x < 0 \end{cases}$$Algebra of Functions
For functions $f, g: A \to \mathbb{R}$:
| Operation | Definition | Domain |
|---|---|---|
| $(f + g)(x)$ | $f(x) + g(x)$ | $\text{Dom}(f) \cap \text{Dom}(g)$ |
| $(f - g)(x)$ | $f(x) - g(x)$ | $\text{Dom}(f) \cap \text{Dom}(g)$ |
| $(fg)(x)$ | $f(x) \cdot g(x)$ | $\text{Dom}(f) \cap \text{Dom}(g)$ |
| $(f/g)(x)$ | $\frac{f(x)}{g(x)}$ | $\text{Dom}(f) \cap \text{Dom}(g) \cap \{x : g(x) \neq 0\}$ |
Even and Odd Functions
Even Function
$f(-x) = f(x)$ for all $x$ in domain
- Graph is symmetric about y-axis
- Examples: $x^2$, $\cos(x)$, $|x|$
Odd Function
$f(-x) = -f(x)$ for all $x$ in domain
- Graph is symmetric about origin
- Examples: $x^3$, $\sin(x)$, $x$
Any function can be written as sum of even and odd parts:
$$f(x) = \underbrace{\frac{f(x) + f(-x)}{2}}_{\text{even}} + \underbrace{\frac{f(x) - f(-x)}{2}}_{\text{odd}}$$Practice Problems
Find the domain of $f(x) = \frac{\sqrt{x + 3}}{\log(2 - x)}$
Is $f(x) = x^3 + x$ even, odd, or neither?
Find the range of $f(x) = \frac{x^2}{x^2 + 1}$
Related Topics
Within Sets, Relations & Functions
- Types of Relations — Foundation for understanding functions
- Types of Functions — One-one, onto, bijective functions
- Composition of Functions — Combining functions
Math Connections
- Limits and Continuity — Behavior of functions
- Differentiation — Rate of change of functions
- Integration — Area under function curves
- Trigonometry — Trigonometric functions
Physics Applications
- Kinematics — Position, velocity as functions of time
- SHM — Sinusoidal functions describe oscillations
- Wave Motion — Wave functions
Chemistry Applications
- Chemical Kinetics — Rate as function of concentration
- Thermodynamics — State functions vs path functions