# Functions

> Math: Analysis and Approaches (IB Mathematics: Analysis and Approaches SL and HL) · Functions. A free chapter of Atlas, the interactive visual textbook: https://atlasclass.app/math-aa/ibfunctions/. On the site each page sits beside an interactive 3D figure; here it is the words and the math (LaTeX) alone.

## 2.1 · IB Math AA · Equations of lines

*gradient, parallel and perpendicular*

This chapter is about functions: rules that turn each input into one output, their graphs, and how to move, combine, undo and solve them. It starts with the simplest graph, a straight line.

The **gradient** is rise over run. Through $A(1, 2)$ and $B(4, 8)$: $m = \frac{8 - 2}{4 - 1} = 2$. Three ways to write the same line:

$$\begin{gathered} y = mx + c \\ y - y_1 = m(x - x_1) \\ ax + by + d = 0 \end{gathered}$$

Here $y - 2 = 2(x - 1)$, which is $y = 2x$. **Parallel** lines share a gradient. **Perpendicular** lines have gradients that multiply to $-1$: $m_1 m_2 = -1$. In the figure the red line turns about $(1, 2)$ and the blue one stays at right angles: the perpendicular to $y = 2x$ there is $y - 2 = -\tfrac{1}{2}(x - 1)$, or $x + 2y - 5 = 0$.

## 2.2 · IB Math AA · Functions, domain and range

*one input, one output, and the graph it makes*

A **function** takes each input from its **domain** to exactly one output. $f(x) = x^2 - 2$ squares and subtracts 2; on the domain $-2 \le x \le 3$ it is fed the blue inputs and plots the red points.

The **range** is every output that actually comes out: here $-2 \le f(x) \le 7$. Not $f(-2) = 2$ to $f(3) = 7$: the least output is at $x = 0$, inside the domain. Sketch the graph before reading off a range.

Domains are limited by what can be calculated: $\sqrt{x - 1}$ needs $x \ge 1$, and $\frac{1}{x - 3}$ needs $x \ne 3$. A graph is a function if every vertical line meets it at most once. Write $f: x \mapsto x^2 - 2$ or $f(x) = x^2 - 2$; a sketch should show the shape, the intercepts and the ends of the domain.

## 2.2 · IB Math AA · Inverse functions

*a reflection in y = x*

The **inverse** $f^{-1}$ undoes $f$: if $f(2) = 3$ then $f^{-1}(3) = 2$. Every point $(a, b)$ on $f$ becomes $(b, a)$ on $f^{-1}$, and swapping coordinates is reflecting in the line $y = x$.

In the figure $f(x) = 2^x - 1$ turns over the mirror line, out of the paper and back down, and lands exactly on $f^{-1}(x) = \log_2(x + 1)$.

$$\begin{gathered} f\left(f^{-1}(x)\right) = x \\ f^{-1}\left(f(x)\right) = x \end{gathered}$$

The domain of $f^{-1}$ is the range of $f$: here $x > -1$. Only a **one-to-one** function has an inverse: if a horizontal line could meet the graph twice, the reflection would fail the vertical line test.

## 2.4 · IB Math AA · Key features of graphs

*intercepts, turning points and the shape between*

To sketch or describe a graph, find its key features. For $f(x) = \tfrac{1}{2}(x + 2)(x - 1)(x - 3)$:

**Zeros** ($x$-intercepts), where $f(x) = 0$: $x = -2,\ 1,\ 3$, read straight from the factors. **$y$-intercept**, $f(0) = \tfrac{1}{2}(2)(-1)(-3) = 3$.

**Turning points**, where the graph levels off: a local maximum near $(-0.79,\ 4.1)$ and a local minimum near $(2.12,\ -2.03)$. A graphic display calculator (GDC) finds these, and intersections, to 3 significant figures; give them that way.

Then the ends: as $x \to \infty$, $f(x) \to \infty$, and as $x \to -\infty$, $f(x) \to -\infty$. Other graphs add **asymptotes**, lines approached but never reached, which the next pages meet. In the figure the tangent flattens at each turning point.

## 2.5 · IB Math AA · Composite and inverse functions

*one machine after another, and undoing one*

The **composite** $(f \circ g)(x) = f(g(x))$ applies $g$ first, then $f$. With $g(x) = x + 1$ and $f(x) = x^2$: $(f \circ g)(x) = (x + 1)^2$, so $g(2) = 3$ and $f(3) = 9$.

Order matters: $(g \circ f)(x) = x^2 + 1$, and $(g \circ f)(2) = 5$. In the figure each input travels down two number lines: blue for $g$, red for $f$.

To find an inverse, write $y = f(x)$, swap $x$ and $y$, and solve for $y$. For $f(x) = 2x + 3$: $x = 2y + 3$, so $f^{-1}(x) = \frac{x - 3}{2}$. Check: $f^{-1}(f(4)) = f^{-1}(11) = 4$.

$$\begin{gathered} (f \circ f^{-1})(x) = x \\ (f^{-1} \circ f)(x) = x \\ \text{(the identity)} \end{gathered}$$

## 2.6 · IB Math AA · Quadratic functions

*three forms, three things to read off*

A quadratic’s graph is a **parabola**, symmetric about a vertical line. Each way of writing it shows something different:

$$\begin{gathered} y = ax^2 + bx + c \\ y = a(x - p)(x - q) \\ y = a(x - h)^2 + k \end{gathered}$$

The first shows the $y$-intercept $c$; the second the zeros $p$ and $q$; the third, **vertex form**, the vertex $(h, k)$. The axis of symmetry is $x = h = -\frac{b}{2a}$. In the figure $a$, $h$ and $k$ slide: $h$ and $k$ move the red curve, $a$ narrows it, and the blue axis follows the vertex.

One curve, three ways: $2(x - 1)^2 -8 = 2x^2 - 4x - 6 = 2(x + 1)(x - 3)$. Vertex $(1, -8)$, zeros $-1$ and $3$, $y$-intercept $-6$.

## 2.7 · IB Math AA · Quadratic equations and inequalities

*the discriminant counts the roots*

The roots of $ax^2 + bx + c = 0$ are where the parabola meets the $x$-axis:

$$\begin{gathered} x = \frac{-b \pm \sqrt{\Delta}}{2a} \\ \Delta = b^2 - 4ac \end{gathered}$$

The **discriminant** $\Delta$ decides how many: $\Delta > 0$ two real roots, $\Delta = 0$ one repeated root (the vertex touches the axis), $\Delta none. In the figure $y = x^2 - 2x + c$ rises with $c$: $\Delta = 4 - 4c$ goes through 0 at $c = 1$.

For $x^2 - 2x -3 = 0$, $\Delta = 16$ and $x = -1$ or $x = 3$. For the **inequality** $x^2 - 2x -3 , the parabola is below the axis between its roots: $-1 , the blue span. A “greater than” takes the two outer pieces instead.

## 2.8 · IB Math AA · Reciprocal and rational functions

*asymptotes, and a curve in two pieces*

The **reciprocal function** $f(x) = \frac{1}{x}$ has two branches, a vertical asymptote $x = 0$ and a horizontal one $y = 0$. It is its own inverse: swapping $x$ and $y$ in $xy = 1$ changes nothing.

$$\begin{gathered} f(x) = \frac{ax + b}{cx + d} \\ x = -\frac{d}{c}, \qquad y = \frac{a}{c} \end{gathered}$$

The vertical asymptote is where the denominator is 0; the horizontal one is where $f$ levels off for large $|x|$, the ratio of the $x$-coefficients. For $f(x) = \frac{2x + 1}{x - 1}$: $x = 1$ and $y = 2$, $x$-intercept $-\tfrac{1}{2}$ and $y$-intercept $-1$.

It is a stretched, shifted $1/x$: $\frac{2x + 1}{x - 1} = 2 + \frac{3}{x - 1}$. So it is symmetric about where the asymptotes cross, $(1, 2)$: the two red and black points always face each other across it.

## 2.9 · IB Math AA · Exponential and logarithmic functions

*each the other’s mirror image*

$f(x) = b^x$ ($b > 0,\ b \ne 1$) has domain all real $x$, range $y > 0$, passes through $(0, 1)$ and has asymptote $y = 0$. Its inverse is $\log_b x$: domain $x > 0$, through $(1, 0)$, asymptote $x = 0$.

$$\begin{gathered} e^{\ln x} = x \ (x > 0) \\ \ln\left(e^{x}\right) = x \\ b^x = e^{x \ln b} \end{gathered}$$

In the figure the base $b$ changes, and the red $b^x$ and blue $\log_b x$ stay reflections of each other in $y = x$: the point $(t, b^t)$ on one is $(b^t, t)$ on the other. The bigger $b$, the steeper the exponential and the flatter the log.

Every exponential is $e$ to some multiple of $x$: $2^x = e^{x\ln 2} \approx e^{0.693x}$. That is why $e^x$ and $\ln x$ are the ones calculus uses.

## 2.10 · IB Math AA · Solving equations

*by algebra where you can, by graph where you can’t*

Some equations have no algebraic solution. $2^x = x + 2$ is one: draw $y = 2^x$ and $y = x + 2$ and read off where they cross.

A GDC gives $x \approx -1.69$ and $x = 2$ (check: $2^2 = 4 = 2 + 2$). In the figure the black gap between the graphs shrinks to nothing at each solution and changes sign there. The same question can be asked as finding the zeros of $2^x - x - 2$.

Others yield to algebra once you spot a hidden quadratic. In $e^{2x} - 5e^{x} + 6 = 0$ put $u = e^x$:

$$\begin{aligned} &u^2 - 5u + 6 = 0 \\ \Rightarrow\; &(u - 2)(u - 3) = 0 \\ \Rightarrow\; &x = \ln 2 \text{ or } x = \ln 3 \end{aligned}$$

That is $x \approx 0.693$ or $x \approx 1.099$. Reject any $u \le 0$: $e^x$ is never 0 or negative. Exact answers ($\ln 2$) when the question asks for them; 3 significant figures otherwise.

## 2.11 · IB Math AA · Transformations of graphs

*move, stretch, reflect, one step at a time*

Each change to the formula does one thing to the graph:

$$\begin{aligned} y &= f(x) + b \quad \text{up } b \\ y &= f(x - a) \quad \text{right } a \\ y &= p\,f(x) \quad y\text{-stretch} \times p \\ y &= f(qx) \quad x\text{-stretch} \times \tfrac{1}{q} \\ y &= -f(x) \quad \text{flip in } x\text{-axis} \\ y &= f(-x) \quad \text{flip in } y\text{-axis} \end{aligned}$$

Changes inside the bracket act on $x$ and go the “wrong” way: $f(x - 2)$ moves right, $f(2x)$ squeezes by half.

In the figure $y = \sqrt{x}$ becomes $y = 3 - 2\sqrt{x - 2}$ in four steps: right 2, stretch $\times 2$, reflect in the $x$-axis, up 3. Follow one point: $(4, 2)$ goes to $(6, 2)$, $(6, 4)$, $(6, -4)$, then $(6, -1)$. Order matters: stretching after moving up would stretch the 3 as well.

## 2.12 · AA HL · Polynomial functions

*factor and remainder theorems, sums and products of roots*

Divide a polynomial $p(x)$ by $(x - a)$ and the **remainder** is $p(a)$. When that is 0, $(x - a)$ is a **factor**:

$$p(x) = (x - a)\,q(x) + p(a)$$

For $p(x) = x^3 - 2x^2 - 5x + 6$, $p(1) = 0$, so $x - 1$ is a factor, and $p(x) = (x - 1)(x + 2)(x - 3)$. Divided by $x - 2$ it leaves $p(2) = -4$. In the figure the blue bar is the remainder for each $a$: it vanishes only at a root.

For $a_n x^n + a_{n-1}x^{n-1} + \dots + a_0$, the roots (real or complex) have

$$\begin{gathered} \text{sum} = -\frac{a_{n-1}}{a_n} \\ \text{product} = \frac{(-1)^n a_0}{a_n} \end{gathered}$$

Here the sum is $-2 + 1 + 3 = 2$ and the product $-6$, without solving anything.

## 2.14 · AA HL · Odd, even and self-inverse functions

*symmetries of a graph*

A function is **even** if $f(-x) = f(x)$: its graph is symmetric in the $y$-axis ($x^2$, $\cos x$). It is **odd** if $f(-x) = -f(x)$: unchanged by a half-turn about the origin ($x^3$, $\sin x$).

In the figure each right half turns in space: the even one over the $y$-axis, the odd one about the origin, and each lands on its left half. Most functions are neither: $x^2 + x$ is not symmetric either way.

A **self-inverse** function undoes itself, $f(f(x)) = x$, so its graph is symmetric in $y = x$: $\frac{1}{x}$, $-x$, and $\frac{2x + 1}{x - 2}$, since

$$\begin{aligned} f(f(x)) &= \frac{2\cdot\frac{2x + 1}{x - 2} + 1}{\frac{2x + 1}{x - 2} - 2} \\ &= \frac{5x}{5} = x \end{aligned}$$

A function that is not one-to-one can be given an inverse by restricting its domain: $f(x) = x^2$ on $x \ge 0$ has $f^{-1}(x) = \sqrt{x}$.

## 2.16 · AA HL · Modulus, reciprocal and inequalities

*|f(x)|, f(|x|), 1/f(x), y² = f(x)*

From the graph of $y = f(x)$, here $x^2 - x - 2 = (x + 1)(x - 2)$:

$y = |f(x)|$: reflect the parts below the $x$-axis up into it (the red fold in the figure). $y = f(|x|)$: keep the part for $x \ge 0$ and reflect it in the $y$-axis. $y = \frac{1}{f(x)}$: zeros of $f$ become vertical asymptotes ($x = -1$, $x = 2$), and $f$’s minimum $(\tfrac{1}{2}, -\tfrac{9}{4})$ becomes a local maximum $(\tfrac{1}{2}, -\tfrac{4}{9})$. $y^2 = f(x)$: $y = \pm\sqrt{f(x)}$, only where $f(x) \ge 0$, symmetric in the $x$-axis.

**Inequalities** such as $g(x) \ge f(x)$ are solved by sketching both graphs and finding where one is above the other, after solving $g(x) = f(x)$ for the crossing points. For $|x^2 - x - 2| \ge 2$: $x^2 - x - 2 = 2$ at $x = \frac{1 \pm \sqrt{17}}{2}$, and $x^2 - x - 2 = -2$ at $x = 0, 1$. So

$$\begin{gathered} x \le -1.56 \\ 0 \le x \le 1 \\ x \ge 2.56 \end{gathered}$$

---

Read it with the figures, and practice it graded as you go: https://atlasclass.app/math-aa/ibfunctions/
