1

What Is a Function?

Informally, a function is a rule that assigns to each input exactly one output. Think of it as a reliable process — the same input always produces the same result.

📐 Formal Definition

Function

A function $f$ from a set $A$ to a set $B$ is a rule that assigns to each element $x \in A$ exactly one element $f(x) \in B$.

We write: $f: A \to B$ and we read it as "f maps A to B."

Independent and Dependent Variables

Functions involve two types of variables:

📥 Independent Variable

The Input

The variable you freely choose or control. Usually called $x$.
It is independent because its value does not depend on anything else.

📤 Dependent Variable

The Output

The variable whose value is determined by the input. Usually called $y$ or $f(x)$.
It is dependent because it depends on what $x$ is.

💡 Example

For $y = f(x) = 2x + 1$: you choose $x$ (independent), then $y$ is calculated (dependent).
Pick $x = 3$ → $y = 7$.   Pick $x = -1$ → $y = -1$.   You control $x$; $y$ responds.

Functions as Ordered Pairs

A function can also be described as a set of ordered pairs $(x, y)$ where each first element (input) appears at most once.

✅ This IS a function

$\{(1, 3),\;(2, 7),\;(4, 3)\}$

Each input (1, 2, 4) appears exactly once. Two inputs sharing the same output (3) is fine.

❌ NOT a function

$\{(2, 5),\;(2, 9),\;(3, 4)\}$

Input $x = 2$ appears twice with different outputs (5 and 9). Not allowed.

✅ Is a Function

Every input has one and only one output.
$x = 2 \;\Rightarrow\; f(2) = 4$ — always.

❌ NOT a Function

One input produces two or more outputs.
$x = 4 \;\Rightarrow\; y = 2$ and $y = -2$ — not allowed!

📝 Concrete Example

$f(x) = x^2$

For every number $x$ you put in, you get exactly one number out (its square):

$f(3) = 9 \qquad f(-3) = 9 \qquad f(0) = 0 \qquad f(5) = 25$

Note: two different inputs can produce the same output ($f(3) = f(-3) = 9$) and that's perfectly fine — what's NOT allowed is one input giving two different outputs.

2

The Function Machine

The most intuitive way to think about a function is as a machine: you drop a number in the top, the machine processes it according to its rule, and a (unique) result comes out the other side.

3
Input $x$
Function
$f(x) = x^2$
9
Output $f(x)$

Try different inputs and functions — one input always gives exactly one output.

💡 Key Insight

The machine metaphor makes the uniqueness rule crystal clear: a machine that sometimes gives you a different result for the same input is broken. A function is a deterministic, reliable machine.

3

Domain and Range

Every function lives between two sets. The set of allowed inputs is the domain, and the set of all possible outputs is the range (also called the image).

📥 Domain

Domain of $f$

The set of all input values $x$ for which $f(x)$ is defined. We write it as $\text{Dom}(f)$ or $D_f$.

$D_f = \{x \in \mathbb{R} : f(x) \text{ is defined}\}$

📤 Range

Range of $f$

The set of all output values that $f$ actually produces. We write it as $\text{Range}(f)$ or $\text{Im}(f)$.

$\text{Im}(f) = \{f(x) : x \in D_f\}$

🖥️ Interactive — Domain & Range Visualizer Interactive
Function curve
Input $x$ (domain)
Output $f(x)$ (range)

Finding the Domain — Common Restrictions

  1. 1

    Denominators cannot be zero

    $f(x) = \dfrac{1}{x-3}$ → exclude $x = 3$ → $D_f = (-\infty, 3) \cup (3, +\infty)$

  2. 2

    Even roots require non-negative radicand

    $f(x) = \sqrt{x-2}$ → need $x - 2 \geq 0$ → $D_f = [2, +\infty)$

  3. 3

    Logarithms require positive argument

    $f(x) = \ln(x+1)$ → need $x + 1 > 0$ → $D_f = (-1, +\infty)$

  4. 4

    Polynomials have no restrictions

    $f(x) = x^3 - 5x + 2$ → defined for all real numbers → $D_f = \mathbb{R} = (-\infty, +\infty)$

Function Domain Range
$f(x) = x^2$ $(-\infty, +\infty)$ $[0, +\infty)$
$f(x) = \sqrt{x}$ $[0, +\infty)$ $[0, +\infty)$
$f(x) = \dfrac{1}{x}$ $(-\infty,0) \cup (0,+\infty)$ $(-\infty,0) \cup (0,+\infty)$
$f(x) = \sin(x)$ $(-\infty, +\infty)$ $[-1, 1]$
$f(x) = e^x$ $(-\infty, +\infty)$ $(0, +\infty)$
$f(x) = \ln(x)$ $(0, +\infty)$ $(-\infty, +\infty)$
4

The Vertical Line Test

Given a graph, how do you know whether it represents a function? Use the Vertical Line Test: draw (or imagine) vertical lines sweeping across the graph.

📏 Vertical Line Test

A graph represents a function if and only if

every vertical line $x = a$ intersects the graph in at most one point. If any vertical line hits the graph at two or more points, the graph does not represent a function.

🖥️ Vertical Line Test — Move cursor left/right
Move mouse over graph
5

Types of Functions

Functions come in many flavors. Here are the most important families you'll encounter in calculus:

📏

Linear

f(x) = mx + b

Constant rate of change. Straight line graph. $m$ is the slope.

⛰️

Quadratic

f(x) = ax² + bx + c

Parabola. Appears in projectile motion, optimization.

🌊

Polynomial

f(x) = aₙxⁿ + … + a₀

Smooth, continuous everywhere. The simplest functions to work with.

🔄

Rational

f(x) = p(x) / q(x)

Ratio of polynomials. May have vertical asymptotes where $q(x)=0$.

🌱

Radical

f(x) = ⁿ√g(x)

Involves roots. Domain may be restricted to keep the radicand valid.

📈

Exponential

f(x) = aˣ, a > 0

Explosive growth or decay. Models population, radioactive decay, finance.

🔢

Logarithmic

f(x) = logₐ(x)

Inverse of exponential. Compresses large ranges: decibels, pH, Richter scale.

〰️

Trigonometric

sin(x), cos(x), tan(x)…

Periodic functions. Model waves, oscillations, circular motion.

🧱

Piecewise

f(x) = { rule₁, rule₂, …}

Different formula on different parts of the domain. Tax brackets, shipping rates.

🖥️ Function Gallery — Select a function to graph Interactive
6

Functions in the Real World

Functions are everywhere. Any time there's a reliable relationship between two quantities — where one uniquely determines the other — you have a function.

🎰

Vending Machine

Input: button press (A1, B2…)
Output: one specific item

Each button maps to exactly one product — a perfect function!

🌡️

Temperature Conversion

Input: temperature in °C
Output: temperature in °F

$F(C) = \dfrac{9}{5}C + 32$

🚀

Projectile Height

Input: time $t$ (seconds)
Output: height $h$ (meters)

$h(t) = -4.9t^2 + v_0 t + h_0$

💰

Compound Interest

Input: time $t$ (years)
Output: account balance $A$

$A(t) = P\!\left(1+\dfrac{r}{n}\right)^{nt}$

🔊

Sound Intensity

Input: intensity $I$ (W/m²)
Output: loudness in decibels

$L(I) = 10\log_{10}\!\left(\dfrac{I}{I_0}\right)$

🌍

Population Growth

Input: time $t$
Output: population $P$

$P(t) = P_0 \, e^{rt}$

Ohm's Law

Input: current $I$ (Amps)
Output: voltage $V$ (Volts)

$V(I) = I \cdot R$ (R = resistance)

🔑 Pattern to recognize

In every real-world function, you can identify: a controlled input (the thing you change or measure), a rule (the formula or process), and a determined output (the result). This input → rule → output structure is the heart of what a function is.

7

Function Notation & Evaluation

The notation $f(x)$ does not mean "$f$ times $x$." It means "the output of function $f$ when the input is $x$."

📝 Worked Example

Let $f(x) = 3x^2 - 2x + 1$. Evaluate:

$f(0) = 3(0)^2 - 2(0) + 1 = 1$

$f(2) = 3(4) - 4 + 1 = 9$

$f(-1) = 3(1) - 2(-1) + 1 = 3 + 2 + 1 = 6$

$f(a) = 3a^2 - 2a + 1$  (substitute the variable $a$)

$f(x+h) = 3(x+h)^2 - 2(x+h) + 1$  (this appears in the definition of the derivative!)

⚡ Looking Ahead

The expression $\dfrac{f(x+h) - f(x)}{h}$ is called the difference quotient. When you take the limit as $h \to 0$, you get the derivative — the central concept of differential calculus. Everything starts with knowing how to evaluate a function.

8

Key Takeaways

  1. A function maps each input to exactly one output

    Same input → same output. Always. No exceptions.

  2. The domain is where the function "lives" (inputs)

    Find it by excluding values that break the rule (zero denominators, negative radicands, etc.)

  3. The range is the set of all possible outputs

    It tells you what values $f$ can actually produce.

  4. Use the Vertical Line Test on graphs

    If any vertical line hits the graph more than once → not a function.

  5. Function notation $f(x)$ means evaluation, not multiplication

    You substitute the input value everywhere you see $x$ in the formula.