# Concept of function, domain, range, and graph

> IB Mathematics: Applications and Interpretation SL · Unit 2: Functions
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u2-concept-of-function-domain-range/

This sub-topic introduces the core definition of a function, the foundational building block for all further work in IB AI SL. You will learn to identify functions, find their domain and range, and interpret these from graphs and equations.

**Prerequisites:** Basic set notation and interval notation; Coordinate geometry and plotting graphs

## Learning objectives

- Define a function and distinguish between relations and functions
- Find the domain of a function from equation or graph
- Find the range of a function from equation or graph
- Use the vertical line test to identify functions graphically

## Defining a Function: Relations vs Functions

**Function** — A relation between inputs and outputs where every input maps to exactly one output. Multiple inputs can map to the same output, but one input cannot map to multiple outputs.

*Notation:* $f(x)$

*Example:* $f(x) = 2x + 3$ is a function, as every $x$ gives exactly one $f(x)$

For graphical relations, we use the **vertical line test** to check if a relation is a function: if any vertical line intersects the graph more than once, the relation is not a function.

**Worked example:** Determine if the graph of $x^2 + y^2 = 16$ (a circle of radius 4 centered at the origin) is a function.

1. Recall the vertical line test rule: any vertical line crossing the graph more than once means the relation is not a function.
2. Draw a vertical line at $x=0$. This line intersects the circle at two points:
3. $$y = 4 \text{ and } y = -4$$
4. One input $x=0$ maps to two outputs, so the relation is not a function.

> **tip**
>
> Even if multiple inputs map to the same output, it is still a function. Only one input mapping to multiple outputs violates the definition.

> **Exam tip:** If an exam question asks "is this relation a function", always justify your answer with the vertical line test or the definition.

## Finding the Domain of a Function

The domain is the set of all valid input ($x$) values. We exclude values that create undefined expressions: division by zero, or square (even) roots of negative numbers. For real-world functions, domain is also restricted by context (e.g. time cannot be negative).

**Worked example:** Find the domain of $f(x) = \sqrt{2x - 6}$, write your answer in interval notation.

1. Identify the restriction: the expression under a square root must be non-negative for real-valued functions.
2. Set up and solve the inequality:
3. $$2x - 6 \geq 0 \\ 2x \geq 6 \\ x \geq 3$$
4. Write the domain in interval notation, using a closed bracket for the included endpoint $x=3$.
5. $$\text{Domain: } [3, \infty)$$

> **info**
>
> IB AI SL accepts both interval notation and set notation for domain and range, unless the question specifies a format.

## Calculating the Range of a Function

The range is the set of all possible output ($y$) values a function can produce, given its domain. The range is often restricted by the shape of the function: for example, quadratics have a minimum or maximum that bounds the range.

**Worked example:** Find the range of $f(x) = (x - 2)^2 + 1$, where the domain is all real numbers $x$.

1. All squared real numbers are non-negative, so:
2. $$(x - 2)^2 \geq 0$$
3. Add 1 to both sides to get the inequality for $f(x)$:
4. $$(x - 2)^2 + 1 \geq 1$$
5. The minimum output is 1, and $f(x)$ increases to infinity. Write the range in interval notation:
6. $$\text{Range: } [1, \infty)$$

**Check your understanding**

Test your understanding:

1. What is the range of $f(x) = 5 - x^2$ for all real $x$?

   - $(-\infty, 5]$
   - $[5, \infty)$
   - $(-\infty, 5)$
   - All real numbers

   *Why:* Correct! $-x^2 \leq 0$, so $5 - x^2 \leq 5$, with maximum value 5.

## Domain and Range from Graphs

When reading domain and range from a graph: domain is the spread of the graph along the horizontal $x$-axis, and range is the spread along the vertical $y$-axis. Closed circles mean the endpoint is included, open circles mean it is not included.

**Worked example:** A function has a graph starting at a closed circle $(-2, 1)$, and ending at an open circle $(3, 6)$. Find the domain and range.

1. Read the $x$-values covered: from $x=-2$ (included) to $x=3$ (not included). So domain is:
2. $$[-2, 3)$$
3. Read the $y$-values covered: from $y=1$ (included) to $y=6$ (not included). So range is:
4. $$[1, 6)$$

> **warning**
>
> Always check for any gaps or holes in the graph, and exclude those $x$-values from the domain.

> **Exam tip:** Marks are awarded for correct notation, so make sure you use the correct bracket type for included/excluded endpoints.

## Common pitfalls

- **Wrong:** Assuming all relations are functions, skipping the vertical line test.
  - Why it fails: Many common relations like circles, horizontal parabolas, and ellipses are not functions.
  - Correct: Always check if the relation meets the function definition, or apply the vertical line test for graphs.
- **Wrong:** Confusing domain and range, swapping input and output values.
  - Why it fails: Domain describes inputs (x) and range describes outputs (y), swapping them gives the entirely wrong answer.
  - Correct: Remember: Domain is Horizontal (x-axis), Range is Vertical (y-axis).
- **Wrong:** Including values that cause division by zero in the domain.
  - Why it fails: Division by zero is undefined, so these inputs are not valid.
  - Correct: Set the denominator equal to zero, solve for x, and exclude those values from your domain.
- **Wrong:** Including negative values under a square root in the domain.
  - Why it fails: IB AI SL only works with real-valued functions, so square roots of negative numbers are undefined.
  - Correct: Always set the expression under a square root to be greater than or equal to zero.
- **Wrong:** Treating open circle endpoints as included in domain/range.
  - Why it fails: An open circle means the point is not part of the graph, so the value is not included.
  - Correct: Use closed brackets for closed circles, open parentheses for open circles in interval notation.

## Cheatsheet

| Concept | Definition | Key Rule |
| --- | --- | --- |
| Function | Each input maps to exactly 1 output | Use vertical line test for graphs |
| Domain | Set of all valid input (x) values | Exclude division by zero, negative roots |
| Range | Set of all valid output (y) values | Check minimum/maximum values of function |
| Vertical Line Test | Check if graph is a function | If crosses > once, not a function |

## What's next

Now that you have mastered the core concepts of functions, domain, and range, you are ready to explore more complex function topics that build on this foundation. This core definition is used in every function topic you will encounter for IB AI SL, from linear functions to exponential models, and it is essential for solving the real-world application problems that are the focus of this syllabus. Understanding how to restrict domain and interpret range will also help you when you work with composite and inverse functions later in the course. You will apply these skills constantly when drawing graphs, solving equations, and interpreting results in exam questions.

- [Inverse Functions](https://www.owlsprep.com/study/ib-math-ai-sl-u2-inverse-functions/)
- [Linear functions and their graphs](https://www.owlsprep.com/study/ib-math-ai-sl-u2-linear-functions-and-their-graphs/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-sl-u2-concept-of-function-domain-range/
