What is a function?
Definition
A function is a relationship between two quantities in which to each value of the independent variable ($x$) we associate at most one value of the dependent variable ($y$). We write:
The "at most one" is the key: each $x$ can have a single value of $y$ (or none, if $x$ is not in the domain), but never two.
A car at 100 km/h
A car takes 2 h to make a trip if it travels at 100 km/h. What is the relationship between time (in hours) and speed (in km/h)?
If it travels at twice the speed (200 km/h), it takes half the time (1 h). If it travels at half the speed (50 km/h), it takes twice as long (4 h). It is an inverse proportionality:
| Time $x$ (h) | $1$ | $2$ | $4$ |
|---|---|---|---|
| Speed $y$ (km/h) | 200 | 100 | 50 |
The product $\,x\cdot y = 200\,$ is constant (the total distance). Solving for $y$:
Domain of a function
Definition
The domain of a function $f$ is the set of all values of $x$ for which $f(x)$ makes sense (is defined). In set notation:
Back to the car: $f(x) = \dfrac{200}{x}$
This function makes sense for any $x$ except $x = 0$ (you cannot divide by zero). Moreover, since $x$ represents a time, physically only $x > 0$ makes sense — but mathematically:
Computing domains
Strategy: two questions
1) What type of function is it?
2) When does this function make sense?
Once the type is identified, we apply the corresponding domain condition. The typical cases:
| Type of function | Domain condition |
|---|---|
| Polynomial $P(x)$ | Always — $\operatorname{Dom} = \mathbb{R}$ |
| Rational $\dfrac{P(x)}{Q(x)}$ | $Q(x) \neq 0$ |
| Even root $\sqrt[2k]{P(x)}$ | $P(x) \geq 0$ |
| Logarithm $\log_a P(x)$ | $P(x) > 0$ (strict) |
| Exponential $a^{P(x)}$ | Always — $\operatorname{Dom} = \mathbb{R}$ |
Example 1 — Logarithm of a polynomial
$f(x) = \log(3x - 1)$
It is the logarithm of a polynomial. The argument must be strictly positive:
Example 2 — Rational function
$f(x) = \dfrac{3x}{x^{2} - 4}$
It is a rational function. The denominator must be different from zero:
These two values are removed from the domain.
Example 3 — Root of a quotient of polynomials
$f(x) = \sqrt{\dfrac{x-3}{x^{2}-4}}$
There is a single root and a quotient inside it. The condition is radicand $\geq 0$ and, in addition, denominator $\neq 0$:
Sign method. We find the zeros of the numerator and the denominator to get the change points:
Numerator $x - 3 = 0 \Rightarrow x = 3$. Denominator $x^{2} - 4 = 0 \Rightarrow x = \pm 2$ (holes!).
These three points split the line into four intervals; we analyse the sign in each one:
| Interval | $x-3$ | $x^{2}-4$ | $\dfrac{x-3}{x^{2}-4}$ |
|---|---|---|---|
| $(-\infty,\,-2)$ | − | + | − |
| $(-2,\,2)$ | − | − | + |
| $(2,\,3)$ | − | + | − |
| $(3,\,+\infty)$ | + | + | + |
We want $\geq 0$ → we keep the rows marked +: $(-2, 2)$ and $(3, +\infty)$. Moreover, $x = 3$ is also included because the quotient equals $0$ there and $0 \geq 0$ ✓. On the other hand, $x = \pm 2$ are not included (denominator zero).
Example 4 — Quotient of two roots
$g(x) = \dfrac{\sqrt{x-3}}{\sqrt{x^{2}-4}}$
Here the expression "looks the same" as in the previous example, but now there are two separate roots: one in the numerator and one in the denominator. Each root must have its own domain, and in addition the one in the denominator cannot be $0$ (because then the quotient would be undefined).
Condition 1 — the numerator root: $\;x - 3 \geq 0 \Rightarrow x \in [3, +\infty)$.
Condition 2 — the denominator root, with a strict inequality: $\;x^{2} - 4 > 0 \Rightarrow x \in (-\infty, -2) \cup (2, +\infty)$.
The domain is the intersection of both sets:
(Because $[3, +\infty)$ is already entirely inside $(2, +\infty)$.)
Watch out: $\sqrt{A/B}$ is not the same as $\sqrt{A}/\sqrt{B}$ for the domain
Let's compare examples 3 and 4:
· $\;f(x) = \sqrt{\dfrac{x-3}{x^{2}-4}}\;\Rightarrow\;\operatorname{Dom} f = (-2, 2) \cup [3, +\infty)$.
· $\;g(x) = \dfrac{\sqrt{x-3}}{\sqrt{x^{2}-4}}\;\Rightarrow\;\operatorname{Dom} g = [3, +\infty)$.
The identity $\sqrt{A/B} = \sqrt{A}/\sqrt{B}$ is only valid when both sides are defined. In $f(x)$, the interval $(-2, 2)$ is still valid because the quotient $\frac{x-3}{x^{2}-4}$ is positive there (a negative divided by a negative): we can take its root. But in $g(x)$ we can't even get there: $\sqrt{x-3}$ already requires $x \geq 3$ on its own.
Example 5 — Exponential of a polynomial
$f(x) = 3^{5x+1}$
The exponential is defined for any real exponent; the expression $5x + 1$ is a polynomial and has no domain restriction. Therefore:
Exercises
Compute the domain of the following 21 functions. They are ordered from the simplest (polynomial, log, rational, root) to the most complex (quotients with roots, roots of quotients and three piecewise-defined functions). Each part has its solution hidden — try it first and then unfold it.
$f_{1}(x) = -3x^{2} + 12$
Show solution
It is a polynomial: it is defined for all $x \in \mathbb{R}$.
$f_{2}(x) = \ln(3x+1)$
Show solution
Logarithm of a polynomial. We need $\,3x+1 > 0$:
$3x > -1 \;\Longrightarrow\; x > -\tfrac{1}{3}$.
$f_{3}(x) = \dfrac{5}{x}$
Show solution
Rational function: we need denominator $\neq 0$, that is $x \neq 0$.
$f_{4}(x) = \sqrt{3x+2}$
Show solution
Even root: we need $\,3x+2 \geq 0$:
$3x \geq -2 \;\Longrightarrow\; x \geq -\tfrac{2}{3}$.
$f_{5}(x) = \sqrt[5]{2x+1}$
Show solution
Root of odd order (5): it has no restriction on the radicand. It is defined for all $x \in \mathbb{R}$.
$f_{6}(x) = \dfrac{(x-1)(x-2)}{x+1}$
Show solution
Rational: we need denominator $\neq 0$, that is $x+1 \neq 0$ → $x \neq -1$.
$f_{7}(x) = \dfrac{(x-1)(x-2)}{x-1}$
Show solution
Rational: we need $x - 1 \neq 0$ → $x \neq 1$.
Although algebraically $\dfrac{(x-1)(x-2)}{x-1} = x-2$ for $x \neq 1$, the original expression is not defined at $x = 1$ (a "hole" or removable discontinuity).
$f_{8}(x) = \dfrac{\sqrt{x+3}}{x+1}$
Show solution
We need: the numerator root defined ($x+3 \geq 0$) and denominator $\neq 0$ ($x+1 \neq 0$):
$x \geq -3 \;\;$ and $\;\; x \neq -1$.
$f_{9}(x) = \dfrac{x+4}{\sqrt{2x+6}}$
Show solution
The root is in the denominator: we need $2x+6 > 0$ (strict, because the denominator cannot be zero):
$2x > -6 \;\Longrightarrow\; x > -3$.
$f_{10}(x) = \dfrac{2}{x^{2}+1}$
Show solution
Denominator $x^{2}+1 \geq 1 > 0$ for all $x$ — it never vanishes.
$f_{11}(x) = \dfrac{2}{x^{2}-1}$
Show solution
We need $x^{2} - 1 \neq 0$, that is $x \neq \pm 1$.
$f_{12}(x) = \dfrac{\sqrt{x+2}}{\sqrt{x-3}}$
Show solution
Each root has its own domain, and the denominator one is strict $> 0$:
Numerator: $x+2 \geq 0 \Rightarrow x \geq -2$.
Denominator: $x-3 > 0 \Rightarrow x > 3$.
Intersection: $x > 3$ (because $(3, +\infty) \subset [-2, +\infty)$).
$f_{13}(x) = \dfrac{\sqrt{x^{2}-16}}{5x+1}$
Show solution
We need: $x^{2}-16 \geq 0$ (root) and $5x+1 \neq 0$ (denominator).
$x^{2} \geq 16 \Rightarrow x \leq -4$ or $x \geq 4$. On the other hand, $x = -\tfrac{1}{5}$ is already inside $(-4, 4)$ — outside the domain of the root — so it adds no new restriction.
$f_{14}(x) = \sqrt{\dfrac{2x+4}{x-3}}$
Show solution
We need $\dfrac{2x+4}{x-3} \geq 0$ and $x-3 \neq 0$. Roots: numerator $x = -2$, denominator $x = 3$ (hole). Sign method:
| Interval | $2x+4$ | $x-3$ | quotient |
|---|---|---|---|
| $(-\infty,\,-2)$ | − | − | + |
| $(-2,\,3)$ | + | − | − |
| $(3,\,+\infty)$ | + | + | + |
$\geq 0$ → $(-\infty, -2] \cup (3, +\infty)$. $x=-2$ included (quotient $= 0$); $x=3$ excluded (denominator $= 0$).
$f_{15}(x) = \sqrt{\dfrac{2x+4}{x^{2}-4}}$
Show solution
We need $\dfrac{2x+4}{x^{2}-4} \geq 0$ and $x^{2}-4 \neq 0$ (that is $x \neq \pm 2$). We factor: $\dfrac{2(x+2)}{(x-2)(x+2)}$.
For $x \neq -2$ we can simplify to $\dfrac{2}{x-2}$. For $x = -2$ the function is not defined (denominator zero, even though the numerator is too).
So, for $x \neq \pm 2$, we need $\dfrac{2}{x-2} \geq 0 \Leftrightarrow x - 2 > 0 \Leftrightarrow x > 2$.
$f_{16}(x) = \sqrt{\,-\dfrac{x-4}{3x-9}\,}$
Show solution
We need $-\dfrac{x-4}{3x-9} \geq 0$, that is $\dfrac{x-4}{3(x-3)} \leq 0$, and $x \neq 3$.
Roots: $x = 4$ (numerator), $x = 3$ (denominator, hole). Signs of $\dfrac{x-4}{x-3}$:
| Interval | $x-4$ | $x-3$ | quotient |
|---|---|---|---|
| $(-\infty,\,3)$ | − | − | + |
| $(3,\,4)$ | − | + | − |
| $(4,\,+\infty)$ | + | + | + |
We want $\leq 0$ → $(3, 4]$. ($x=3$ excluded by the denominator, $x=4$ included because the quotient is $0$ and the root is $\sqrt{0} = 0$.)
$f_{17}(x) = \ln(x^{2}+4)$
Show solution
We need $x^{2}+4 > 0$. But $x^{2} \geq 0$ always, so $x^{2}+4 \geq 4 > 0$ for all $x$.
$f_{18}(x) = \sqrt{x^{2}-4}$
Show solution
We need $x^{2}-4 \geq 0$, that is $x^{2} \geq 4$, that is $|x| \geq 2$.
$f_{19}(x) = \begin{cases} \dfrac{1}{x-4} & x > 5 \\[0.4em] \ln(-3x+20) & x < 5 \end{cases}$
Show solution
We study each branch on its interval:
· For $x > 5$: $x - 4 > 1 > 0$, already $\neq 0$. The whole piece is valid: $(5, +\infty)$.
· For $x < 5$: we need $-3x + 20 > 0 \Rightarrow x < \tfrac{20}{3} \approx 6.67$. Since $x < 5 < \tfrac{20}{3}$, the whole piece is valid: $(-\infty, 5)$.
· At $x = 5$: no branch covers it (both are strict).
$f_{20}(x) = \begin{cases} \sqrt{x+1} & x > 0 \\[0.4em] e^{-x} & x < 0 \end{cases}$
Show solution
· For $x > 0$: $x + 1 > 1 > 0$ — the root is always defined. The whole piece is valid: $(0, +\infty)$.
· For $x < 0$: the exponential $e^{-x}$ is always defined. The whole piece is valid: $(-\infty, 0)$.
· At $x = 0$: no branch covers it.
$f_{21}(x) = \begin{cases} \dfrac{x^{2}-1}{x^{2}-4} & x < -1 \\[0.5em] \sqrt{3x+3} & -1 \leq x < 2 \\[0.4em] \ln(3-x) & 2 \leq x \end{cases}$
Show solution
Three branches:
· For $x < -1$ (1st branch): we need $x^{2}-4 \neq 0 \Rightarrow x \neq \pm 2$. Within $(-\infty, -1)$ this only removes $x = -2$. Valid: $(-\infty, -2) \cup (-2, -1)$.
· For $-1 \leq x < 2$ (2nd branch): we need $3x+3 \geq 0 \Rightarrow x \geq -1$. It holds for the whole interval. Valid: $[-1, 2)$.
· For $2 \leq x$ (3rd branch): we need $3 - x > 0 \Rightarrow x < 3$. Combining with $x \geq 2$: valid $[2, 3)$.
Union: $(-\infty, -2) \cup (-2, -1) \cup [-1, 2) \cup [2, 3) = (-\infty, -2) \cup (-2, 3)$.