Part IV — Miscellaneous · Chapter 12
Functions
A function is a rule with a domain: give it an input from its domain and it returns exactly one output. That is the whole definition, and getting it exactly right is worth more than any amount of practice at "finding $f(3)$".
A patch of water lilies doubles in area every day. After $48$ days it covers the whole lake. On which day did it cover half the lake?
- Day $24$
- Day $36$
- Day $47$
Halving the answer feels natural. Check whether it survives one more day of doubling.
You should be comfortable with powers and roots (Chapter 3), with parabolas (Chapter 4), and with lines in coordinates (Chapter 10). Those are the graphs this chapter generalizes.
Three quick ones from earlier chapters, to wake up what this chapter stands on. They are not scored. If one doesn't come to you, its solution says where to look.
Compute $2^{-3}$.
Answer: $\tfrac18$
$2^{-3} = \dfrac{1}{2^3} = \dfrac18$ — §3.5. The exponential function in §12.4 takes this definition and extends it to every real exponent.
Compute $8^{2/3}$.
Answer: $4$
The cube root of $8$ is $2$, and $2^2 = 4$ — §3.5 again.
At which $x$ is the vertex of the parabola $y = x^2 - 4x + 1$?
Answer: $x = 2$
$-\dfrac{b}{2a} = \dfrac{4}{2} = 2$; completed square, $y = (x-2)^2 - 3$ — §4.5. In §12.3 that is the graph of $x^2$ shifted $2$ right and $3$ down.
12.1 Definition of a function
A function $f$ consists of a set $D$, its domain, together with a rule assigning to each $x \in D$ exactly one number $f(x)$, its value at $x$. The set of values that actually occur is the image (or range).
Two clauses carry all the weight. Each $x$ in the domain must get a value — no gaps. And exactly one value — no ambiguity. A rule like "$y$ such that $y^2 = x$" is not a function, because $x = 4$ gives both $2$ and $-2$; restricting to the positive root repairs it, and that is what the symbol $\sqrt{\;}$ means.
$f(x) = x^2$ on all real numbers and $g(x) = x^2$ on $x \ge 0$ are different functions, even though the formula is identical. The first takes every value twice; the second takes each once, and only the second can be undone. When a domain is not stated, the convention is to take the largest set on which the formula makes sense — which for $1/(x-2)$ excludes $2$, and for $\sqrt{x-3}$ means $x \ge 3$.
Example 1. Finding a natural domain
What is the natural domain of $f(x) = \dfrac{\sqrt{x+4}}{x-1}$?
- The square root needs $x + 4 \ge 0$, that is, $x \ge -4$.
- The denominator must not vanish: $x \neq 1$.
- Both conditions at once: $x \ge -4$ and $x \neq 1$.
- So the domain is $[-4, 1) \cup (1, \infty)$. $\blacksquare$
Two rules cover almost every case at this level: no negative under an even root, no zero in a denominator.
What is the smallest number in the natural domain of $f(x) = \sqrt{x - 2}$?
Answer: $2$
The square root needs $x - 2 \ge 0$, that is $x \ge 2$. So the domain is $[2, \infty)$, and its smallest element is $2$ — where $f(2) = 0$.
Which of these rules give $y$ as a function of $x$? Choose every one.
- $y = x^2$
- $x = y^2$
- $y = \dfrac1x$ for $x \neq 0$
- $x^2 + y^2 = 1$
Answer: $y = x^2$ and $y = 1/x$
In the other two, a single $x$ can go with two values of $y$: $x = 4$ allows $y = 2$ and $y = -2$, and $x = 0$ on the circle allows $y = 1$ and $y = -1$.
12.2 Polynomial functions
A polynomial is a function built from $x$ by adding and multiplying only:
with $a_n \neq 0$. The number $n$ is the degree. Degree $1$ is the linear functions of Chapter 10, degree $2$ the quadratics of Chapter 4. The domain is always all of $\mathbf{R}$: there is nothing to divide by and nothing to take a root of.
Polynomials can be divided by one another much as whole numbers can, leaving a quotient and a remainder. Dividing by $x - r$ is the only case we need, and it goes by peeling off one power at a time.
Worked division. Dividing by $x - 2$
Divide $f(x) = x^3 - 4x^2 + x + 6$ by $x - 2$.
- Match the leading term. $x^2(x-2) = x^3 - 2x^2$ has the right $x^3$; subtracting it from $f(x)$ leaves $-2x^2 + x + 6$.
- Match the new leading term. $-2x(x-2) = -2x^2 + 4x$; subtracting leaves $-3x + 6$.
- Once more. $-3(x-2) = -3x + 6$; subtracting leaves $0$.
- Collect what was peeled off: $$f(x) = (x-2)(x^2 - 2x - 3) + 0.$$ The quotient is $x^2 - 2x - 3$ and the remainder is $0$.
- Check by expanding: $(x-2)(x^2-2x-3) = x^3 - 2x^2 - 3x - 2x^2 + 4x + 6 = x^3 - 4x^2 + x + 6$ ✓. $\blacksquare$
Each step lowers the degree by one, so the process must stop, and what is left at the end is a plain number. Divide the same $f$ by $x - 1$ and you are left with $4$: $f(x) = (x-1)(x^2 - 3x - 2) + 4$. Notice that $f(1) = 1 - 4 + 1 + 6 = 4$ as well — no coincidence, as the next result explains.
A number $r$ with $f(r) = 0$ is a root. Roots and factors are two views of one thing:
$r$ is a root of $f$ if and only if $(x - r)$ divides $f(x)$ — that is, $f(x) = (x-r)\,q(x)$ for some polynomial $q$ of degree one less.
Let $f(x) = x^3 - 2x^2 - 5x + 6$. Is $x - 1$ a factor of $f(x)$?
- Yes.
- No.
Answer: yes
$f(1) = 1 - 2 - 5 + 6 = 0$, so $1$ is a root, and by the factor theorem $(x - 1)$ divides $f(x)$. No division was needed to find that out.
Your turn, with help. From one root to all of them
Find every root of $f(x) = x^3 - 2x^2 - 5x + 6$, given that $f(1) = 0$. Try each step before opening it.
- Since $1$ is a root, $(x - 1)$ is a factor. Divide it out.
-
Carry out the division
$x^2(x-1) = x^3 - x^2$ leaves $-x^2 - 5x + 6$; then $-x(x-1) = -x^2 + x$ leaves $-6x + 6$; then $-6(x-1)$ leaves $0$. So $f(x) = (x-1)(x^2 - x - 6)$.
-
Factor the quadratic
Two numbers with product $-6$ and sum $-1$: $-3$ and $2$. So $x^2 - x - 6 = (x-3)(x+2)$.
-
List the roots
$f(x) = (x-1)(x-3)(x+2)$, so the roots are $1$, $3$ and $-2$ — three of them, the most a cubic can have. $\blacksquare$
Each root found lowers the degree of what is left to solve. That is the practical use of the factor theorem.
One direction is immediate: if $f(x) = (x-r)q(x)$ then $f(r) = 0 \cdot q(r) = 0$. The other direction is division with remainder, as just carried out: dividing $f(x)$ by $(x-r)$ leaves a constant remainder $c$, so $f(x) = (x-r)q(x) + c$; putting $x = r$ gives $c = f(r) = 0$. $\blacksquare$
A consequence worth stating: a polynomial of degree $n$ has at most $n$ roots, since each root pulls out a factor and the degree cannot drop below zero. A cubic has at most three — one, two, or three, depending on whether a root repeats — but never four.
12.3 Graphs of functions
The graph of $f$ is the set of points $(x, f(x))$ for $x$ in the domain. Since each $x$ gets exactly one value, we get a test that can be applied by eye:
A set of points in the plane is the graph of a function exactly when no vertical line meets it more than once.
A circle fails this test — most vertical lines cut it twice — which is why $x^2+y^2=1$ defines a curve but not a function of $x$. Splitting it into upper and lower halves gives two functions, $y = \pm\sqrt{1-x^2}$.
Once you know one graph, you know a whole family of them. Replacing $f(x)$ by $af(x-h)+k$ moves and stretches the curve without changing its shape.
- $f(x) + k$: shift up by $k$.
- $f(x - h)$: shift right by $h$. Note the sign — subtracting inside moves right.
- $a\,f(x)$: stretch vertically by $|a|$, flipping over the $x$-axis if $a < 0$.
- $f(-x)$: reflect across the $y$-axis.
Where is the vertex of the parabola $y = (x + 1)^2 - 4$?
Answer: $(-1, -4)$
This is $y = x^2$ shifted by $h = -1$ (one to the left) and $k = -4$ (four down), so the vertex moves from $(0,0)$ to $(-1,-4)$. Check: at $x = -1$ the square is $0$ and $y = -4$.
The new graph at $x$ shows what the old graph had at $x - h$. To see the old value at $0$ you now have to look at $x = h$. So everything the old curve did has been postponed by $h$ — moved to the right. Argue it this way once and you will never have to guess the direction again.
Wrong turn. Reading the shift off the sign
Where is the vertex of $y = (x - 3)^2$?
- The tempting move. There is a $-3$ in the formula, so the graph has moved $3$ in the negative direction: the vertex is at $x = -3$.
- The check. The vertex of a square is where it equals $0$. At $x = -3$: $(-3 - 3)^2 = 36$, nowhere near $0$. At $x = 3$: $(3-3)^2 = 0$ ✓.
- Why. The $-3$ is applied to the input, before the function sees it. To feed the function the value $0$ you must now supply $x = 3$. Everything the old graph did at $0$ happens at $3$ instead — it has moved right.
- The repair. The vertex is at $(3, 0)$. $\blacksquare$
Changes outside the function ($+k$, $\times a$) do what they look like. Changes inside ($x - h$) do the opposite of what they look like. When in doubt, ask where the expression in parentheses is zero.
12.4 The exponential function
Chapter 3 defined $a^x$ for integer and then fractional $x$: $a^n$ is repeated multiplication, $a^{-n} = 1/a^n$, and $a^{p/q} = \sqrt[q]{a^p}$. That covers every rational exponent. The remaining step is to define $a^x$ for irrational $x$ — for instance $2^{\sqrt2}$.
The idea is to squeeze. Rational numbers come arbitrarily close to $\sqrt2$ from both sides ($1.4$, $1.41$, $1.414$, …), the corresponding powers $2^{1.4}, 2^{1.41}, \dots$ close in on a single number, and that number is defined to be $2^{\sqrt2}$. The same argument as for the area of a circle: approximate with things you understand, and take the limit.
For a fixed $a > 0$, the function $f(x) = a^x$ is defined for every real $x$ and satisfies $$a^{x+y} = a^x a^y, \qquad (a^x)^y = a^{xy}, \qquad a^0 = 1.$$ It is positive everywhere, increasing if $a > 1$ and decreasing if $a < 1$, and never takes the value $0$.
Exponential growth means the ratio over a fixed step is constant: each unit of $x$ multiplies the value by $a$. That is different in kind from $x^2$ or $x^{10}$, where the ratio depends on where you are. Given enough room, $2^x$ overtakes $x^{10}$ and never looks back — the contest is not close, though it takes until $x \approx 59$ for it to be visible.
A quantity starts at $2$ and triples every hour. How large is it after $4$ hours?
Answer: $162$
$2 \cdot 3^4 = 2 \cdot 81 = 162$. In general the value after $x$ hours is $2 \cdot 3^x$: constant ratio per step, which is what makes it exponential.
12.5 Logarithms
Since $a^x$ (for $a > 1$) is increasing, it takes each positive value exactly once. So it can be undone, and the undoing has a name.
Three questions about powers of $2$. What $x$ makes $2^x = 8$? What $x$ makes $2^x = \tfrac12$? And $2^x = 10$ — between which two whole numbers must that $x$ lie?Answer all three, then open
$3$, then $-1$, and between $3$ and $4$ (since $2^3 = 8 < 10 < 16 = 2^4$). You have just computed three logarithms to base $2$. The logarithm is nothing more than a name for the answer to "what exponent?".
For $a > 0$, $a \neq 1$, and $y > 0$, the logarithm $\log_a y$ is the unique number $x$ with $a^x = y$. In words: the exponent you need.
Its domain is the positive numbers — negative numbers and zero have no logarithm, because $a^x$ is never zero or negative.
Each law of exponents becomes a law of logarithms, by reading it backwards.
$$\log_a(uv) = \log_a u + \log_a v, \qquad \log_a\!\left(\frac uv\right) = \log_a u - \log_a v, \qquad \log_a(u^k) = k\log_a u.$$
Proof of the first. Let $x = \log_a u$ and $y = \log_a v$, so $a^x = u$ and $a^y = v$. Then $uv = a^x a^y = a^{x+y}$, and by the definition of the logarithm, $\log_a(uv) = x + y$. $\blacksquare$
This is the property that made logarithms historically indispensable: they convert multiplication into addition, which is far easier to do by hand. The slide rule was a physical realization of exactly this identity.
The laws in use. Three quick computations
Compute (a) $\log_2 12 + \log_2 \tfrac23$, (b) $\log_{10} 5 + \log_{10} 20$, (c) $\log_3\!\left(9^5\right)$.
- (a) A sum of logs is the log of the product: $\log_2\!\left(12 \cdot \tfrac23\right) = \log_2 8 = 3$.
- (b) Likewise $\log_{10}(5 \cdot 20) = \log_{10} 100 = 2$. Neither $\log_{10} 5$ nor $\log_{10} 20$ is a whole number; their sum is.
- (c) An exponent comes out in front: $\log_3\!\left(9^5\right) = 5\log_3 9 = 5 \cdot 2 = 10$. $\blacksquare$
In each case the law was used to reach a number whose logarithm is recognizable. That is the usual tactic: combine first, evaluate last.
Wrong turn. The logarithm of a sum
Compute $\log_2(4 + 4)$.
- The tempting move. Split the log across the sum: $\log_2 4 + \log_2 4 = 2 + 2 = 4$.
- The check. Do the parentheses first: $4 + 4 = 8$, and $\log_2 8 = 3$, because $2^3 = 8$. Two routes, $4$ against $3$.
- Why. The law is $\log(uv) = \log u + \log v$ — a product on the left. So $\log_2 4 + \log_2 4$ is $\log_2(4 \cdot 4) = \log_2 16 = 4$, the logarithm of something else entirely. There is no law for the logarithm of a sum.
- The repair. $\log_2(4+4) = \log_2 8 = 3$. $\blacksquare$
Logarithms turn products into sums; they do nothing useful to sums. The same shape of mistake as $\sqrt{a+b}$ and $(a+b)^2$, and caught the same way — with numbers.
Compute $\log_{10} 2 + \log_{10} 50$.
Answer: $2$
$\log_{10} 2 + \log_{10} 50 = \log_{10}(2 \cdot 50) = \log_{10} 100 = 2$.
Example 2. Solving for an exponent
Solve $3 \cdot 2^{x} = 96$.
- Divide by $3$: $2^x = 32$.
- Recognize $32 = 2^5$, so $x = 5$. When the numbers cooperate, no logarithm is needed.
- If they had not cooperated — say $2^x = 30$ — take logs of both sides: $x\log 2 = \log 30$, so $x = \log 30/\log 2 \approx 4.907$.
- Check: $2^5 = 32$ and $3 \times 32 = 96$ ✓. $\blacksquare$
Solve $4 \cdot 3^{x} = 108$.
Answer: $x = 3$
Divide by $4$: $3^x = 27 = 3^3$, so $x = 3$. Check: $4 \cdot 27 = 108$ ✓.
Example 3. Changing base
Express $\log_2 7$ using logarithms to base $10$.
- Let $x = \log_2 7$, so $2^x = 7$.
- Take $\log_{10}$ of both sides: $\log_{10}(2^x) = \log_{10} 7$.
- By the third law, $x\log_{10}2 = \log_{10}7$.
- So $x = \dfrac{\log_{10}7}{\log_{10}2} \approx \dfrac{0.845}{0.301} \approx 2.807$.
- Plausible: $2^2 = 4$ and $2^3 = 8$, so the answer must lie between $2$ and $3$, nearer $3$. $\blacksquare$
In general $\log_a y = \dfrac{\log_b y}{\log_b a}$ — which is why a calculator with only two logarithm buttons can compute every base.
$\log_2 32 = {}$ and $\log_{10} 0.01 = {}$ .
Answer: $5$ and $-2$
$2^5 = 32$, and $10^{-2} = \frac{1}{100} = 0.01$.
Practice
Give exact answers where possible; otherwise three decimal places.
If $f(x) = x^2 - 2x - 2$, what is $f(-3)$?
Answer: $13$
$f(-3) = (-3)^2 - 2(-3) - 2 = 9 + 6 - 2 = 13$. Both minus signs matter: $(-3)^2$ is $+9$, and $-2(-3)$ is $+6$.
What is the natural domain of $f(x) = \dfrac{1}{x - 5}$?
- All real numbers.
- $x > 5$.
- All real numbers except $5$.
- $x \ge 5$.
Answer: all real numbers except $5$
Only $x = 5$ causes trouble, making the denominator zero. Every other real number is fine, including numbers far below $5$ — the function is negative there, which is not a problem.
Which of these is not the graph of a function of $x$?
- The line $y = 3x - 1$.
- The circle $x^2 + y^2 = 4$.
- The parabola $y = x^2$.
- The curve $y = |x|$.
Answer: the circle
A vertical line such as $x = 0$ meets the circle at $(0,2)$ and $(0,-2)$ — two outputs for one input, so it is not a function. The other three pass the test everywhere.
The circle can be split into two functions, $y = \sqrt{4-x^2}$ and $y = -\sqrt{4-x^2}$, each perfectly respectable.
What is $\log_2 8$?
Answer: $3$
The logarithm asks for the exponent: $2^3 = 8$, so $\log_2 8 = 3$. Reading a logarithm as a question — "what power?" — makes most of them answerable on sight.
What is $\log_3\!\left(\tfrac19\right)$?
Answer: $-2$
$3^{-2} = \dfrac{1}{3^2} = \dfrac19$, so the exponent required is $-2$.
Logarithms of numbers between $0$ and $1$ are negative (for base $> 1$), and the logarithm of $0$ or of a negative number does not exist at all.
Solve $5 \cdot 2^{x} = 80$.
Answer: $x = 4$
Divide by $5$: $2^x = 16 = 2^4$, so $x = 4$. Since $2^x$ takes each positive value exactly once, that is the only solution.
How does the graph of $y = (x-3)^2$ compare with that of $y = x^2$?
- Shifted $3$ to the left.
- Shifted $3$ to the right.
- Shifted $3$ down.
- Stretched vertically by $3$.
Answer: shifted $3$ to the right
The new graph at $x$ shows what the old one had at $x - 3$, so the vertex, formerly at $x=0$, is now at $x=3$. Check directly: $y = 0$ when $x = 3$.
What is $7^{0}$?
Answer: $1$
The law $a^{x+y} = a^xa^y$ with $y = 0$ gives $a^x = a^x \cdot a^0$, and dividing by the nonzero $a^x$ leaves $a^0 = 1$. So it is forced, not chosen: any other value would break the law of exponents.
How many real roots does $f(x) = x^3 + x + 1$ have? (It has at least one, since it is negative at $x=-1$ and positive at $x=0$.)
Answer: $1$
Degree $3$ allows at most three. But each of $x^3$ and $x$ increases as $x$ does, so $f$ is increasing everywhere — it can cross zero only once.
The parenthetical remark supplies the existence: $f(-1) = -1$ and $f(0) = 1$, so the graph must cross the axis between them. Exactly one root.
Compute $\log_2 7$ to three decimal places. ($\log_{10}7 \approx 0.8451$, $\log_{10}2 \approx 0.3010$.)
Answer: $\approx 2.807$
By the change of base formula, $$\log_2 7 = \frac{\log_{10}7}{\log_{10}2} \approx \frac{0.8451}{0.3010} \approx 2.807.$$
The check that matters: $2^2 = 4 < 7 < 8 = 2^3$, so the answer had to be between $2$ and $3$.
Recap
Day $47$. One more doubling takes half the lake to the whole lake. On day $24$ the patch covered $1/2^{24}$ of the lake — about one sixteen-millionth. That is what exponential growth means: a constant ratio per step, so that almost everything happens at the end. The logarithm asks the question backwards: how many doublings does it take?
- A function is a domain plus a rule giving exactly one value to each element of it — and the domain is part of the function, not an afterthought.
- The vertical line test is that definition, applied by eye.
- For polynomials, $r$ is a root exactly when $(x-r)$ is a factor; degree $n$ allows at most $n$ roots.
- $af(x-h)+k$ stretches by $a$, shifts right by $h$, and up by $k$ — with $x - h$ moving the graph the opposite way from the sign.
- $a^x$ extends to all real $x$ by squeezing with rationals; it is positive everywhere and never zero.
- $\log_a$ inverts it, turning products into sums, and $\log_a y = \log_b y / \log_b a$ changes base.