# Why aren't these partial derivatives interchangeable?

I've ran across something that confuses me regarding multivariable functions and partial derivatives. I'll use an example to illustrate:

We let $$x = f(y,t) = yt^2,$$ and define the operators $$\partial_{t|x}(\cdot) := \left.\frac{\partial (\cdot)}{\partial t}\right|_{x},$$ ($x$ held constant) $$\partial_{t|y}(\cdot) := \left.\frac{\partial (\cdot)}{\partial t}\right|_{y}.$$

Now we investigate whether these operators are interchangeable. Firstly, $$\partial_{t|x}x = 0$$ $$\Rightarrow \partial_{t|y}(\partial_{t|x}x) = 0.$$

Secondly, $$\partial_{t|y}x = \partial_{t|y}f(y,t) = 2yt = 2x/t$$ $$\Rightarrow \partial_{t|x}(\partial_{t|y}x) = -2x/t^2 \neq 0.$$

At this stage I'm confused. Of course, I felt uncomfortable writing out the above, like something was going horribly wrong somewhere, but I can't put my finger on where. So where is the error? Somewhere around the substitution $2yt = 2x/t$? Maybe I'm confusing free/bound variables, or keeping things constant where I'm not allowed to? Perhaps I can't expect the derivatives to be interchangeable at all? In that case, why not?

EDIT: Some people are asking me about my notation. The notation for the operators above (i.e. $\partial_{t|x}$) are just something I invented on the spot for this post, and as mentioned above, the vertical line notation indicates which variable should be kept constant during the differentiation (i.e. the variable right of the line, at the bottom). The latter shouldn't be controversial, should it? Let me illustrate the idea. Imagine some nested functions: $$f(g(x,t), t) = g(x,t)^2 + t^2 = \{g(x,t) = x + t^2\} = x^2 + 2xt^2 + t^4 + t^2$$ Now, if I'm not mistaken, $\frac{\partial f}{\partial t}$ is ambiguous: we can imagine keeping either $g(x,t)$ or $x$ constant when performing this differentiation. I.e. $$\left.\frac{\partial f(g(x,t),t)}{\partial t}\right|_g = 2t$$ and $$\left.\frac{\partial f(g(x,t),t)}{t}\right|_x = 4xt + 4t^3 + 2t.$$ Now, we can use the chain rule to obtain $$\left.\frac{\partial f(g(x,t),t)}{t}\right|_x = \left.\frac{\partial f(g(x,t),t)}{g}\right|_t\left.\frac{\partial g(x,t)}{t}\right|_x + \left.\frac{\partial f(g(x,t),t)}{t}\right|_g = (2g(x,t))(2t) + 2t$$ $$= 4xt + 4t^3 + 2t$$

• I'm confused with your notations. Also I don't get the point of $\partial_{t|x}x$ as it doesn't make much sense. If $x$ is a constant than $y$ is a function of $t$... Are you just trying to do "classic" partial differentiation or is it something different? – user88595 Apr 13 '14 at 11:33
• Please see the edit! – andreasdr Apr 13 '14 at 12:24

Your computations are correct, and derivatives in your sense are not interchangeable.

Your derivatives $\partial_{t|x}$ and $\partial_{t|y}$ are derivations $C^\infty(M) \rightarrow C^\infty(M)$, where $M := \{ (x,y,t) ~|~ x=yt^2 \}$ which is a variety. For example $\partial_{t|x}$ is defined in the following way : since $M \rightarrow \mathbb{R}^2, ~ P \mapsto (t(P),x(P))$ is a chart (at least locally), any function $f \in C^\infty(M)$ can be written $f(P)=g(t,x):=g(t(P),x(P))$ for some $g \in C^\infty(\mathbb{R}^2)$, and $\partial_{t|x}f(P)$ is defined to be $(\partial_t g)(t(P),x(P))$.

Two derivations do not commute in general! What is true is that $\partial_{t|x}$ and $\partial_{x|t}$ do commute (this is Schwarz's theorem).

• Many concepts unfamiliar to me up there, but thanks! :) I will ponder it more, but I think the conclusion of this whole discussion is that the partial derivatives I'm using in some sense deviate from the traditional ones (which don't (need to) specify what is held constant) and don't necessarily commute. – andreasdr Apr 13 '14 at 13:05

If $x=yt^2$, then $\partial_{t|x}$ is not zero. It's true that the symbol "$x$" doesn't appear in the expression "$yt^2$", but $x$ does depend on $t$.

What you wrote is like claiming that if $y=x^2$, then $\frac{d}{dx}\{y\}=0$ but $\frac{d}{dx}\{x^2\}=2x$.

Note that Clairaut's Theorem states that if the second order mixed partials exist and are continuous on an open set, then they are equal (Google it!)

• $\partial_{t|x}(\cdot)$ means "differentiate $(\cdot)$ wrt. $t$, keeping $x$ constant". So $\partial_{t|x}(x)$ means "differentiate $x$ wrt. $t$ keeping $x$ constant. Well, then we're differentiating a constant wrt. $t$, which surely must result in $0$? – andreasdr Apr 13 '14 at 12:35
• @andreasdr: Your notation confuses independent variables and functions. It suggests that $x$ is another independent variable like $y$ and $t$, but it is not. It is a function of $y$ and $t$. This is often written as $x=x(y,t)=yt^2$. My comment still holds. – MPW Apr 13 '14 at 18:17
• $x = yt^2$ could be seen as defining $x$ in terms of $y$ and $t$, or as defining $y$ in terms of $x$ and $t$. In physics (particularly thermodynamics) it is common to have relations between energy, pressure, temperature, volume, entropy, etc. and then have to say "Here we're taking the partial derivative of energy holding pressure constant", "here holding volume constant", etc. – Tim Goodman Apr 13 '14 at 19:09
• @TimGoodman: In each of your examples, you are using the relationship to implicitly define a function. It is a different function in each case, and the set of independent variables is different in each case. "In physics" says it all, I'm afraid--that usually is synonymous with "dropping all rigor and pushing symbols around without regard to legitimate mathematical meaning or justification". – MPW Apr 13 '14 at 19:17
• I agree, it's using a relationship to implicitly define a function. Personally I see nothing wrong with that as long as the reader knows that's what you're doing. – Tim Goodman Apr 13 '14 at 19:52

What you defined is not partial differentiation. It is something else therefore it has no special reason to commute.

You have proved that there is a counter-example therefore your differentiation is not commutative.

For normal partial derivative, there is no need to state which is constant and which is not. $\frac{\partial f(x,t)}{\partial t}$ will differentiate everything which is a function of $t$ and keep the rest as a constant. When you do so, you keep $g(x,t)$ constant but it is a function of $t$ so it should be differentiated with respect to $t$.
That's where your definition differs to the normal one.

As a summary, you have proved that what you defined is not commutative but it is not partial differentiation.

• But doesn't the concept of the chain rule for nested, multivariable functions (which is what my example in the edit above is about) require specifying what is held constant? I see no way of reformulating my use of the chain rule above without it. – andreasdr Apr 13 '14 at 12:55
• In the chain rule it is different as $f$ can be seen as $f(g(x,t),T(x,t))$ where $T(x,t) = t$. So in $\frac{\partial f}{\partial t}$, no need to keep $g$ constant as it a dependent variable of $t$ whereas $x$ is independent of $t$. Therefore $x$ is kept constant but not $g(x,t)$. – user88595 Apr 13 '14 at 13:09
• Oh that's right, the $t$:s should actually be seen as separate variables, i.e. we have the variable sets $(g, T)$ and $(x, t)$, so $\frac{\partial f}{\partial t}$ isn't ambiguous. Thanks! – andreasdr Apr 13 '14 at 13:29
• In physics (particularly thermodynamics) there are lots of times you have to say what's being held constant or not. – Tim Goodman Apr 13 '14 at 19:06
• This is nothing more than a glorified comment, thus the downvote. Please see correct solution above which was posted before yours. – Jeff Faraci Apr 13 '14 at 21:26

Some answers are objecting to the notion of specifying what is being held constant before taking a partial derivative, but in physics (for instance, in thermodynamics) it is quite common to have a relationship between variables, where which ones are constant and which are free to vary depends on the situation. (E.g. constant pressure vs. constant volume) Coming from a physics background, I don't find that objectionable at all.

One way to think about this is that $x = yt^2$ can be a relationship that holds in general, but which means either $x = f(y,t) = yt^2$ or $y = g(x,t) = \frac{x}{t^2}$ (for $t \neq 0$) depending on whether we are dealing with a context where $y$ is fixed or where $x$ is fixed. And when $x$ is fixed, the equation for $x$ is just $x = h(x,t) = x$ (a constant function in $t$).

So then, using your notation, we have:

$\partial_{t|y}(\partial_{t|x}x) = \left.\frac{\partial }{\partial t}\left(\left.\frac{\partial x}{\partial t}\right|_x\right)\right|_{y} = \left.\frac{\partial }{\partial t}\left( \frac{\partial h(x,t)}{\partial t} \right) \right|_y = \left.\frac{\partial }{\partial t}\left( 0 \right) \right|_y = 0$

Likewise:

$\partial_{t|x}(\partial_{t|y}x) = \left.\frac{\partial }{\partial t}\left(\left.\frac{\partial x}{\partial t}\right|_y\right)\right|_{x} = \left.\frac{\partial }{\partial t}\left( \frac{\partial f(y,t)}{\partial t} \right) \right|_x = \left.\frac{\partial }{\partial t}\left( 2 y t \right) \right|_x = \frac{\partial }{\partial t}\left( 2 t g(x,t) \right) = -2 \frac{x}{t^2}$

I wouldn't recommend thinking of your partial derivatives as non-commuting operators acting on the variable $x$. You take partial derivatives of functions, not variables. The reason you get different answers is because $x$ and $y$ represent different functions in one case than in the other.

I'm sure this will attract some feedback about physicists' abuse of mathematics, but the point is that $\left. \frac{\partial A} {\partial x} \right|_y$ used in this way has a well-defined meaning. It means "The partial derivative (with respect to $x$) of the function which gives A in terms of variables $x$ and $y$. So long as your readers know that's what your notation means, I see nothing wrong with using it.

I haven't seen the notation that you're using. Let me use the standard notation. If $x=yt^2$ then $$\frac{\partial x}{\partial t} = 2yt \implies \frac{\partial^2x}{\partial y \, \partial t} = 2t$$ $$\frac{\partial x}{\partial y} = t^2 \implies \frac{\partial^2x}{\partial t \, \partial y} = 2t$$ The partial derivatives commute (the order doesn't matter), and this is always the case for sufficiently well-behaved functions. See here for more information.

• I've added an edit, trying to clear it up! – andreasdr Apr 13 '14 at 12:24