Topic 2: Functions

Cambridge IB 0610 / 0970 · 18 min read
Functions are the language the rest of IB Mathematics is written in. Almost every later topic, from calculus to modelling to complex numbers, assumes you can read function notation fluently, find a domain or range without panic, manipulate composites and inverses, and recognise the shape of a graph from its equation. Topic 2 is where these skills are built. This article works through each idea in the order it tends to appear on exams, keeping the algebra concrete and the graphing visual. SL students should read everything except the clearly marked HL-only material on the factor and remainder theorems, higher-degree polynomials, and the more general rational functions; HL students should treat those marked parts as core. Throughout, the goal is not just to compute but to understand why each rule works, because the questions that earn the top marks reward reasoning over recall.

Function notation, domain and range

A function is a rule that assigns to each input exactly one output. We write $f(x)$ to mean the output of $f$ when the input is $x$, so if $f(x) = 3x - 1$ then $f(4) = 11$ and $f(a+1) = 3(a+1) - 1 = 3a + 2$. Substitution is mechanical: replace every $x$ with whatever sits inside the brackets. The set of allowed inputs is the domain, and the set of resulting outputs is the range. A relation is only a function if no input maps to two outputs; graphically this is the vertical line test, where any vertical line crosses the graph at most once. To find a domain you ask what inputs are forbidden. The two classic restrictions are division by zero and the square root of a negative number, so for $f(x) = \\frac{1}{x-2}$ the domain is all real $x$ with $x \\neq 2$, and for $g(x) = \\sqrt{x-5}$ the domain is $x \\geq 5$. Range is usually found by reasoning about the shape of the graph or by completing the square. For $f(x) = x^2 + 1$ the smallest output is $1$ so the range is $f(x) \\geq 1$. When a problem gives a restricted domain, the range follows from that restriction, so always read the domain first. Interval notation such as $x \\in [0, 4)$ is common, where the square bracket includes the endpoint and the round bracket excludes it.

Composite functions and inverse functions

A composite function applies one function and then feeds the result into another. The notation $(f \\circ g)(x)$ means $f(g(x))$: do $g$ first, then $f$. Order matters, and in general $f(g(x)) \\neq g(f(x))$. If $f(x) = x^2$ and $g(x) = x + 3$ then $(f \\circ g)(x) = (x+3)^2$ while $(g \\circ f)(x) = x^2 + 3$. For the composite to exist, the range of the inner function must lie inside the domain of the outer function. An inverse function $f^{-1}$ reverses $f$, so it undoes whatever $f$ does: $f^{-1}(f(x)) = x$ and $f(f^{-1}(x)) = x$. To find an inverse algebraically, write $y = f(x)$, swap $x$ and $y$, then solve for $y$. For $f(x) = 2x + 5$ this gives $x = 2y + 5$, so $y = \\frac{x-5}{2}$ and $f^{-1}(x) = \\frac{x-5}{2}$. The domain of $f^{-1}$ equals the range of $f$, and its range equals the domain of $f$, a swap that examiners love to test. A function only has an inverse if it is one-to-one, meaning each output comes from exactly one input; graphically this is the horizontal line test. Many-to-one functions like $f(x) = x^2$ need their domain restricted, for instance to $x \\geq 0$, before an inverse exists. The graph of $f^{-1}$ is the reflection of the graph of $f$ in the line $y = x$.

Transformations of graphs

Knowing how to move, stretch and flip a graph lets you sketch complicated functions from simple ones. Starting from $y = f(x)$, the transformations split into outside changes that affect the output and inside changes that affect the input. Outside changes behave as expected: $y = f(x) + k$ shifts the graph up by $k$, and $y = a f(x)$ stretches it vertically by scale factor $a$ (and reflects in the x-axis if $a$ is negative). Inside changes behave in the opposite way to intuition: $y = f(x - h)$ shifts the graph right by $h$, not left, and $y = f(bx)$ stretches it horizontally by scale factor $\\frac{1}{b}$, a compression when $b \\gt 1$. A reflection in the y-axis is $y = f(-x)$, and a reflection in the x-axis is $y = -f(x)$. When several transformations combine, apply horizontal shifts and stretches with care because the order can change the result. A reliable method is to track what happens to a few key points such as intercepts and turning points. The vector $\\begin{pmatrix} h \\\\ k \\end{pmatrix}$ is sometimes used to describe a translation that moves the graph $h$ right and $k$ up. HL students also meet $y = |f(x)|$, which reflects any part of the graph below the x-axis upward, and $y = f(|x|)$, which copies the right-hand part of the graph onto the left.

Quadratic functions and the discriminant

A quadratic has the form $f(x) = ax^2 + bx + c$ with $a \\neq 0$, and its graph is a parabola opening upward when $a \\gt 0$ and downward when $a \\lt 0$. Three forms each reveal something different. The standard form above shows the y-intercept $c$. The factored form $f(x) = a(x - p)(x - q)$ shows the x-intercepts, also called roots or zeros, at $x = p$ and $x = q$. The vertex form $f(x) = a(x - h)^2 + k$ shows the turning point at $(h, k)$, where $h = -\\frac{b}{2a}$ sits on the axis of symmetry $x = -\\frac{b}{2a}$. Completing the square converts standard form into vertex form and is essential for finding ranges. The roots come from the quadratic formula $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$. The expression under the root, $\\Delta = b^2 - 4ac$, is the discriminant and it tells you the number of real roots without solving. If $\\Delta \\gt 0$ there are two distinct real roots, if $\\Delta = 0$ there is one repeated root (the parabola touches the x-axis), and if $\\Delta \\lt 0$ there are no real roots. Discriminant questions often ask for the values of a parameter that make a quadratic have, say, equal roots, which means setting $\\Delta = 0$ and solving.

Polynomials, factor and remainder theorems (HL)

This section is core for HL and extends the quadratic ideas to higher degrees. A polynomial of degree $n$ has the form $a_n x^n + \\dots + a_1 x + a_0$, and its graph can have up to $n$ x-intercepts and up to $n-1$ turning points. To divide one polynomial by another you can use polynomial long division, which produces a quotient and a remainder just like dividing integers. The remainder theorem states that the remainder when a polynomial $P(x)$ is divided by $(x - a)$ is simply $P(a)$, so you can find a remainder by substitution alone. The factor theorem is the special case where the remainder is zero: $(x - a)$ is a factor of $P(x)$ if and only if $P(a) = 0$. This is the standard tool for factorising cubics, where you test small values such as $x = 1$ or $x = -1$ to find one root, divide out that factor, and then factor the remaining quadratic. The relationships between roots and coefficients (sometimes called Vieta's relations) connect the sum and product of the roots to the coefficients; for a quadratic the sum of roots is $-\\frac{b}{a}$ and the product is $\\frac{c}{a}$. When sketching polynomials, the sign of the leading term controls the end behaviour, and a repeated factor such as $(x-2)^2$ means the graph touches the axis there rather than crossing it.

Rational functions and asymptotes

A rational function is a ratio of two polynomials, $\\frac{P(x)}{Q(x)}$. The simplest case in the SL course is the reciprocal-type function such as $f(x) = \\frac{ax + b}{cx + d}$, whose graph is a hyperbola. Asymptotes are lines the curve approaches but never reaches. A vertical asymptote occurs where the denominator is zero and the numerator is not, because the output grows without bound there; for $f(x) = \\frac{1}{x - 3}$ the vertical asymptote is $x = 3$. The horizontal asymptote describes the behaviour as $x$ becomes very large; for $\\frac{ax+b}{cx+d}$ it is $y = \\frac{a}{c}$, found by comparing the leading terms. To locate intercepts, set $x = 0$ for the y-intercept and set the numerator to zero for the x-intercepts. HL extends this to rational functions where the numerator and denominator can be quadratic, such as $\\frac{x^2 + 1}{x - 2}$. When the degree of the numerator is exactly one more than the denominator, the graph has an oblique (slant) asymptote found by polynomial division, and the linear part of the quotient gives the equation of that line. Sketching any rational function follows the same checklist: find the domain, the vertical asymptotes, the horizontal or oblique asymptote, and the intercepts, then join the pieces respecting those boundaries.

Exponential and logarithmic functions

An exponential function has the variable in the exponent, $f(x) = a^x$ with $a \\gt 0$, and the special base $e \\approx 2.718$ gives the natural exponential $f(x) = e^x$. Exponential graphs pass through $(0, 1)$, rise steeply when the base exceeds one, and have the x-axis $y = 0$ as a horizontal asymptote. They model growth and decay, often written $f(x) = a \\cdot b^x + c$ where $c$ shifts the asymptote to $y = c$. The logarithm is the inverse of the exponential: $\\log_a x$ answers the question 'to what power must $a$ be raised to give $x$', so $\\log_a x = y$ means $a^y = x$. The natural logarithm $\\ln x$ is the inverse of $e^x$, and because they are inverses their graphs reflect in $y = x$, with the log graph having a vertical asymptote at $x = 0$ and domain $x \\gt 0$. The laws of logarithms are essential: $\\log(xy) = \\log x + \\log y$, $\\log\\left(\\frac{x}{y}\\right) = \\log x - \\log y$, and $\\log(x^n) = n \\log x$. The change of base rule $\\log_a x = \\frac{\\ln x}{\\ln a}$ lets you evaluate any logarithm on a calculator. To solve an equation like $5^x = 20$, take logs of both sides to get $x = \\frac{\\ln 20}{\\ln 5}$. These functions reappear constantly in modelling and calculus, so fluency here pays off later.

Putting it together: graphing strategy

Most graphing questions reward a systematic approach rather than guessing. Whatever the function, work through a consistent checklist. First state the domain, noting any forbidden inputs from denominators or square roots. Second find the intercepts: the y-intercept by setting $x = 0$ and the x-intercepts by setting $f(x) = 0$. Third identify asymptotes for rational, exponential and logarithmic functions, since these control the overall shape. Fourth locate key features such as the vertex of a parabola, the turning points of a polynomial, or the points where a transformed graph maps known features. Fifth consider the end behaviour, what happens as $x$ grows large in both directions. On the calculator paper, use the graphing display to confirm your algebra and to read off intersections, maxima and minima, but always show the analytic working that the question asks for. When sketching by hand, label every intercept and asymptote with its coordinate or equation, because unlabelled features earn no marks. Finally, sanity-check your sketch against the function: a positive leading coefficient should give an upward parabola, an exponential should never cross its asymptote, and an inverse should be the mirror image of the original in $y = x$.

Key terms

Domain
The complete set of permitted input values for a function.
Range
The complete set of output values a function actually produces.
Composite function
A function formed by applying one function to the result of another, written $(f \\circ g)(x) = f(g(x))$.
Inverse function
The function $f^{-1}$ that reverses $f$, satisfying $f^{-1}(f(x)) = x$; its graph reflects $f$ in $y = x$.
One-to-one
A function where each output comes from exactly one input, a requirement for an inverse to exist.
Discriminant
The quantity $\\Delta = b^2 - 4ac$ that determines how many real roots a quadratic has.
Vertex form
The quadratic form $a(x - h)^2 + k$ revealing the turning point $(h, k)$.
Factor theorem
$(x - a)$ is a factor of $P(x)$ if and only if $P(a) = 0$ (HL).
Remainder theorem
The remainder when $P(x)$ is divided by $(x - a)$ equals $P(a)$ (HL).
Asymptote
A line that a curve approaches arbitrarily closely but never meets.
Logarithm
The inverse of exponentiation: $\\log_a x = y$ means $a^y = x$, defined for $x \\gt 0$.
Transformation
An operation that shifts, stretches or reflects a graph, such as $f(x - h) + k$.

Exam technique

Quick check
Given $f(x) = x + 2$ and $g(x) = x^2$, what is $(f \\circ g)(3)$?
  1. 11
  2. 25
  3. 9
  4. 6
Show answer
Answer: 11. Apply $g$ first: $g(3) = 3^2 = 9$. Then apply $f$: $f(9) = 9 + 2 = 11$. The order matters, since $(g \\circ f)(3)$ would instead give $(3+2)^2 = 25$.

Test yourself

Practise exam-style questions on this topic.

Go to the quiz →
All study notes