f, f(x) and x ↦ x²: three ways to name a function
Chapter 1 told how Euler, in 1734, invented $f(x)$ and how the function became a sentence with a hole in it (Euler and functions). This text looks at the ways of naming a function, and at the confusions each one brings.
The function and its value
Compare two sentences:
- “the function $f$ is increasing”;
- “$f(x)$ is positive for $x>0$”.
In the first, $f$ is the whole function, the rule, the object that can be differentiated, composed, drawn. In the second, $f(x)$ is a number: the value the function gives when the input is $x$. The difference is the same as between “the calculator” and “the number on its display”.
In practice everybody writes “the function $f(x)=x^2$”, and there is hardly ever a problem. But there are cases where the distinction matters. The derivative of the function $f$ is another function, $f'$, and $f'(3)=2\cdot3=6$. Whoever first computes $f(3)=9$ and then “differentiates the $9$” gets $0$, because the derivative of a constant is zero. The error lies in the order: what was differentiated was a number, the value $f(3)$, and not the function $f$.
Three ways of writing
There are at least three notations for the same function “squaring”:
| Notation | Reading | Where it comes from |
|---|---|---|
| $f(x)=x^2$ | the value of $f$ at $x$ is $x^2$ | Euler, 1734 |
| $f:x\mapsto x^2$ | $f$ sends each $x$ to $x^2$ | spread by the Bourbaki group in the twentieth century |
| $\lambda x.\,x^2$ | the function that, given $x$, returns $x^2$ | Alonzo Church, 1930s |
The arrow $\mapsto$ has one advantage: it shows the function as a movement from an input to an output, without giving the impression that $x$ is a particular number. Church’s $\lambda$ goes further: it gives the function a name that needs no name. The expression $\lambda x.\,x^2$ is the function itself, just as $5$ is the number itself. From this idea came the functional programming languages, in which one writes, for example, lambda x: x**2.
Composing: from right to left
The composition of two functions is written $f\circ g$ and read “$f$ after $g$”:
$$(f\circ g)(x)=f(g(x)).$$The order of writing is the reverse of the order of the operations: $g$, which is on the right, is applied first. With $f(x)=x^2$ and $g(x)=x+1$:
$$(f\circ g)(x)=(x+1)^2,\qquad(g\circ f)(x)=x^2+1.$$They are different functions. Like the symmetries of Galois’s triangle, functions do not commute, and the notation has to keep the order.
The exponent that changes meaning
Trigonometry has kept a strange convention. We write
$$\sin^2x=(\sin x)^2,$$and the exponent means “square the value”. But ever since the English astronomer John Herschel proposed the notation in 1813,
$$\sin^{-1}x=\arcsin x,$$and the exponent $-1$ means “the inverse function”, not $\frac1{\sin x}$. The same place, above and to the right of the function’s name, carries two different rules, and only memory tells which one applies. It is a clear case of a notation that suggests the wrong step: whoever applies the rules of exponents to $\sin^{-1}$ gets a false answer.
Exercise: what goes in the hole?
With $f(x)=x^2$, compute $f(x+1)$, $f(x)+1$, $f(2x)$ and $2f(x)$. Putting the whole input into the hole: $f(x+1)=(x+1)^2=x^2+2x+1$; $f(x)+1=x^2+1$; $f(2x)=(2x)^2=4x^2$; $2f(x)=2x^2$. The four expressions are different. The position of the $+1$ and the $2$, inside or outside the brackets, decides whether they act on the input or on the output.
Exercise: sin⁻¹ and 1/sin
Compute $\sin^{-1}\frac12$ and $\frac1{\sin(\pi/6)}$. The first is the angle whose sine is $\frac12$: $\frac\pi6$, or $30°$. The second is $\frac1{1/2}=2$. The similar notation hides two completely different objects: an angle, and a number that is not even the sine of any angle, because it is greater than $1$.
Chapter index · ← Parameters: letters that stay still while others move · Dummy letters: the k of the sum and the t of the integral →