# What do “function of” and “differentiate with respect to” mean?

In maths and sciences, I see the phrases "function of" and "with respect to" used quite a lot. For example, one might say that $$f$$ is a function of $$x$$, and then differentiate $$f$$ "with respect to $$x$$". I am familiar with the definition of a function and of the derivative, but it's really not clear to me what a function of something is, or why we need to say "with respect to". I find all this a bit confusing, and it makes it hard for me to follow arguments sometimes.

In my research, I've found this, but the answers here aren't quite what I'm looking for. The answers seemed to discuss either what a function is, but I know what a function is. I am also unsatisfied with the suggestion that $$f$$ is a function of $$x$$ if we just label its argument as $$x$$, since labels are arbitrary. I could write $$f(x)$$ for some value in the domain of $$f$$, but couldn't I equally well write $$f(t)$$ or $$f(w)$$ instead?

To illustrate my confusion with a concrete example: consider the cumulative amount of wax burnt, $$w$$ as a candle burns. In a simple picture, we could say that $$w$$ depends on the amount of time for which the candle has been burning, and so we might say something like "$$w$$ is a function of time". In this simple picture, $$w$$ is a function of a single real variable.

My confusion is, why do we actually say that $$w$$ is a function of time? Surely $$w$$ is just a function on some subset of the real numbers (depending specifically on how we chose to define $$w$$), rather than a function of time? Sure, $$w$$ only has the interpretation we think it does (cumulative amount of wax burnt) when we provide a time as its argument, but why does that mean it is a function of time? There's nothing stopping me from putting any old argument (provided $$w$$ is defined at that point) in to $$w$$, like the distance I have walked since the candle was lit. Sure, we can't really interpret $$w$$ in the same way if I did this, but there is nothing in the definition of $$w$$ which stops me from doing this.

Also, what happens when I do some differentiation on $$w$$. If I differentiate $$w$$ "with respect to time", then I'd get the time rate at which the candle is burning. If I differentiate $$w$$ "with respect to" the distance I have walked since the candle was lit, I'd expect to get either zero (since $$w$$ is not a function of this), or something more complicated (since the distance I have walked is related to time). I just can't see mathematically what is happening here: ultimately, no matter what we're calling our variables, $$w$$ is a function of a single variable, not of multiple, and so shouldn't there be absolutely no ambiguity in how to differentiate $$w$$? Shouldn't there just be "the derivative of w", found by differentiating $$w$$ with respect to its argument (writing "with respect to its argument" is redundant!).

Can anyone help clarify what we mean by "function of" as opposed to function, and how this is important when we differentiate functions "with respect to" something? Thanks!

• Functions may depend on several variables, in which case it is important to clarify which one you intend to vary. If the context makes it clear which variable is intended, then people often just speak of "the derivative" of a function, without bothering to mention the (understood) variable. Beyond that...to say that one variable $y$ is "a function of another, $x$" just means that changes in $x$ are expected to produce changes in $y$. Does that help? – lulu Jan 5 at 23:58
• I'm not sure whether you are asking about functions in the abstract or functions in a scientific sense. If you mean the latter, then of course some observed variable might be expected to depend on other variables. – lulu Jan 5 at 23:59
• @lulu I would still be a bit confused by that. Suppose now that $w$ in the question depends on time, and altitude, so $w$ is a function of two real variables. Let the first argument of $w$ be time, and the second argument altitude. All my confusion about $w$ is still there, though. If $a$ is a time and $b$ is an altitude, then $w(a, b)$ has the meaning we want it to. However, we can still consider $w(c, d)$, where $c$ is a value of distance I've walked, and $d$ is the pressure in the room of the candle. My confusion about single variables still is there for multiple. – Deeside Jan 6 at 0:04
• So what's confusing me is why we care about what the labels are. I understood that when we write $f(x) = x^2$, we're saying something along the lines of "$f$ a function which squares its argument", and that $x$ doesn't really 'exist', so to speak, outside of the definition of $f$. Since I thought we think of functions as independent objects of what we've called their variables, why don't we have $f(t) = t^2$? And why does it matter what we call some $x$ outside of the definition of $f$? – Deeside Jan 6 at 0:11
• But since the variable names are arbitrary, why should we say $G$ is a function of $x$ and $y$, or $a$ and $b$, etc. Why is that useful? In your population example, I get how the population can change with all the actual variables, but I'm really struggling to see how we actually formalise this in maths as an actual mathematical function, since the variable names are arbitrary. – Deeside Jan 6 at 0:35

As a student of math and physics, this has been one of the biggest annoyances for me; I'll give my two cents on the matter. Throughout my entire answer, whenever I use the term "function", it will always mean in the usual math sense (a rule with a certain domain and codomain blablabla).

I generally find two ways in which people use the phrase "... is a function of ..." The first is as you say: "$$f$$ is a function of $$x$$" simply means that for the remainder of the discussion, we shall agree to denote the input of the function $$f$$ by the letter $$x$$. This is just a notational choice as you say, so there's no real math going on. We just make this choice of notation to in a sense "standardize everything". Of course, we usually allow for variants on the letter $$x$$. So, we may write things like $$f(x), f(x_0), f(x_1), f(x'), f(\tilde{x}), f(\bar{x})$$ etc. The way to interpret this is as usual: this is just the result obtained by evaluating the function $$f$$ on a specific element of its domain.

Also, you're right that the input label is completely arbitrary, so we can say $$f(t), f(y), f(\ddot{\smile})$$ whatever else we like. But again, often times it might just be convenient to use certain letters for certain purposes (this can allow for easier reading, and also reduce notational conflicts); and as much as possible it is a good idea to conform to the widely used notation, because at the end of the day, math is about communicating ideas, and one must find a balance between absolute precision and rigour and clarity/flow of thought.

btw as a side remark, I think I am a very very very nitpicky individual regarding issues like: $$f$$ vs $$f(x)$$ for a function, I'm also always careful to use my quantifiers properly etc. However, there have been a few textbooks I glossed over, which are also extremely picky and explicit and precise about everything; but while what they wrote was $$100 \%$$ correct, it was difficult to read (I had to pause often etc). This is as opposed to some other books/papers which leave certain issues implicit, but convey ideas more clearly. This is what I meant above regarding balance between precision and flow of thought.

Now, back to the issue at hand. In your third and fourth paragraphs, I think you have made a couple of true statements, but you're missing the point. (one of) the job(s) of any scientist is to quantitatively describe and explain observations made in real life. For example, you introduced the example of the amount of wax burnt, $$w$$. If all you wish to do is study properties of functions which map $$\Bbb{R} \to \Bbb{R}$$ (or subsets thereof), then there is clearly no point in calling $$w$$ the wax burnt or whatever.

But given that you have $$w$$ as the amount of wax burnt, the most naive model for describing how this changes is to assume that the flame which is burning the wax is kept constant and all other variables are kept constant etc. Then, clearly the amount of wax burnt will only depend on the time elapsed. From the moment you start your measurement/experiment process, at each time $$t$$, there will be a certain amount of wax burnt off, $$w(t)$$. In other words, we have a function $$w: [0, \tau] \to \Bbb{R}$$, where the physical interpretation is that for each $$t \in [0, \tau]$$, $$w(t)$$ is the amount of wax burnt off $$t$$ units of time after starting the process. Let's for the sake of definiteness say that $$w(t) = t^3$$ (with the above domain and codomain).

"Sure, $$w$$ only has the interpretation we think it does (cumulative amount of wax burnt) when we provide a (real number in the domain of definition, which we interpret as) time as its argument"

True.

"...Sure, we can't really interpret $$w$$ in the same way if I did this, but there is nothing in the definition of w which stops me from doing this."

Also true.

But here's where you're missing the point. If you didn't want to give a physical interpretation of what elements in the domain and target space of $$w$$ mean, why would you even talk about the example of burning wax? Why not just tell me the following:

Fix a number $$\tau > 0$$, and define $$w: [0, \tau] \to \Bbb{R}$$ by $$w(t) = t^3$$.

This is a perfectly self-contained mathematical statement. And now, I can tell you a bunch of properties of $$w$$. Such as:

• $$w$$ is an increasing function
• For all $$t \in [0, \tau]$$, $$w'(t) = 3t^2$$ (derivatives at end points of course are interpreted as one-sided limits)
• $$w$$ has exactly one root (of multiplicity $$3$$) on this interval of definition.

(and many more other properties). So, if you want to completely forget about the physical context, and just focus on the function and its properties, then of course you can do so. Sometimes, such an abstraction is very useful as it removes any "clutter".

However, I really don't think it is (always) a good idea to completely disconnect mathematical ideas from their physical origins/interpretations. And the reason that in the sciences people often assign such interpretations is because their purpose is to use the powerful tool of mathematics to quantitatively model an actual physical observation.

So, while you have made a few technically true statements in your third and fourth paragraphs, I believe you've missed the point of why people assign physical meaning to certain quantities.

For your fifth paragraph however, I agree with the sentiment you're describing, and questions like this have tortured me. You're right that $$w$$ is a function of a single variable (where in this physical context, we interpret the arguments as time). If you now ask me how does $$w$$ change in relation to the distance I have started to walk, then I completely agree that there is no relation whatsoever.

But what is really going on is a terrible, annoying, confusing abuse of notation, where we use the same letter $$w$$ to have two differnent meanings. Physicists love such abuse of notation, and this has confused me for so long (and it still does from time to time). Of course, the intuitive idea of why the amount of wax burnt should depend on distance is clear: the further I walk, the more time has passed, and hence the more max has burnt. So, this is really a two step process.

To formalize this, we need to introduce a second function $$\gamma$$ (between certain subsets of $$\Bbb{R}$$), where the interpretation is that $$\gamma(x)$$ is the time taken to walk a distance $$x$$. Then when we (by abuse of language) say $$w$$ is a function of distance, what we really mean is that

The composite function $$w \circ \gamma$$ has the physical interpretation that for each $$x \in \text{domain}(\gamma)$$, $$(w \circ \gamma)(x)$$ is the amount of wax burnt when I walk a distance $$x$$.

Very often, this composition is not made explicit. In the Leibniz chain rule notation \begin{align} \dfrac{dw}{dx} &= \dfrac{dw}{dt} \dfrac{dt}{dx} \end{align} Where on the LHS $$w$$ is miraculously a function of distance, even though on the LHS (and initially) $$w$$ was a function of time, what is really going on is that the $$w$$ on the LHS is a complete abuse of notation. And of course, the precise way of writing it is $$(w \circ \gamma)'(x) = w'(\gamma(x)) \cdot \gamma'(x)$$.

In general, whenever you initially have a function $$f$$ "as a function of $$x$$" and then suddenly it becomes a "function of $$t$$", what is really meant is that we are given two functions $$f$$ and $$\gamma$$; and when we say "consider $$f$$ as a function of $$x$$", we really mean to just consider the function $$f$$, but when we say "consider $$f$$ as a function of time", we really mean to consider the (completely different) function $$f \circ \gamma$$.

Summary: if the arugments of a function suddenly change interpretations (eg from time to distance or really anything else) then you immediately know that the author is being sloppy/lazy in explicitly mentioning that there is a hidden composition.

Excellent question. There are already good answers, I'll try to make a few, concise points.

You should try to be nice to people reading and using your definitions, including your future self. It means that you should stick to conventions when possible.

# Variable names imply domain and codomain

If you write that "$$f$$ is a function of $$x$$", readers will assume that it means that $$f:\mathbb{R}\rightarrow\mathbb{R}$$.

Similarly, if you write $$f(z)$$ it will imply that $$f:\mathbb{C}\rightarrow\mathbb{C}$$, and $$f(n)$$ might be for $$f:\mathbb{N}\rightarrow\mathbb{Z}$$.

It wouldn't be wrong to define $$f:\mathbb{C}\rightarrow\mathbb{C}$$ as $$f(n)= \frac{in+1}{\overline{n}-i}$$ but it would be surprising and might lead to incorrect assumptions (e.g. $$\overline{n} = n$$).

# Free and bound variables

You might be interested in knowing the distinction between free and bound variables.

$$\sum_{k=1}^{10} f(k, n)$$

$$n$$ is a free variable and $$k$$ is a bound variable; consequently the value of this expression depends on the value of n, but there is nothing called $$k$$ on which it could depend.

Here's a related answer on StackOverflow.

# "All models are wrong, some are useful", George Box

Your simplified amount of wax burnt as a function of time is probably wrong (it cannot perfectly know or describe the status of every atom) but it might at least be useful.

The amount of wax burnt as a function of "the distance you have walked since the candle was lit" will be even less correct and much less useful.

# Physical variable names have meaning

Physical variable names are not just placeholders. They are linked to physical quantities and units. Replacing $$l$$ by $$t$$ as a variable name for a function will not just be surprising to readers, it will break dimensional homogeneity.

Sometimes, especially in physical contexts, the view is not of functions acting on arguments but rather of constraints acting on variables. The simplest example is that maybe we have variables $$w$$ and $$t$$ representing the length of wax burned and the duration since the candle was lit respectively, and we observe the following relation: $$w=\left(1\,\frac{\text{meter}}{\text{second}}\right)\cdot t$$ You can imagine this as the implicit definition of a curve in a $$w$$-$$t$$ plane. It's legal to take "the derivative" of both sides to get: $$dw=\left(1\,\frac{\text{meter}}{\text{second}}\right) \cdot dt$$ where the items on either side are formally known as differential forms. Here, you can't just swap out variables because $$w$$ was not defined as a function - it is related to some other quantity in a fixed way! One can read this equation as saying that, no matter how we change the state, over a small enough amount of change, the amount of candle burned is proportional to the duration passed as long as this equation holds.

A somewhat more practical idea of this is to consider what would happen if we wanted to represent a point on the circle. We know that a point $$(x,y)$$ is only a valid state if $$x^2+y^2=1$$ and we can take the derivative of both sides to get $$2x\,dx+2y\,dy=0$$ or, simplifying $$x\,dx + y\,dy = 0$$ which essentially reads that, no matter how this system moves or what laws might dictate how $$x$$ and $$y$$ vary through time or any other parameter, for small changes, the sum of each coordinate times its instantaneous rate of change must be zero. We could also rearrange to $$dx=\frac{-y}x\,dy$$ which clarifies that the derivative of $$x$$ with respect to $$y$$ is $$\frac{-y}x$$, meaning that the changes $$dx$$ and $$dy$$ in these variables are proportional by this constant.

Note that we can also add more information freely; suppose that $$x$$ is actually varying in time and is given as $$x=t^2$$. Then $$dx=2t\,dt$$. We could substitute this in to the prior formula to find out that $$x\cdot(2t\,dt) + y\,dy = 2t^3\,dt+y\,dy = 0$$ in a perfectly rigorous fashion. Then, we can see that the derivative of $$y$$ with respect to $$t$$ is $$\frac{-2t^3}y$$ by rearranging to get $$dy$$ as the product of $$dt$$ by that expression. Notice how the variables are integral to this point of view: "the derivative of $$x$$" is perhaps an acceptable way to refer to $$dx$$, but that symbol tells you nothing; the idea of "derivative of $$x$$ with respect to $$y$$" tells you a meaningful relationship between $$dx$$ and $$dy$$ - which are objects in their own right (differential forms), rather than evaluations of $$f'$$ for some function $$f$$. This is actually a rather convenient way to do calculus - for instance, the fact that you can substitute in for anything (including $$dx$$) replaces both the chain rule and the formulas for integration by substitution, which makes calculus feel more like algebra.

Okay, but how does this relate to the idea of "function of" and "differentiate with respect to"? Well, whenever we have some expression of the form $$da=k\cdot db$$ where $$a$$ and $$b$$ and $$k$$ are variables, we might write that $$k=\frac{da}{db}$$ (which is an abuse of notation, not literal division - you cannot divide differential forms!) is the derivative of $$a$$ with respect to $$b$$ since it's the constant of proportionality relating the change of those variables. Similarly, expressions of the form $$a=f(b)$$ can often be read as saying that $$a$$ is a function of $$b$$ - in the very literal since where "is" means "equals" and "a function" refers to $$f$$ and "of" refers to function application. These are still variables, but there's a function involved now, and we do indeed have $$da= f'(b)\,db$$ where $$f'$$ is the derivative of the (abstract) function $$f$$. Of course, if you consider $$f$$ as a function whose domain is the set of durations and whose codomain is the set of lengths, you will find that $$f'$$ carries units of speed by definition of the derivative - so there is still some concrete information in $$f$$, even if we could take some other duration $$c$$ and write $$f(c)$$ (though we wouldn't know that this was equal to anything of interest). Sometimes we even say $$a$$ is a function of $$b$$ if a relation like $$a=f(b)$$ just holds on some section of the space of states (e.g. if the coordinates are just restricted to be on some circle, where no relation like this holds globally).

Unless you are working in a single dimensional space of states (as is the case for a circle or a line in the earlier examples), the derivative of one variable with respect to another needn't exist - which also indicates another meaning of "differentiate with respect to". For instance, suppose we wanted to consider a sphere: $$x^2+y^2+z^2=0$$ We can differentiate and rearrange to get that if $$x\neq 0$$ then $$dx = \frac{-y}{x}\,dy + \frac{-z}x\,dz$$ If we agree that $$y$$ and $$z$$ are the canonical coordinates, then the coefficients $$\frac{-y}x$$ and $$\frac{-z}x$$ are the derivatives of $$x$$ with respect to $$y$$ and $$z$$ respectively. This can also be thought of as a two step process where we look at the sets of states where the $$z$$ coordinate is fixed (which is then one dimensional) and find a coefficient of proportionality between $$dx$$ and $$dy$$ - noting that this meaning of the word does depend on the definition of $$z$$, so you have to actually choose a whole coordinate system to get any well-defined notion of "differentiate with respect to" out of multiple dimensions.

In summary, a lot of this terminology arises because there are multiple formal viewpoints on calculus; you are largely writing about the view that calculus studies functions $$\mathbb R\rightarrow\mathbb R$$, but it is also valid to view calculus as studying variables defined on a space. This latter view better explains terms like "function of" and "derivative with respect to" which refer literally to variables that are not treated as functions.

Formal disclaimer: Largely, this view is associated to differential geometry where we have some differentiable manifold $$M$$ (i.e. a set with enough structure that we can do differential calculus on - like a curve or a surface) which represents the set of all possible states of a system (e.g. all the points on a circle or all the states that a burning candle passes through) and then each "variable" is a function $$M\rightarrow\mathbb R$$ that reads off some quality of that state (e.g. the $$x$$ coordinate or the amount of wax burned). Note that this is somewhat backwards from the functional view, since there is no separation between inputs and outputs and no parameterization of the manifold $$M$$ implied - and since one can work purely off of the relationships between these variables. However, note that this largely avoids the "function of what?" problem because our variables, though they are functions, are functions on a very meaningful domain: the set of legal states of a system - and while you might be able to parameterize these states by real numbers, these states needn't be thought of as real numbers. Even better is that we don't have to think of the codomain of variables as being $$\mathbb R$$ - for instance $$w$$ could be a map from $$M$$ to the space of lengths and $$t$$ could be a map to the space of durations, which can both be parameterized by real numbers, but inherently have units and are therefore not naturally equal to the real numbers. So, as is surprisingly common in mathematics, we have really just taken a function and said "we're going to call it a variable and use the notation we'd use for a real number", but everything works out like you'd expect, so it's okay. The point of view basically boils down to "we need to define $$M$$ in order to make this rigorous, but we will never mention it if we don't have to."

Formal disclaimer 2: Sometimes this notion is also used in connection with the study of differential algebras, which is fairly different from what is presented here, but it's unlikely that you'd encounter these things unless you were really looking for them, so don't worry about it.

• “but everything works out like you'd expect” – except when it doesn't, which is kind of often the case. Planck spectrum maximum is a classical example where this confuses the hell out of everybody first learning it. – leftaroundabout Jan 6 at 14:38
• when you said "a set without enough structure" did you mean "a set with enough structure"? – J. W. Tanner Jan 7 at 20:04
• @J.W.Tanner Yes. – Milo Brandt Jan 7 at 20:05

Technically, you cannot consistently say that $$f$$ is a function (in the modern sense) and yet say that $$f$$ is a function of $$x$$. This kind of inconsistency seems to have arisen when some people got sloppy and conflated the older sense of "function" with the modern sense.

In the older sense, we say "$$y$$ is a function of $$x$$" to mean that "in all situations where $$x,y$$ are defined, for each possible value of $$x$$ there is a specific value of $$y$$". In modern terms, this means "there exists a function $$f$$ such that $$y = f(x)$$ for all $$x∈D$$ where $$D$$ is the domain of possible values of $$x$$ under consideration". In the older usage of "function of", a mapping was conceived only to exist between variables; it did not exist by itself. In other words, "function of" was a relation between variables and expressions involving variables.

Note that this usage of "variable" is the older sense, not the newer one from modern logic. Also be careful not to confuse variables in this sense with just plain numbers. If $$x,y$$ are plain real numbers, then we cannot say anything like "$$y$$ is a function of $$x$$". The concept of "function of" only makes in relation to variables (literally varying quantities). If $$x$$ is a real and $$f$$ is a function on the reals, then $$f(x)$$ is just another real, not a function, nor a function of anything. But if $$x$$ is a variable, then $$f(x)$$ is also a variable and is literally a function of $$x$$.

In the newer sense, we do not use the phrase "function of" because we have come up with the abstract concept of "function" as objects in their own right. In other words, "function" is a type of objects. If we have a function $$f : S→T$$, then $$f$$ is a mapping from $$S$$ to $$T$$, and not the result of applying that mapping to some object in $$S$$.

Note that the two senses are not incompatible; you just have to use them precisely. To take your example, consider the burning of a candle. Let $$h$$ be the height of the candle, and $$w$$ be the amount of wax remaining on the candle. Then $$h,w$$ are variables and they vary over time. It is thus natural to let $$t$$ be the variable denoting time. We can validly say that $$w$$ is a function of $$h$$, meaning that there is some function $$f$$ such that $$w = f(h)$$ for every $$h∈[0,H]$$, where $$H$$ is the initial height of the candle. We can also ask for the derivative of $$w$$ with respect to $$h$$, denoted by $$\frac{dw}{dh}$$. In modern terms, you can ask for the derivative of $$f$$, denoted by $$f'$$. But here we are asking for the derivative of the expression $$w$$, and so it is in fact necessary to specify with respect to what variable. Note that the same variable $$w$$ can also be a (different) function of time $$t$$.

There are many advantages of using a formalization of differentiation that includes Leibniz notation, namely the notation "$$\frac{dy}{dx}$$" (not a fraction) for derivative of $$y$$ with respect to $$x$$. One is that facts like the chain rule can be proven in a natural way without sacrificing rigour. And as an example application to the burning candle above, if $$\frac{dw}{dh}$$ and $$\frac{dh}{dt}$$ are defined, then by the chain rule we have $$\frac{dw}{dh} · \frac{dh}{dt} = \frac{dw}{dt}$$. Another is that we can reason about the gradient of parametric curves even at points where the curve is not locally bijective (see the second example here).

A third advantage is that in the physical sciences it is typical to have implicit relations, where we are interested in certain variables and how they vary with respect to one another, even though in an actual experiment those variables vary with time. For example in a titration we may be interested in the point where the pH changes most slowly with respect to titrant amount (see this post for details), even though during the actual titration both pH and titrant amount are varying with time. Conceptually, it is more elegant to treat these as variables rather than one as being the output of a function on the other.

This is a partial answer reflecting on a comment of yours under your original post:

So what's confusing me is why we care about what the labels are. I understood that when we write $$f(x)=x^2$$, we're saying something along the lines of "$$f$$ is a function which squares its argument", and that $$x$$ doesn't really 'exist', so to speak, outside of the definition of $$f$$. Since I thought we think of functions as independent objects of what we've called their variables, why don't we have $$f(t)=t^2$$? And why does it matter what we call some $$x$$ outside of the definition of $$f$$?

Source: comment of Deeside

I totally get your viewpoint. You view functions as objects with two traits:

• they have a type, e.g. $$f\colon \mathbb{R} \to \mathbb{R}$$
• they allow function application, e.g. $$f x$$ if $$x \in \mathbb{R}$$

Hence, as there is absolutely no notion of argument names involved, you cannot just say $$\frac{\mathrm{d}f}{\mathrm{d}x}$$. Instead, one should say $$\frac{\mathrm{d}f}{\mathrm{d}1}$$, i.e. that we differentiate wrt. the first argument. Indeed, I've seen some people do this with the notation $$\partial_1 f$$ or $$f_1$$. If the function only has one argument, then we can also introduce the notation $$f'$$ to stand for differentiation wrt. to the obvious and only argument.

However, I am not sure if that simplistic viewpoint of "positional differentiation"1 is helpful, say helpful for formalization of math in computer systems. Mathematicians do use "named differentiation"1 as well, so our formalization tools and their underlying logic should support this.

I am not sure how current libraries of Coq, Isabelle and others handle named differentiation — if at all. Perhaps someone else can comment on this.

Until that, I'd like to present how I currently think of named differentiation in my head: function objects can additionally to the traits above have a bijective map $$\text{positions} \leftrightarrow \text{argument names}$$. E.g. $$f$$ would have the map $$\{1 \leftrightarrow \text{"}x\text{"}\}$$. You could see this as an optional part of function types. Then, the expression $$\frac{\mathrm{d}f}{\mathrm{d}x}$$ is well-typed iff. the type of $$f$$ has such a map and that map contains an entry for $$\text{"}x\text{"}$$.

I also find the other approaches in the other answers I skimmed over interesting. The everything-is-a-variable approach reminds me of probability theory and random variables. There, random varibles are also just defined on-the-fly like $$X := Y + Z$$ and then we just write $$\mathrm{Pr}[X]$$, where the probability is implicitly taken over all "argument dependencies" of $$X$$.

1 I just made up these terms.

$$w$$ represent the amount of wax burn. We could say that $$w$$ is a function of time. The quantity of wax burnt is strictly increasing and continuous.

Suppose, you were walking home when your wife lit the candle.

We could express your distance from home also as a function of time $$x(t)$$. This function is strictly decreasing and continuous.

We could also express $$w$$ as a function of your distance from home!

Then we could discuss the change in the quantity of wax burnt either with respect to a change in $$t,$$ or with respect to a change in $$x.$$

And $$\frac {dw}{dx} = \frac {dw}{dt}\frac {dt}{dx}$$

This is the basis of a set of "related rates" problems.

When we get to multi-variable calculus it becomes more important to keep track what what variables are changing.

If you have a surface $$z(x,y)$$ If we are walking across this surface at any given point we might be walking across the surface in such a way that $$z$$ is not changing, or we might be walking straight up hill. The direction of travel just as important as the rate of travel to measure changes in $$z.$$

And so, we should expect the case that $$\frac {\partial z}{\partial x}$$ is unrelated to $$\frac {\partial z}{\partial y}$$

• I see that when we define $w$, we are thinking of putting time in to it, but I still don't really understand by what we mean by a function of time. When we mathematize our problem, isn't $w$ just a function of a single real variable in our problem, and we can interpret $w$ as wax burnt when we use the time since the candle was lit as our argument? I also still am confused about what we mean by $\frac{dw}{dx}$ and $\frac{dw}{dt}$, since I don't get what we mean by differentiation "with respect to" something. – Deeside Jan 6 at 1:05
• when we say $w$ is a function of time. We are stating that we have created a mathematical model of a physical phenomenon, for which the the variable $t$ will represent the a measure of time. When we differentiate with respect to $t$ we are saying that we expect that $w$ will change as $t$ changes. Yes, the choice of variable name $t$ is arbitrary. We could substitute the variable $m,$ but $m$ would still represent time. Or we could introduce a new concept that is also related to w, and describe w in terms of this new concept. – Doug M Jan 6 at 1:14
• Note that in the equation $\frac{dw}{dx} = \frac{dw}{dt} \frac{dt}{dx}$, the same letter $w$ is being used to refer to two different functions. This is a common abuse of notation, but I think it causes confusion. – littleO Jan 6 at 2:10
• @Deeside Instead of saying "$w$ is a function of time", it would perhaps be more clear if they said, "$w$ is the function that takes a number $t$ as input and returns the amount of wax burnt after $t$ seconds as output." – littleO Jan 6 at 2:15
• @littleO: Please take a look at my answer; we can set up a rigorous formal framework for differentiation in which the chain rule in Leibniz form is 100% correct (if the derivatives exist) with no abuse of notation. It is however true that there is abuse of notation in many existing textbooks. – user21820 Jan 6 at 13:40

I worry that your words and comments suggest you are conflating the system of study, the model of the system of study, and abstractions of the model. The particular ambiguities you describe come from mixing among these categories. Let us parse your wax burning example.

System, model, abstraction, interpretation, and semantics

The System: We have a candle made of wax. It burns. At various times, we measure the cumulative wax burnt. (Perhaps we actually measure some other physical property and infer the cumulative wax burnt from this measurement. This is an experimental detail that does not concern us further.)

The Model: Let $$w$$ be the quantity of cumulative wax burnt, $$t$$ be the time, $$t_0$$ be the time the burning started, and $$t_1$$ be the time the burning stopped. From the nature of burning in the system, $$w$$ is a continuous function of $$t$$. (This is not a mathematical claim. It is syntactically equivalent to "The quantity of cumulative wax burnt is a continuous function of the time", a statement about the physics of burning.) On theoretical grounds, $$w$$ is constantly zero before $$t_0$$, $$w$$ increases at a constant rate with respect to $$t$$ between times $$t_0$$ and $$t_1$$, and $$w$$ is constant for all times $$t_1$$ and later. During the time that $$w$$ increases at a constant rate with respect to $$t$$, we use the positive real parameter $$a$$ to denote the constant rate.

(A critical property of the model is that it attaches symbols to the quantities of interest in the system. Without this, the symbols and inferences appearing in the upcoming abstraction can never be related to the system. Additionally, any symbol used other than $$w$$, $$t$$, $$t_0$$, $$t_1$$, and $$a$$ cannot be attached to the system unless it is defined in terms of those symbols.)

(Notice that the model asserts "$$w(t)$$" will be physically meaningful, since the model asserts that the physical system is a process that converts time into cumulative burnt wax. "$$t(w)$$" will not be physically menaingful, since the physical system is not modeled as a process that converts cumulative burnt wax into time.)

The Abstraction: Let $$T \subset \Bbb{R}$$ be the minimal closed real interval containing the values of $$t$$ in the model and $$W \subset \Bbb{R}$$ be the minimal closed real interval containing the values of $$w$$ in the model. We have $$w:T \rightarrow W$$ defined by $$w(t) = \begin{cases} 0 ,& t \leq t_0 \\ a t ,& t_0 < t < t_1 \\ a t_1 ,& t_1 \leq t \end{cases}$$ with real-valued parameter $$a > 0$$ .

(There are no quantities in the abstraction. There is no time, no wax burnt, nothing about the experiment here. In fact, the abstraction is only attached to the experiment through the model so that the abstraction does not express anything about the system except what can be expressed through the symbolism established in the model.)

Alright, having performed that exercise, how can we find answers to your questions?

The experiment establishes that we will have a relation between the cumulative wax burnt and time. The construction of the experiment is such that for each time of measurement, there will be a single quantity of cumulative wax burnt. Since each time has a single quantity of cumulative wax burnt, we model cumulative wax burnt as a function (contra. relation) of time. In the abstraction, $$w$$ is a map from the real values which can be times to the real values that can be quantities of cumulative wax burnt. This is the sequence of steps that we use to express "cumulative wax burnt as a function of time", "$$w$$ as a function of $$t$$", and then $$w:T \rightarrow W$$. This sequence of steps means that we have an interpretation of expressions "$$w(X)$$" in the system, as long as $$X$$ is an element of $$T$$. If $$X \not\in T$$, "$$w(X)$$" is undefined in the abstraction and has no interpretation in the system.

In the abstraction, we can certainly differentiate $$w(t)$$ with respect to $$t$$ and obtain a piecewise function, $$\frac{\mathrm{d}}{\mathrm{d}t} w(t) : T \smallsetminus \{t_0, t_1\} \rightarrow \{0,a\}$$. But this is not the only thing we can do. In the abstraction, we can differentiate $$w(t^2)$$ with respect to $$t$$ and get $$\frac{\mathrm{d}}{\mathrm{d}t} w(t^2) = \left. \frac{\mathrm{d}}{\mathrm{d}s} w(s) \right|_{s = t^2} \cdot 2t \text{.}$$ In the abstraction, this is only valid for $$t \in T$$ where $$t^2 \in T$$. In the model, this is invalid : $$t^2$$ is not a time, it is a squared time; the model $$w$$ is a function of time, not squared time. So this calculation does not have an interpretation in the system.

So the short version is: in the abstraction, we are free to perform any valid mathematical manipulation we like. Such manipulations either satisfy the semantics established by the model and have an interpretation in the system or do not satisfy the semantics so do not have an interpretation. We can, in fact, write many things at the level of the abstraction, but to have an interpretation in the system, such writings must conform to the model.

Interpreting a function by altering its inputs

There is a particular abuse of this notion in Physics that may be enlightening. I'll establish up front that this example is exactly the opposite of what mathematicians prefer, and I think much of your question lies in the range between these two positions.

Say I have modeled a physical system as a function $$f$$ of position on a plane. For whatever reason, it is convenient to model position on a plane using Cartesian coordinates, with $$x$$ as the horizontal coordinate and $$y$$ as the vertical coordinate, and also using polar coordinates, with $$r$$ as the radial coordinate and $$\theta$$ as the azimuthal coordinate.

Note that the language of the model assigns the same interpretation to $$f(x,y)$$ and $$f(y,x)$$ because $$f$$ is a function of position and we have established that a pair of $$x$$ and $$y$$ (defined to have distinguishable semantics) is a position. If the model associates the same position to one $$x$$ and $$y$$ pair as it does to one $$r$$ and $$\theta$$ pair, then the model also established the same interpretation in the system to all four of $$f(x,y)$$, $$f(y,x)$$, $$f(r,\theta)$$, and $$f(\theta, r)$$. These equivalences are in the model, not the abstraction. But notice that this supplies an unambiguous interpretation to the question "What is the derivative of $$f(x,y)$$ with respect to $$\theta$$?" which interpretation very likely necessitates the answer is not zero.

When we pass from the model to the abstraction, we will fix the order of the arguments to $$f$$ so that $$f(x,y)$$ has an interpretation and $$f(y,x)$$ does not. Likewise we interpret $$f(r,\theta)$$ and not $$f(\theta,r)$$. (But, it is worth noting, we are free to abstractualize the order of arguments in whichever way is more convenient.) Now to the difference between physics and math.

A physicist looks at the two abstraction expressions $$f(x,y)$$ and $$f(r,\theta)$$ and sees the same $$f$$ as a function of position. A mathematician looks at the two abstraction expressions $$f(x,y)$$ and $$f(r,\theta)$$ and sees "the same procedure applied to the ordered pairs $$(x,y)$$ and $$(r,\theta)$$". These are very different interpretations of the same abstraction expressions. As a result, the answer to the question "What is the derivative of $$f(x,y)$$ with respect to $$\theta$$?" differs. For a physicist, one is asking how $$f$$ varies as its input is varied azimuthally near the Cartesian point $$(x,y)$$. For the mathematician, the answer is zero until we augment the model with a relation $$(x,y) \leftrightarrow (r,\theta)$$. (Those parenthetical lists are model positions, not abstraction ordered pairs.) Once that augmentation is in place, the mathematician interprets the question as "What is the derivative of $$f(x(r,\theta),y(r,\theta))$$ with respect to $$\theta$$?", implicitly using the model position to position relation to write Cartesian coordinates as a function of polar coordinates. The mathematician is likely to go one step further and write something like $$\tilde{f}(r,\theta) = f(x(r,\theta),y(r,\theta))$$ to establish in the abstraction an explicit symbolic difference between the model $$f$$ that is a function of Cartesian coordinates and the model $$f$$ that is a function of polar coordinates. Then the question is translated to "What is the derivative of $$\tilde{f}(r,\theta)$$ with respect to $$\theta$$ expressed in terms of $$x$$ and $$y$$?"

I've actually been a little harsh in the above. Both viewpoints can be unified if we do not rush to coordinates. We could represent positions as vectors in a 2-dimensional real vector space in the abstraction, denoted $$\vec{v}$$. Then the only expression to consider is $$f(\vec{v})$$. Augmenting the abstraction by defining at each $$\vec{v}$$ a collection of four tangent vectors in the positive horizontal, positive vertical, positive radial, and positive azimuthal directions, all the apparent ambiguity in the above vanishes. This more accurately models the system, with $$f$$ as a function of position, not as a function of ordered coordinates relative to some basis that is not dictated by the system. (Clearly. Because the model has two sets of coordinate systems.)

Summary

In attaching an abstraction to a system, we assign semantics to particular abstract expressions via a model. We are free to write any abstract expression we want, but such expressions need not have an interpretation relative to the semantics established by the model. The system relation "quantity one is measured with respect to quantity two" can be modeled as "$$c$$ represents quantity one, $$d$$ represents quantity two, and $$c$$ is a function of $$d$$". That model relation is then translated to the abstraction "$$D$$ is a set containing values of $$d$$, $$C$$ is a set containing values of $$c$$, and we have the function $$f:D \rightarrow C:d \mapsto \dots$$". This $$f$$ has the semantics endowed by the model of being a function of quantity two. We may abstractly treat this $$f$$ as a function of any abstract symbol. However, we risk losing an interpretation relative to the system if we do not write $$f$$ as a function of an expression have the interpretation of quantity two. We are abstractly allowed to differentiate this $$f$$ with respect to any expression, but we risk losing an interpretation relative to the system if we do not differentiate with respect to an expression having the interpretation of a quantity two.