Skip to content

2 · Functions

IB Mathematics: Analysis and Approaches SLTopic 2

Video lesson for this topic Open the video page
2:21

Functions

These are selected topics, not the whole syllabus, and every example is fictional. A function comes with its domain; in f g, g acts first; only a one-to-one…

English narration · English + 中文 subtitles burned in

2.1

Scope and prerequisites

This handout teaches topic 2, Functions, of Mathematics: Analysis and Approaches, the course first assessed in 2021: straight lines, the language of functions, composite and inverse functions, quadratic, rational, exponential and logarithmic functions, transformations of graphs, and, for HL, polynomials, odd and even functions and further graphs.

Prerequisites: algebraic manipulation, solving linear and simultaneous equations, indices and surds (topic 1).

2.2

Lines and functions

A taxi fare as a function

A city taxi charges a fixed ¥14 for the first 3 km and ¥2.50 for each extra kilometre. The fare $F$ depends on the distance $d$: for every distance there is exactly one fare. That is what makes it a function 函数. For $d \ge 3$ the rule is a straight line, $F = 14 + 2.5(d-3)$, so a 10 km trip costs $14 + 2.5 \times 7 = 31.5$ yuan. The graph is flat up to 3 km and then rises with gradient 2.5. Much of this topic is about reading a rule like this, drawing its graph and turning questions about the situation into questions about the graph.

Straight lines

The gradient 斜率 of the line through $(x_1, y_1)$ and $(x_2, y_2)$ is

The line y = 2x + 1 through A(1, 3) and B(4, 9) with a gradient triangle of run 3 and rise 6, and the perpendicular line y = -0.5x + 6 through P(2, 5) with run 4 and fall 2; 2 times minus a half is minus 1
Perpendicular gradients multiply to $-1$
$$m = \frac{y_2 - y_1}{x_2 - x_1}$$

A line can be written in three forms:

  • gradient-intercept form $y = mx + c$, where $c$ is the $y$-intercept;
  • general form $ax + by + d = 0$;
  • point-gradient form $y - y_1 = m(x - x_1)$.

Parallel lines have equal gradients. Perpendicular lines have gradients whose product is $-1$, so $m_2 = -\dfrac{1}{m_1}$.

Worked example. Find the line through $A(1, 5)$ perpendicular to $y = 2x - 3$.

  • The given gradient is 2, so the perpendicular gradient is $-\frac{1}{2}$.
  • $y - 5 = -\frac{1}{2}(x - 1)$, so $y = -\frac{1}{2}x + \frac{11}{2}$, or $x + 2y - 11 = 0$.

The language of functions

A function maps each input $x$ in its domain 定义域 to exactly one output $f(x)$. The set of outputs is the range 值域. We write $f(x) = x^2 + 1$ or $f: x \mapsto x^2 + 1$.

A vertical line meets y equals x squared plus 1 once, a function, but meets x equals y squared twice, not a function
The vertical line test
  • A graph shows a function if every vertical line meets it at most once.
  • A formula alone does not define a function: the domain must be stated or understood. $f(x) = \sqrt{x - 2}$ needs $x \ge 2$; $g(x) = \dfrac{1}{x - 3}$ needs $x \ne 3$.
  • The range follows from the domain and the graph: for $f(x) = x^2 + 1$ with $x \in \mathbb{R}$, the range is $f(x) \ge 1$.

On calculator papers, use the graphing calculator to sketch a graph, find intercepts, maximum and minimum points and intersections. Draw a sketch with a labelled scale, and state coordinates to three significant figures unless they are exact.

Vocabulary Train
English
function/ˈfʌŋkʃn/
gradient/ˈɡreɪdɪənt/
domain/dəˈmeɪn/
range/reɪndʒ/
2.3

Composite and inverse functions

Composite functions

A composite function 复合函数 applies one function to the output of another:

Matryoshka dolls nesting inside one another
Nesting represents the order: the inner function acts before the outer function.
$$(f \circ g)(x) = f(g(x))$$

Apply $g$ first, then $f$. In general $f \circ g \ne g \circ f$.

Worked example. $f(x) = 2x + 1$ and $g(x) = x^2$.

  • $(f \circ g)(x) = f(x^2) = 2x^2 + 1$, so $(f \circ g)(3) = 19$.
  • $(g \circ f)(x) = g(2x + 1) = (2x + 1)^2$, so $(g \circ f)(3) = 49$.

The output of $g$ must lie in the domain of $f$: with $f(x) = \sqrt{x}$ and $g(x) = x - 5$, $(f \circ g)(x) = \sqrt{x - 5}$ needs $x \ge 5$.

Inverse functions

The inverse function 反函数 $f^{-1}$ undoes $f$: if $f(a) = b$ then $f^{-1}(b) = a$, and

$$(f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x$$

An inverse exists only if $f$ is one-to-one: each output comes from exactly one input, so every horizontal line meets the graph at most once. A quadratic on all real numbers is many-to-one ($f(1) = f(-1)$ for $x^2$), so its domain must be restricted first. The graph of $y = f^{-1}(x)$ is the reflection of $y = f(x)$ in the line $y = x$, and the domain of $f^{-1}$ is the range of $f$.

To find an inverse: write $y = f(x)$, swap $x$ and $y$, and make $y$ the subject.

Graph of y = √(x − 2) starting at the point (2, 0) and rising slowly to the right
y = √(x − 2) exists only for x ≥ 2, so its domain starts at 2 and its range starts at 0

Worked example. $f(x) = \sqrt{x - 2}$, $x \ge 2$.

  • The range is $f(x) \ge 0$.
  • Swap: $x = \sqrt{y - 2}$, so $x^2 = y - 2$ and $y = x^2 + 2$.
  • $f^{-1}(x) = x^2 + 2$ with domain $x \ge 0$ (the range of $f$). Without the restriction $x \ge 0$, $x^2 + 2$ would not be the inverse.
Vocabulary Train
English
composite function/ˈkɒmpəzɪt ˈfʌŋkʃn/
inverse function/ɪnˈvɜːs ˈfʌŋkʃn/
2.4

Quadratic functions

Three forms

A quadratic function 二次函数 $f(x) = ax^2 + bx + c$ with $a \ne 0$ has a parabola as its graph, opening upwards if $a > 0$ and downwards if $a < 0$. Each form shows one feature directly:

The Golden Gate suspension bridge
A suspension bridge cable hangs in a parabola — the graph of a quadratic.
Form Shows
$y = ax^2 + bx + c$ $y$-intercept $c$; axis of symmetry $x = -\dfrac{b}{2a}$
$y = a(x - p)(x - q)$ $x$-intercepts $p$ and $q$
$y = a(x - h)^2 + k$ vertex 顶点 $(h, k)$; axis $x = h$
Parabola y = 2(x − 1)² − 8 with vertex (1, −8), x-intercepts −1 and 3, y-intercept −6 and axis of symmetry x = 1
One parabola, three forms

Worked example. Write $y = 2x^2 - 4x - 6$ in vertex form and factorised form.

  • Complete the square: $2(x^2 - 2x) - 6 = 2[(x - 1)^2 - 1] - 6 = 2(x - 1)^2 - 8$. Vertex $(1, -8)$.
  • Factorise: $2(x^2 - 2x - 3) = 2(x + 1)(x - 3)$. Roots $x = -1$ and $x = 3$.
  • The range is $y \ge -8$.

The discriminant

The solutions of $ax^2 + bx + c = 0$ are

A number line for k: two distinct roots when k is less than minus 6 or greater than 6, no real roots between
Values of k giving two distinct roots
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

The discriminant 判别式 $\Delta = b^2 - 4ac$ tells you how many real roots there are:

  • $\Delta > 0$: two distinct real roots (the graph crosses the $x$-axis twice);
  • $\Delta = 0$: one repeated real root (the graph touches the axis);
  • $\Delta < 0$: no real roots.

Worked example. For which $k$ does $x^2 + kx + 9 = 0$ have two distinct real roots?

  • $\Delta = k^2 - 36 > 0$, so $k^2 > 36$.
  • $k < -6$ or $k > 6$.

The same idea finds when a line meets a curve: substitute the line into the curve and use the discriminant of the resulting quadratic. A line is a tangent when $\Delta = 0$.

Quadratic inequalities

To solve $x^2 - x - 6 < 0$: factorise $(x - 3)(x + 2) < 0$, sketch the parabola with roots $-2$ and $3$, and read off where it is below the axis: $-2 < x < 3$. Always sketch: dividing both sides by an expression that might be negative reverses the inequality and causes errors.

Vocabulary Train
English
quadratic function/kwɒˈdrætɪk ˈfʌŋkʃn/
vertex/ˈvɜːteks/
discriminant/dɪˈskrɪmɪnənt/
2.5

Rational, exponential and logarithmic functions

Reciprocal and rational functions

The reciprocal function $f(x) = \dfrac{1}{x}$, $x \ne 0$, has the axes as asymptotes. It is self-inverse: $f^{-1}(x) = f(x)$, because its graph is symmetric in $y = x$.

For $c \ne 0$ and $ad-bc \ne 0$, a rational function $f(x) = \dfrac{ax + b}{cx + d}$ has:

  • a vertical asymptote 渐近线 where the denominator is zero, $x = -\dfrac{d}{c}$;
  • a horizontal asymptote $y = \dfrac{a}{c}$, the value approached as $x \to \pm\infty$;
  • an $x$-intercept where the numerator is zero, and, when $d \ne 0$, a $y$-intercept at $\dfrac{b}{d}$.
Graph of y = (2x + 1)/(x − 1) with asymptotes x = 1 and y = 2, x-intercept −1/2 and y-intercept −1
Asymptotes first, then intercepts, then the two branches

Worked example. $f(x) = \dfrac{2x + 1}{x - 1}$. Vertical asymptote $x = 1$; horizontal asymptote $y = 2$; $x$-intercept $-\frac{1}{2}$; $y$-intercept $-1$. The domain is $x \ne 1$ and the range is $y \ne 2$.

Exponential functions

An exponential function 指数函数 $f(x) = a^x$ with $a > 0$, $a \ne 1$, has domain all real numbers, range $f(x) > 0$ and the horizontal asymptote $y = 0$. The most important base is $e \approx 2.718$. In a model $y = Ae^{kt}$, $A$ is the initial value; $k > 0$ gives growth and $k < 0$ gives decay. The quantity changes by the same percentage in each equal time step, so it never becomes negative.

A dense crowd of people
Populations can grow exponentially when resources are plentiful.
A decay curve y = 80e^(−0.2x) falling from 80 at x = 0 to about 16 at x = 8
y = 80e^(−0.2x) loses the same fraction, about 18%, in every unit of x

Logarithms

The logarithm 对数 is the inverse of the exponential:

$$a^x = b \iff x = \log_a b \qquad (a > 0,\ a \ne 1,\ b > 0)$$

$\ln x$ means $\log_e x$, so $y = \ln x$ is the reflection of $y = e^x$ in $y = x$. The laws of logarithms:

$$\log_a(xy) = \log_a x + \log_a y \qquad \log_a\frac{x}{y} = \log_a x - \log_a y \qquad \log_a x^n = n\log_a x$$

and the change of base $\log_a x = \dfrac{\ln x}{\ln a}$. Logarithms need positive arguments, and $\log(x + y)$ is not $\log x + \log y$.

Worked example. A medicine's concentration is $C = 80e^{-0.2t}$ mg/L after $t$ hours. When does it fall to 40 mg/L?

  • $80e^{-0.2t} = 40$, so $e^{-0.2t} = \frac{1}{2}$.
  • $-0.2t = \ln\frac{1}{2} = -\ln 2$, so $t = \dfrac{\ln 2}{0.2} \approx 3.47$ hours. This is the half-life.

Worked example. Solve $3^{x+1} = 5^x$.

  • Take logs: $(x + 1)\ln 3 = x\ln 5$.
  • $x(\ln 5 - \ln 3) = \ln 3$, so $x = \dfrac{\ln 3}{\ln 5 - \ln 3} \approx 2.15$.
Vocabulary Train
English
asymptote/ˈæsɪmptəʊt/
exponential function/ˌekspəˈnenʃl ˈfʌŋkʃn/
logarithm/ˈlɒɡərɪθəm/
2.6

Transformations of graphs

Translations, stretches and reflections

Starting from $y = f(x)$:

New graph Transformation
$y = f(x) + b$ translation by $b$ units up
$y = f(x - a)$ translation by $a$ units right
$y = pf(x)$ vertical stretch, scale factor $p$
$y = f(qx)$ horizontal stretch, scale factor $\dfrac{1}{q}$
$y = -f(x)$ reflection in the $x$-axis
$y = f(-x)$ reflection in the $y$-axis

Changes outside the function act on $y$ in the way you expect. Changes inside the function act on $x$ in the opposite way: $f(x - 2)$ moves the graph 2 to the right, and $f(2x)$ squashes it horizontally by a factor of $\frac{1}{2}$.

Left: y = x² and y = (x − 2)² + 1, a translation by 2 right and 1 up. Right: y = sin x, y = 2 sin x with maximum 2, and y = sin 2x completing two waves in 2π
Outside changes act on y; inside changes act on x in the opposite way

Combining transformations

When several transformations are combined, the order matters. A safe method is to follow a point. To get $y = 3f(x - 1) + 2$ from $y = f(x)$: translate 1 right, stretch vertically by factor 3, then translate 2 up. The point $(4, 5)$ on $y = f(x)$ goes to $(5, 5)$, then $(5, 15)$, then $(5, 17)$.

Worked example. Describe how $y = (x - 2)^2 + 1$ is obtained from $y = x^2$, and find its vertex. A translation by the vector $\binom{2}{1}$; the vertex moves from $(0, 0)$ to $(2, 1)$.

Common mistakes.

  • Reading $f^{-1}(x)$ as $\dfrac{1}{f(x)}$. It is the inverse function, which undoes $f$.
  • Composing in the wrong order: $(f \circ g)(x) = f(g(x))$ applies $g$ first.
  • Moving $y = f(x-3)$ three units left. It moves the graph three units right; $y = f(2x)$ halves horizontal distances.
  • Solving $x^2 < 9$ as $x < \pm 3$. The solution is $-3 < x < 3$.
  • Using $\Delta > 0$ for real roots. Real roots need $\Delta \ge 0$; two distinct real roots need $\Delta > 0$.
  • Forgetting a domain: $\ln(x-2)$ exists only for $x > 2$, so check every root against it.
  • Swapping the asymptotes of $y = \dfrac{ax+b}{cx+d}$: the vertical one is $x = -\dfrac{d}{c}$, the horizontal one $y = \dfrac{a}{c}$.
2.7

Practice

  1. Find the equation of the line through $(2, -1)$ parallel to $3x + y = 7$, in the form $ax + by + d = 0$.
  2. Find the line through $(4, 3)$ perpendicular to the line through $(0, 1)$ and $(2, 5)$.
  3. State the largest possible domain and the corresponding range of $f(x) = \sqrt{6 - 2x}$.
  4. $f(x) = 3x - 2$ and $g(x) = x^2 + 1$. Find $(f \circ g)(x)$, $(g \circ f)(x)$ and $(g \circ f)(-1)$.
  5. Find $f^{-1}(x)$ for $f(x) = \dfrac{x + 4}{3}$ and verify that $(f \circ f^{-1})(x) = x$.
  6. $h(x) = (x - 1)^2$, $x \ge 1$. Find $h^{-1}(x)$ and state its domain. Explain why the restriction $x \ge 1$ is needed.
  7. Write $y = x^2 + 6x + 5$ in vertex form and factorised form, and state the vertex, roots and range.
  8. Find the values of $k$ for which $2x^2 - kx + 8 = 0$ has equal roots.
  9. Find the values of $c$ for which the line $y = 2x + c$ is a tangent to $y = x^2 + 3$.
  10. Solve $2x^2 - 5x - 3 \ge 0$.
  11. For $f(x) = \dfrac{3x - 6}{x + 2}$, state the asymptotes and intercepts, and the range.
  12. Solve $\log_2(x + 3) + \log_2(x - 3) = 4$.
  13. Solve $2^{3x} = 7$, giving $x$ exactly and to 3 significant figures.
  14. A population is $P = 500e^{0.04t}$ after $t$ years. Find when it doubles.
  15. Describe fully the transformations that map $y = f(x)$ onto $y = 2f(x + 3) - 1$, and find the image of the point $(1, 4)$.
  16. The graph of $y = \sin x$ is stretched horizontally by scale factor $\frac{1}{3}$ and then translated 2 units up. Write the new equation.
  17. Explain why $f(x) = x^2$, $x \in \mathbb{R}$, has no inverse, and suggest a domain on which it has one.

Answers.

  1. Gradient $-3$: $y + 1 = -3(x - 2)$, so $3x + y - 5 = 0$.
  2. The given line has gradient $\frac{5 - 1}{2 - 0} = 2$, so the perpendicular gradient is $-\frac{1}{2}$. $y - 3 = -\frac{1}{2}(x - 4)$, so $y = -\frac{1}{2}x + 5$.
  3. Need $6 - 2x \ge 0$, so the domain is $x \le 3$; the range is $f(x) \ge 0$.
  4. $(f \circ g)(x) = 3(x^2 + 1) - 2 = 3x^2 + 1$. $(g \circ f)(x) = (3x - 2)^2 + 1$. $(g \circ f)(-1) = (-5)^2 + 1 = 26$.
  5. $x = \frac{y + 4}{3}$ gives $y = 3x - 4$, so $f^{-1}(x) = 3x - 4$. Check: $f(3x - 4) = \frac{3x - 4 + 4}{3} = x$.
  6. $x = (y - 1)^2$ with $y \ge 1$ gives $y = 1 + \sqrt{x}$, so $h^{-1}(x) = 1 + \sqrt{x}$, domain $x \ge 0$. Without $x \ge 1$, $h$ is many-to-one ($h(0) = h(2) = 1$), so no inverse exists.
  7. $y = (x + 3)^2 - 4 = (x + 1)(x + 5)$. Vertex $(-3, -4)$, roots $-1$ and $-5$, range $y \ge -4$.
  8. $\Delta = k^2 - 64 = 0$, so $k = \pm 8$.
  9. $x^2 + 3 = 2x + c$ gives $x^2 - 2x + 3 - c = 0$. Tangent when $\Delta = 4 - 4(3 - c) = 0$, so $c = 2$.
  10. $(2x + 1)(x - 3) \ge 0$; the parabola is above the axis outside its roots: $x \le -\frac{1}{2}$ or $x \ge 3$.
  11. Vertical asymptote $x = -2$; horizontal asymptote $y = 3$; $x$-intercept $2$; $y$-intercept $-3$. Range $y \ne 3$.
  12. $\log_2[(x + 3)(x - 3)] = 4$, so $x^2 - 9 = 16$ and $x = \pm 5$. Both logs need positive arguments, so $x = 5$ only.
  13. $3x\ln 2 = \ln 7$, so $x = \dfrac{\ln 7}{3\ln 2} \approx 0.936$.
  14. $e^{0.04t} = 2$, so $t = \dfrac{\ln 2}{0.04} \approx 17.3$ years.
  15. Translation 3 units left, vertical stretch scale factor 2, translation 1 unit down. $(1, 4) \to (-2, 4) \to (-2, 8) \to (-2, 7)$.
  16. $y = \sin 3x + 2$.
  17. $x^2$ is many-to-one ($f(2) = f(-2) = 4$), so it fails the horizontal line test. On $x \ge 0$ it is one-to-one, with inverse $\sqrt{x}$.
2.8

Exam tips

  • Always state the domain when you give an inverse function: it is the range of the original function.
  • Apply the inner function first in a composite: $f(g(x))$ means $g$ then $f$.
  • Use the discriminant for “how many roots” and “tangent” questions, and sketch for inequalities.
  • For rational functions, give asymptotes as equations, $x = \dots$ and $y = \dots$, not just numbers.
  • Check log equations for solutions that make an argument zero or negative, and reject them.
  • For transformations, follow one point and say “translation by the vector”, “vertical stretch, scale factor” and “reflection in the $x$-axis” in full.
  • On Paper 1, keep answers exact ($\ln$, surds, fractions); on calculator papers, give three significant figures.
Explore

Domains, inverses and composition

State the domain and range

Compare the model with the worked case and explain one change.

Explore

Exponentials, logarithms and modelling

For y=Ae^(kt), k is a proportional rate

Explain why the half-life depends on 0.2 and not on the initial amount 80.

Was this helpful?

Interactive lessons on this topic

Work through it step by step, with instant-check exercises.

More topics in IB Mathematics: Analysis and Approaches SL

Log in or create account

IGCSE, A-Level & AP