Skip to content

Function, Domain and Range

Mathematics Algebra Difficulty 2/5

Beginning of the lesson

What Is a Function?

Definition

A function is a rule that assigns exactly one output to each allowable input. We write

$$f: X \to Y, \qquad y = f(x)$$

where:

  • $X$ is the domain — the set of all allowable inputs.
  • $Y$ is the codomain — the set that contains all potential outputs.
  • $x$ is the argument (input).
  • $f(x)$ is the value (output); also called the image of $x$ under $f$.
Key point: The range (set of values actually produced) is always a subset of the codomain. Never assume range = codomain!
Mapping Diagram

Think of a function as a machine: you feed in an element from $X$, and the machine produces exactly one element in $Y$.

Mathematical diagram

Why "One Input — One Output" Matters

Not every correspondence between $x$ and $y$ is a function. The defining property is that each input produces exactly one output.

✓ IS a Function

$y = x^2$

For every $x$, there is exactly one $y$. For example, $x = 3 \Rightarrow y = 9$ (only one answer).

✗ NOT a Function

$x^2 + y^2 = 4$ (circle)

For $x = 0$, we get $y = 2$ and $y = -2$ — two outputs for one input!

The Vertical Line Test

A graph represents a function if and only if every vertical line intersects the graph at most once. If any vertical line hits the graph in two or more points, the relation is not a function.

$y = x^2$ — Passes VLT ✓

Interactive visualization — available in the full lesson

$x^2 + y^2 = 4$ — Fails VLT ✗

Interactive visualization — available in the full lesson

Drag the red point left and right. On the parabola, the vertical line always hits one point. On the circle, it can hit two.

Ways to Define a Function

Functions can be specified in several equivalent ways:

MethodExampleWhen to Use
Formula$f(x) = 2x + 3$When a clear algebraic rule exists
Table$\{(1,5),(2,7),(3,9)\}$When data is collected experimentally
GraphA curve in the $xy$-planeFor visual analysis of behaviour
Verbal description"Double the input and add 3"Real-world modelling, word problems
Piecewise definition$f(x) = \begin{cases} x & x \ge 0 \\ -x & x < 0 \end{cases}$When the rule changes across intervals

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers