28
$\begingroup$

I really need to clear up a few things about function notation; I can't seem to grasp how to interpret it. As of right now, I know that a function is roughly a mapping between a set $X$ and a set $Y$, where no element of $X$ is paired with more than one element of $Y$. This seems simple enough. I know that this function is commonly denoted by a single letter, such as $f$, $g$, or $h$. I also that when it comes to "rules" for function, $f$ denotes the set of mathematical instructions that tell how to find an output in set $Y$ given an input in set $X$. $x$ is the input, $f$ is the function, and $f(x)$ is the result of applying f to an input $x$, i.e., the output. My main question is, why do many authors say call $f(x)$ the function? This really confuses me, since $f(x)$ is a variable for a real number, and not a mapping between two different sets. Following from this, why do some say that an expression such as $2x + 5$ is a function? As stated before, this seems to just be a variable quantity that varies with $x$, but is not a function itself. Finally, if it's true that $x$ is the input, $f$ is the function, and $f(x)$ is the output, then why do we manipulate functions, like $f$, through the output $f(x)$? For example, we have the image of $x$ under $f$, $f(x) = 2x^2 + 5x$. The only way to find $f'$ (the derivative of $f$) is to manipulate $f(x)$. If we're manipulating functions, then why must we reference an input variable $x$ in the process? Why do we have to have $f(x)$ in order to find the derivative of $f$?

One of the most confusing aspects about function notation is the differentiation operator. $dy/dx$ represents the "infinitesimal" change in $y$ with respect to the "infinitesimal" change in $x$, and since $y = f(x)$, we can write $df(x)/dx$. The confusing aspect of this is, we say "take the derivative of the function $f(x)$"; however, $f(x)$ can't be a function because it is equal to $y$, which is a variable quantity, not a function. To add to the confusion, we say that the differentiation operator $d/dx$ maps a function, $f$, to its derivative, $f'$. However, as with $df(x)/dx$, we need $f(x)$ in order to transform the function $f$ into $f'$. This seems very confusing, because then it seems that the derivative operator, $d/dx$, actually maps $f(x)$ to $f'(x)$, since we need $f(x)$ to calculate the derivative. The differentiation operator is just an example of a more broad frustration with function notation.

To recap, I know that $x$ is the input, $f$ is the function, and $f(x)$ is the image of $x$ under $f$, which can often be given by an algebraic expression. I know that $f$ is a mapping, so $f: x \mapsto f(x)$. This means that $f$ is the function that maps $x$ to an output $f(x)$. I've determined this for myself, but I always stumble when I see authors or other people refer to $f(x) = $ "some expression" as the function. It is clear that $x$ is a variable of a real number, and $f(x)$ is a variable of a real number that is dependent on $x$. Then, $f$ is the function, the mapping that links $x$ to $f(x)$; yet , people insist on saying that something like $2x + 1$ is a function. Additionally, I know that differentiation is an operator $d/dx: f \mapsto f'$. However, in order to calculate derivatives, we are not given a function $f$, we are given the image of $x$ under $f$, $f(x)$. This means that it seems that the differentiation operator should be $d/dx: f(x) \mapsto f'(x)$. However, I do not think this is right, and it is one of the main points of my confusion.

EDIT: Looking at some of the comments, I have one additional question. When we define a function, we usually do so by writing $f: X \rightarrow Y$, such that $f(x) = 5x^2$, for example. My additional question is, why is it necessary to, in order to define the rule for a function, use a variable x as the input in the function? Why don't we define functions like $f(~)$, with no reference to any variables, since we are specifying the action of the function, not the image of $x$ under $f$...

$\endgroup$
13
  • 3
    $\begingroup$ I would say that, when it is the original definition, $f(x) = ...$ is to be understood as $f = x \mapsto ...$ As for $d/dx$, you can think of it two different ways, depending on what's convenient in context. Either $d/dx = f \mapsto f'$ or $d/dx = (f,x) \mapsto f'(x)$. These are the same, through an isomorphism usually called currying in the computer science literature. $\endgroup$
    – Ian
    Jan 13, 2015 at 4:25
  • 3
    $\begingroup$ Also, you can't compute a derivative knowing only the value of a function at one point. At a minimum you need knowledge of the values of the function on some open set containing the point. $\endgroup$
    – Ian
    Jan 13, 2015 at 4:27
  • 10
    $\begingroup$ Short answer based on my opinions: (1) people don't learn grammar, (2) notation (e.g. lambda abstraction) for expressing things both precisely and conveniently is unfamiliar, and (3) people don't properly learn about dependent variables, and are instead trained to interpret everything as functions. $\endgroup$
    – user14972
    Jan 13, 2015 at 4:30
  • 18
    $\begingroup$ Are you genuinely confused about what is meant when someone writes "the function $3x^2-5x+7$" or are you being excessively pedantic just to see what people say? In my experience, anyone who can articulate the subtlety that you are bringing up in your question knows exactly what is going on. $\endgroup$
    – KCd
    Jan 13, 2015 at 6:18
  • 7
    $\begingroup$ I heard a story once that someone was giving a lecture at Harvard (on some topic in number theory or representation theory) and people from the audience started to get picky about the notation being used by the lecturer. It somehow was not precise enough for them. After some back and forth comments among various people in the audience the speaker finally said "Hold on! Who does not really know what I am trying to say?" There was silence. "Thank you. Now let me proceed..." The OP's claim not to be able to grasp utterly standard function notation reminds me of the audience in that lecture. $\endgroup$
    – KCd
    Jan 13, 2015 at 9:17

5 Answers 5

18
$\begingroup$

$f(x)$ means both the map $x \mapsto \textrm{whatever}$ and the image of $x$ under $f$, depending on the context.

Some people would prefer a stricter convention of always writing the function as $f$. In practice I find there is usually little room for confusion, and saying "the function $f(x)$" conveniently reminds the reader what the independent variable of $f$ is (in the case that $f$ contains many constants, etc).

However, as you point out there are exceptions where confusion does arise, particularly when taking derivatives. For example, is $$\frac{\partial f(x^2)}{\partial x}$$ the derivative of $f$ evaluated at $x^2$? Or the derivative of the composition of $f$ with $x^2$? What about $$\frac{\partial f}{\partial x}(x^2)?$$ Again, one can usually figure out what is meant, but here there is definitely a potential for confusion. With functions of multiple variables it gets even worse; for instance in physics you often define functions $L(x^i, x^{i+1})$ and then need to differentiate $$\frac{\partial}{\partial x^i} \sum_{j=0}^n L(x^{j}, x^{j+1}).$$ It's hard to write down an expression for this derivative that's not a complete abomination. You could go back and rename the independent variables of $L$ using placeholders less likely to lead to confusion, but perhaps better is to switch to notation like $D_1 f$ to denote partial differentiation of $f$ with respect to its first parameter.

$\endgroup$
4
  • $\begingroup$ Good examples. We had a similar question on this come up recently math.stackexchange.com/questions/1091097/… $\endgroup$
    – DanielV
    Jan 13, 2015 at 4:51
  • $\begingroup$ Why is it that people don't use something like $\dfrac{\partial}{\partial x}[f(x, y)]\big|_{x = z}$ to mean the partial derivative with respect to $x$ of $f$ evaluated at $x = z$? $\endgroup$ Jan 13, 2015 at 18:51
  • $\begingroup$ @Clarinetist People certainly do; as for why it's not used more often, I would guess the main disadvantage is that it's cumbersome (especially if $z$ is some complicated expression). $\endgroup$
    – user7530
    Jan 13, 2015 at 18:56
  • $\begingroup$ In my experience, the notation $f$ is also used for both the function and the image of $x$ under $f$ (where the choice of $x$ is implied, and the implied argument(s) might differ between functions). For example, given $f(x) = x^2 + 3x$, we might be asked for $\frac{df}{dx}$, where the requestor really means $\frac{d(x^2 + 3x)}{dx}$. In order to ascribe meaning to that request, we must remember that $f$'s favorite letter is $x$. $\endgroup$ Apr 17, 2021 at 1:03
11
$\begingroup$

I think the question of notation being abused and ambiguous applies to many more things than functions within mathematics. I could (and I think this has been done before on this very site) make a list of notations (or expressions) whose meaning is dependent on context. In practice, a shorthand, or convenience, notation is usually never a problem.

However, I do think there are times when context is not sufficient. Consider how:

$f^2(x) = f(f(x))$

for most functions, but I have also seen the (very strange to me):

$sin^2(x) = (sin(x))^2$

which puzzled me greatly when I first saw it. But then again, I'm more of a programmer than a mathematician, so I do like it when expressions are non-ambiguous. I one asked a mathematician (back in the 1980s) "How do I know when $f^n(x)$ is iteration and when it is raising the result of application to a power?" and he thought for a few minutes and then said: "I think it is the latter when the function is transcendental." But I am not so sure of that answer: I've seen $\log^2x$ mean both $\log(\log x)$ and $(\log x)^2$ and it drives me crazy! (By the way $\log \log n$ appears often in algorithm analysis.)

I point this out because this is a case where the context is often insufficient to disambiguate the notation. So why did someone use the notation for raising the result to a power to begin with? I believe it was to save time writing parentheses! Yes, they traded convenience for ambiguity! But back when this notation became popular, there were more engineers than there were pure mathematicians and functional programmers concerned with function iteration. :)

EDIT: In the comments below someone said that the notation has a ring theory justification.

Now to return to your question, in the case of $f(x)$ referring to the function versus the result of application, personally, as one who does functional programming, it does make me sad to see "the function $f(x)$" when the codomain of $f$ is the real numbers, because I so badly want the codomain to be functions! Yes, I like higher-order functions, and I almost feel bad for those who.... oh, never mind.

The probable source of the expression $f(x)$ when someone means to write only $f$ is that the former gives an indication of the arity of the function. That said, it does create an ambiguity, which you must try to figure out, but the surrounding text should make it so you usually can. Human beings are not bound to be all the time unambiguous and super-precise, so we take notational liberties.

Now, obviously a problem can occur if you take this abuse of notation and try to use it in a program. I don't know many programming languages that would tolerate that kind of ambiguity.

As to your other point, yes if someone tried to say that $2x+5$ was a function, they are probably only doing so because they do not want to type, or write $\lambda x. 2x+5$ -- perhaps because they don't like Greek letters (just kidding) or any of the other countless representations for anonymous functions. Again, people are allowed to do this because they are being informal. When writing programs, yes we must say:

  • (x) -> 2*x + 5 // CoffeeScript
  • function(x){return 2*x+5} // JavaScript
  • (LAMBDA (x) (+ (* 2 x) 5)) ; Lisp
  • fn x => 2 * x + 5 (* ML *)
  • #(+ (* 2 %) 5) ; Clojure

and so on.

TL;DR It is allowed because it is informal, and yes you are expected to infer it from context. I've given some thoughts as to why some of the ambiguity might have arisen: the same reasons that people shortcut anything in communication! We can live with this in mathematical communication between people but not for programming.

ANSWER TO YOUR EDIT QUESTION:

You asked why we define functions using variables like $x$ and $y$ instead of defining them without reference to any variables. Now if your question was one of differentiating

$$f =_{def} \lambda x. \lambda y. 2x+y$$

from

$$f(x,y) =_{def} 2x+y$$

then the answer is that the second is probably easier to write. However, we can do something more interesting, as is done in the programming language Clojure: let %1 be the first argument to the function, and %2 be the second argument, and so on, and define the brackets #( and ) to wrap a function expression. Now we can write:

$$f =_{def} \#(2(\%1) +\%2)$$

and in fact we can use anonymous function expressions. That particular notation might be a but ugly, but I would encourage you to try to invent a nice notation, and change the world for the better. If it catches on, that is.

$\endgroup$
11
  • 3
    $\begingroup$ @leftaroundabout Most people will understand $x \mapsto 2\,x + 5$. $\endgroup$ Jan 13, 2015 at 14:01
  • 2
    $\begingroup$ The business about $f^n$ meaning either iterated composition or exponentiation of the function value comes about because there are two different ways to give a function space a multiplicative structure. For a ring $R$, the space $X\to R$ naturally becomes a ring with addition and multiplication defined pointwise, and it would be very inconvenient to deny the usual ring notation for those operations, including $\sin^2$. On the other hand, the functions $X\to X$ form a monoid under composition that is often written multiplicatively. ... $\endgroup$ Jan 13, 2015 at 15:58
  • 1
    $\begingroup$ ... and in particular the space of linear maps $V\to V$ for a $K$-vector space $V$ becomes a (non-commutative) $K$-algebra under pointwise addition and composition, and that also has a good claim to the usual ring notation. $\endgroup$ Jan 13, 2015 at 16:01
  • 1
    $\begingroup$ What Henning said. Also, notation $f^n$ is just a convention (as is using $+$ sign, etc.). If in some particular area one usage is way more common than the other (which is perhaps non-existent), then it makes a lot of sense to use a different convention. For example, depending on the domain $\pi$ could mean some permutation, or a projection, or the prime-counting function or the ratio of circumference to diameter or yet something else. $\endgroup$
    – dtldarek
    Jan 13, 2015 at 17:17
  • 1
    $\begingroup$ Both meanings of ‘$f^2$’ have their justifications, but it's mixing them that drives me crazy. If you're going to write ‘$\sin^2x$’ for $(\sin x)^2$, fine, that's very well justified, but then how can you write ‘$\sin^{-1}x$’ for anything other than $(\sin x)^{-1}$ (that is $\csc x$)? You need to use another notation, such as ‘$\operatorname{asin} x$’, for the inverse sine of $x$. (This is aside from the technicality that the sine function is not actually invertible.) $\endgroup$ Sep 23, 2018 at 7:22
3
$\begingroup$

Most times, functions can be defined by an expression (e.g., $2x+5$), because using the expression we can guess many things about the function (like its domain, and the "rule" for getting an output given an input). The phrasing "$f(x)$" is just a generic expression.

Also, context and notation helps a lot, so if you are reading a book about vector spaces, you know that when the author says

the function $Ax+b$

he really means something like:

the function $f:E\to F,x\mapsto Ax+b$, where $E$ and $F$ are vector spaces, $b\in F$ and $A$ is a matrix.

You might even know that $E=F$, or that $E=\mathbb R^n$, or something like that. Anyway, as you can see, the first is much simpler.

As for the derivatives, you can differentiate an expression. I've never seen a formalization of this, but people do write $$\frac{d}{dx}\left\{2x^2 + 3x + 5\right\}=4x+3$$ without ever mentioning functions. So that $df(x)/dx$ is an expression, and $df/dx$ is a function $df/dx:D\to Y$, where $D$ is the set of points where $f$ is differentiable, and $Y$ is $\mathbb R$, or more generally, a space of linear operators.

EDIT: as for your added question, you can define a function without mentioning a variable ("Let $f$ be the function that takes a real number and gives the quintuple of its square"), but usually, it's easier to write "Let $f(x)=5x^2$". Also, the expression "$5x^2$" is much more familiar for most readers than writing "the quintuple of the square of a real number".

$\endgroup$
2
$\begingroup$

I think the formalism removes ambiguity instead of increasing it as it defines the variables of the function. In essence, the notation differentiates the variables from the "constants" of the function.

More technically, the "constants" should actually be something like "variables, defined/assumed elsewhere, dependent or independent of of the dependent variable(s) of the function defined by the definition given here" while considering that the dependent/independent variables can also be functions, but I digress.

Consider this: $$ f(x) = ax \\ \frac{d}{dx}f(x) = (\frac{d}{dx}a)x + (\frac{d}{dx}x) a = 0 + 1a = a $$, where a is arbitrary constant (or a variable/function independent of x).

However, I do think there are issues with the notation, but it isn't in ambiguity as the result will (should?) remain the same regardless of how we consider the problem, rather it's in "hiding the obfuscation".

Let's consider this: $$ f(x) = ax \\ banana = x \\ \frac{d}{dx}f( banana ) = \ldots = a $$ What happens in ... of the last row?

For example, should constants actually be handled as a special class of independent functions (ie. eg. a = 9 <-> a( ) = 9 or even a( x ) = 9 + 0x) or how the banana should be handled (ie. f( banana ) = x or banana( x ) = x or ...) or...? The issue is that what goes into the ... changes, it is undoubtedly ambiguous, but the result – a – should remain the same.

In essence, there's a lot of short-handing going on in algebra. Therefore, I think the issue simply boils down to what is considered syntactic sugar rather than axiomatic expression.

$\endgroup$
2
$\begingroup$

There are many questions in the final version of this post, and here I'm going to try to answer them all afresh.

  1. Why do many authors call $f(x)$ the function? Why do some say that an expression such as $2x^2 + 5$ is a function?

    I interpret this question as asking how this state of affairs came about. It was not, as many people assume, through carelessness or deliberate abuse of notation/terminology (although perhaps that it how it persists), but because the meaning of the word ‘function’ (‘Funktion’, ‘fonction’, etc) has changed over time. The question at https://hsm.stackexchange.com/questions/6104/who-first-considered-the-f-in-fx-as-an-object-in-itself-and-who-decided-t by @MichaelBächtold (the question, not the answers, although they add some details) explains this history; but briefly, the original meaning of the word ‘function’ was $f(x)$, and this was established for a couple of centuries before anybody seriously considered the nature of $f$ as a thing in itself. (And when they did, they initially came up with different words for it.) This is in contrast to the synonyms ‘map’ and ‘mapping’, which have always meant $f$, and you're less likely to see $f(x)$ called by one of those terms.

    Even when people write things like ‘$f(x)$ is continuous’ or ‘$2x^2 + 5$ is continuous’, this can be made sense of, although now it is true that the terminology is being abused; it should be ‘$f(x)$ is continuous in $x$’ or ‘$f(x)$ is continuous as a function of $x$’. (In practice, this meaning is clear, but ‘$f(x,y)$ is continuous’ and ‘$2x^2 + y$ is continuous’ are genuinely ambiguous.) Similarly, ‘the derivative of $2x^2 + 5$’ is an abbreviation for ‘the derivative of $2x^2 + 5$ with respect to $x$’ (but notice that, while the derivative of $f$ is the mapping $f'$, the derivative of $f(x)$ with respect to $x$ is that mapping's value $f'(x)$).

    This is not to say that nobody who writes like this is confused or careless, only that there is long-standing precedent for this terminology, and that it can be done precisely and carefully. But if you want to use ‘function’ with its modern meaning and you want to write without abuse, then yes, the function is $f$ and not $f(x)$. (Although you can still say that $2x^2 + 5$ is a function of $x$, or that $2x^2 + 5$ is continuous in $x$, as this terminology has no other meaning. And you can also write $x \mapsto 2x^2 + 5$ if you want to discuss the function itself without giving it a name such as $f$.)

  2. If we're manipulating functions, then why must we reference an input variable $x$ in the process?

    You don't have to do this, but it's often convenient and always relevant. This is because a function (in the modern sense, that is a mapping) is determined by how it relates its inputs to its outputs. Some of the other answers have shown how you can refer to $x \mapsto 2x^2 + 5$ by high-level notation such as $2\operatorname{id}_{\mathbb{R}}^{\,2} + \operatorname{const}_5$ (although nobody else seems to have suggested quite this way of putting it), but at some point you have to define what identity functions and constant functions are and explain what it means to add and multiply functions, and at the most basic level, this is done with reference to input and output values.

    So if I want to differentiate $x \mapsto 2x^2 + 5$, then maybe I directly compute $$\Bigl(x \mapsto \lim\nolimits_0 \bigl(h \mapsto \bigl((\xi \mapsto 2\xi^2 + 5)(x + h) - (\xi \mapsto 2\xi^2 + 5)(x)\bigr)/h\bigr)\Bigr) = \Bigl(x \mapsto \lim\nolimits_0 \bigl(h \mapsto \bigl((2(x + h)^2 + 5) - (2x^2 + 5)\bigr)/h\bigr)\Bigr) = \bigl(x \mapsto \lim\nolimits_0 (h \mapsto (4hx + 2h^2)/h)\bigr) = \bigl(x \mapsto \lim\nolimits_0 (h \mapsto 4x + 2h)\bigr) = (x \mapsto 4x)$$ (notice the change of dummy variable in the first step to avoid reusing a variable name), or maybe I do a more high-level calculation $$(2\operatorname{id}_{\mathbb{R}}^{\,2} + \operatorname{const}_5)' = 2(2\operatorname{id}_{\mathbb{R}}^{\,2-1}\operatorname{const}_1) + \operatorname{const}_0 = 4\operatorname{id}_{\mathbb{R}}$$ that relies on known rules of differentiation. (Of course, the more basic calculation also relies on some rules of limits.) But when I prove these rules of differentiation, then I still need to go back to input and output values.

  3. To add to the confusion, we say that the differentiation operator $d/dx$ maps a function, $f$, to its derivative, $f′$.

    I'd say that the differentiation operator $D$ (or $'$ written postfix) maps a function $f$ to its derivative $Df$ (or $f'$). In contrast, $d/dx$ maps the quantity $f(x)$ to the quantity $f'(x)$; in particular, it maps the quantity $2x^2 + 5$ to the quantity $4x$. If you want to formalize what these ‘quantities’ are, then see the question https://mathoverflow.net/questions/307947/formalizations-of-the-idea-that-something-is-a-function-of-something-else by Michael Bächtold (and the answers by Terry Tao and Mike Shulman, especially the first two paragraphs of Mike's answer); but if you don't want to go down that route, then you can interpret $(d/dx)(2x^2 + 5)$ or $d(2x^2+5)/dx$ as notation for $(\xi \mapsto 2\xi^2 + 5)'(x)$ (which again has a change of dummy variable to avoid a clash). Note that in this case, $(d/dx)\bigl(f(x)\bigr) = \bigl(\xi \mapsto f(\xi)\bigr)'(x) = f'(x)$ as expected. In any case, to avoid ambiguity, you can't apply $'$ to $2x^2 + 5$ (although you can apply it to $x \mapsto 2x^2 + 5$) or apply $d/dx$ to $f$ (although you can apply it to $f(x)$). People who write ‘$(2x^2 + 5)' = 4x$’ or ‘$df/dx = f'(x)$’ are being sloppy, although they can get away with it under certain default assumptions (such as that $x$ is the default variable). This is essentially the same issue as saying ‘$2x^2 + 5$ is continuous’ instead of ‘$2x^2 + 5$ is continuous in $x$’ or ‘$x \mapsto 2x^2 + 5$ is continuous’; in particular, it gets more ambiguous when you have more variables.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .