This goes for every problem (either in electromagnetism or fluid dynamics) that has to do with vector fields. Say we have a fluid flowing in a closed circular pipe (or an electromagnetic field, the concept does not matter). If its mixed second partial derivatives are not equivalent, $$ \frac{\partial^2 \mathbf u}{\partial x\,\partial y}\neq\frac{\partial^2 \mathbf u}{\partial y\,\partial x} $$ where $\mathbf u$ is the flow velocity vector, then what does this mean (physical, not mathematical meaning)?

I want an INTUITIVE(physical,not plain mathematics) understanding of what changes for the fluid (or EM field) from the situation in which they where equal. Give your own example if you think that this is the ideal way of explaining the stuff you have in mind.

Note: For those who don't know, elementary mathematics tell us that those second mixed partial derivatives should be equal in most cases, so my question has to do with an exception of this rule (especially in physics where we don't see this kind of behavior everyday).

  • $\begingroup$ Related: physics.stackexchange.com/q/34001/2451 and links therein. $\endgroup$
    – Qmechanic
    Aug 8, 2015 at 17:42
  • 3
    $\begingroup$ KyleKanos' answer is completely correct - it means the quantity has discontinuous second derivative. Without a given physical situation, it is impossible to give a physical explanation of why this happens for a particular quantity. Might be a phase transition, might be a boundary effect, might be an artifact of some idealization, who can tell if you don't give a concrete situation? I don't know what you are asking for. $\endgroup$
    – ACuriousMind
    Aug 13, 2015 at 20:00
  • $\begingroup$ Via his/hers example.I am not saying that the answers given are not correct or entirely correct. Maybe with an example made by the person giving the answer,i will understand more. $\endgroup$ Aug 13, 2015 at 20:01

5 Answers 5


The places in physics where commutation of partial derivatives tends to be important are in the identities of vector calculus. The situations where these identities might seem to break down is when there is some kind of topological winding. Then the partial derivatives commute at almost all points except some small set where they are undefined but still can be given some meaning as a delta function.

For instance consider the vector potential $\mathbf{A}$ and its relation to the magnetic field $$\mathbf{B}=\nabla\times\mathbf{A},$$ $$\nabla\cdot B = (\partial_x\partial_y -\partial_y\partial_x)A_z + (\partial_y\partial_z -\partial_z\partial_y)A_x + (\partial_z\partial_x -\partial_x\partial_z)A_y.$$ If the partial derivatives commute acting on $\mathbf{A}$ then the divergence of $\mathbf{B}$ vanishes, and there is no magnetic charge density. But suppose we want a theory with magnetic monopoles ---the commutation of partial derivatives needs to break down somewhere.

So one possibility might be to take the vector potential to be the continuous function appearing in Kyle Kanos's answer $$A_x=A_y=0$$$$A_z=\frac{xy(x^2-y^2)}{x^2+y^2},$$ Here the partial derivatives commute everywhere except the origin, where you get only a finite difference (not like a delta function). So this is interesting but not physically relevant since the Lebesgue integral of the magnetic charge density over any finite volume is still zero.

Instead the magnetic monopole is described by the vector potential of a Dirac string: $$A_x = \frac{\mp y}{r(r\pm z)}$$ $$A_y = \frac{\pm x}{r(r\pm z)}$$ $$A_z = 0,$$ where the two choices of sign are just related by a gauge transformation. Unlike the previous example this vector potential is not defined at the origin. If you work it out in spherical coordinates you will find that the divergence of the magnetic field is a delta function, so this does indeed describe a non-zero magnetic charge.

The fact that we need more than one gauge equivalent function, and the fact that the functions are not defined at all points are typical of the way the commutation of partial derivatives fails in physics.

Here is another example. Given a function $f(x,y)$ of two variables $$(\nabla\times \nabla f)_z = (\partial_x\partial_y -\partial_y\partial_x) f, $$ and so by Stoke's theorem if the partial derivatives commute the line integral of a gradient vector field around a closed loop is zero.

Now take the function $\phi(x,y)$ which just returns the angle from $0$ to $2\pi$. There is a discontinuity at the positive x-axis where $0$ meets $2\pi$, but the gradient of $\phi$ can still be defined continuously here. We might consider a second function $\phi^\prime$ which instead returns the angle in the range $-\pi$ to $3\pi/4$ shifting the discontinuity to the negative y-axis. This function has the same gradient as $\phi$ and is like the additional gauge equivalent vector potential in the Dirac string example above.

If we look at how to take gradients and curls in cylindrical coordinates $$\nabla\phi = \nabla\phi^\prime = \rho^{-1}\hat{\phi},$$ where $\rho = \sqrt{x^2+y^2}$ and $\hat{\phi}$ is the unit vector in the angular direction. Taking the curl, $$\nabla\times(\nabla\phi)=-\partial_z (\rho^{-1}) \hat{\rho} + \rho^{-1}\partial_\rho (\rho\,\rho^{-1})\hat{z} = 0. $$

But even though the curl appears to be zero, clearly the line integral of either $\phi$ or $\phi^\prime$ around a closed loop containing the origin is $2\pi$, which seems to violate Stoke's theorem. However in any gauge the angle $\phi$ and its gradient are not defined at the origin, and that is where the commutivity of partial derivatives breaks down. Since we know the line integral of any closed loop around the origin is $2\pi$ this means $$(\nabla\times\nabla\phi)_z = (\partial_x\partial_y -\partial_y\partial_x) \phi = 2\pi\delta(x,y).$$

This may seem to be physically irrelevant, but in superfluids the function $\phi$ is the order parameter, and its gradient is the superfluid velocity. The superfluid is only allowed to have non-zero vorticity (curl of the velocity) in the core of a topological defect. In the limit of zero thickness, the topological defect is just like the discontinuity at the origin in the example above.

  • $\begingroup$ In the second function, i did not understand why the divergence of the magnetic field being a delta function leads to a non-zero magnetic monopole. And in the first function, why does the Lebesgue integral has to be non-zero in order for it to describe a magnetic monopole? Sorry, but these are just a bit more advanced for me. $\endgroup$ Aug 20, 2015 at 15:33
  • $\begingroup$ Also, do you have any other example in your mind? Cause i like your intuition building behind this(this is a concrete example that truly gives me further understanding) $\endgroup$ Aug 20, 2015 at 15:49
  • 2
    $\begingroup$ The monopole volume density is nonzero at one point in the first function. But if you integrate it over a volume in order to get either the total magnetic charge contained in the volume or the net magnetic flux through a closed surface (through Gauss's law) it will still be zero, by the properties of Lebesgue integration. If instead it is a delta function, by definition its integral is non-zero even though it is zero everywhere but one point (at which it diverges). I have another example in mind, I'll come back in a bit and edit the answer. $\endgroup$
    – octonion
    Aug 20, 2015 at 17:04
  • $\begingroup$ Great answer. Combines the math with physical intuition! $\endgroup$ Aug 20, 2015 at 20:32

The general requirement you are looking for is that the particular function be of class $C^1$, where

...if all order $p$ partial derivatives evaluated at a point $\mathbf a$: $$\frac{\partial^p}{\partial x_1^{p1}\partial x_1^{p2}\cdots\partial x_n^{pn}}f\left(\mathbf x\right)\vert_{\mathbf x=\mathbf a}$$ exist and are continuous, where $p1,\,p2, ..., pn$, and $p$ are as above, for all $\mathbf a$ in the domain, then $f$ is differentiable to order $p$ throughout the domain and has differentiability class $C^p$.

So $C^1$ functions will generically have a discontinuous second derivative, as requested. Wikipedia gives the following function as an example of on that does not obey the symmetry of the 2nd derivative, $$ f(x,y)=\begin{cases}\frac{xy\left(x^2-y^2\right)}{x^2+y^2}&x,y\neq0 \\ 0&x,y=0\end{cases} $$ Evaluating the mixed derivatives at $(x,y)=(0,0)$ leads to an answer of $\partial_x\partial_yf\vert_{(x,y)=(0,0)}=1$ and $\partial_y\partial_xf\vert_{(x,y)=(0,0)}=-1$.

This Math Overflow post discusses functions that are differentiable everywhere but have discontinuous derivatives, but it seems none of them are really physical models. One answer even states,

As I see it, functions that are differentiable but not $C^1$ plays a little role in physics for the simple and only reason, that they play a little role in mathematics.

So it is possible that multivariate functions that are not $C^2$ may not be found in physics, though if someone has an example, I will appreciate the addition.

  • 1
    $\begingroup$ Thank you for the answer, but is this the only situation where the mixed partial derivatives are not equal? Or is there another situation rather than just if the function is discontinuous? I mean, could be there a PHYSICAL reason for something like this to happen rather than just discontinuity? $\endgroup$ Aug 8, 2015 at 18:35
  • $\begingroup$ The function you list is continuous. You want to find functions whose second partial derivative are not continuous. You have fourth order over second order so that is possible for the second derivative to be discontinuous. If by our function were discontinuous then you wouldn't end have a gradient (first derivative). $\endgroup$
    – Timaeus
    Aug 8, 2015 at 18:48
  • $\begingroup$ @Timaeus: you are correct, I should have said whose derivatives are not continuous. Correcting now. $\endgroup$
    – Kyle Kanos
    Aug 8, 2015 at 18:50
  • $\begingroup$ @timaeus so its the function or its second derivative that is discontinuous? $\endgroup$ Aug 8, 2015 at 19:18
  • 2
    $\begingroup$ Some C1 functions won't even have 2nd derivatives to commute or not commute. The C2 functions are the ones whose second derivatives are continuous (so by Schwartz they commute). You can start with $\vec E=f\hat x$ and you get a charge distribution of $\rho=\partial_xf$ so $\partial_y\rho$ does not equal $\partial_x\partial_y(\hat x\cdot\vec E).$ $\endgroup$
    – Timaeus
    Aug 8, 2015 at 20:27

If you want to be physical, you'd have to have a physical interpretation of the derivatives.

If you've already taken two derivatives you can ask yourself whether it is possible to take the gradient of those second derivatives. If so, then the second derivatives commuted, if not then the second derivatives are weird (if something wasn't weird you could take the gradient).

Note that you have a vector field, but being a vector had nothing to do with. Scalar fields like temperature or pressure can also fail to have second derivatives commute.

Plus, how do you take partial derivatives of vectors in the first place? You take derivatives of the three scalar fields corresponding to the components (with appropriate extra factors if the frame of coordinate vectors changes).

So the second derivatives don't commute when the second derivative is weird. That's pretty vague. But here is an example. If you have an electric field then the first derivative is related to the charge density, so what if you want a charge density whose gradient is discontinuous. Then certain combinations of the second derivatives of the electric field will be discontinuous so some of them will have to be discontinuous themselves.

So if you want a charge density without a second derivative, then then the electric field might not have commuting partial derivatives.

That makes sense. The first derivatives have to exist in some sense (and keep in mind that curls and divergences can exist even if the partials commonly used to make them do not) so that the derivatives of the electric field can equal to the charge distribution. The second derivatives of the electric field might not exist if the charge distribution is discontinuous, but if the charge a gradient then the second derivatives and the gradient is continuous that is good. It is not enough. However if the gradient of the charge distribution is discontinuous then some combination of second derives of the electric field is discontinuous so one of the second derivatives of the electric field must be discontinuous. However that doesn't mean the partials fail to commute, just that they might not commute.

And there are generalizations to partial derivatives (called weak derivatives) that do always commute when they give functions, but sometimes they give distributions instead of functions. And that is just their way of stopping. After all, some times you can't just take a derivative over and over again.

And to people that want to assume that everything is smooth, sometimes that causes time travel to form in a region where time travel was avoidable by not making things smooth, so forcing things to be smooth can change things in about as big a way as is possible.

That said. If you have something without a first, second, or third derivatives ask yourself: is there something with those derivatives that experimentally looks or acts the same or very close to what I have and how would I be so sure I didn't have that instead?

So if there is something with enough derivatives that is close enough to what you have, maybe that is actually what you have. The things to watch out for are whether you are making something that is sensitive to things you can't control, lack of reproducibility isn't a friend of science after all.

Keep in mind that even a lack of a regular first partial derivative of an electric field happens at, say, a surface charge distribution. So you can easily (mathematically) make a charge distribution that is is continuous and even line up the gradients to match on a surface but set it up so the second derivatives are not continuous and where the mixed partials don't agree by just shaping the charge distribution.

But that charge distribution will be one that you can only approximate in the lab. How to avoid having there be ones that do and don't have third derivatives?

Do often you say that you never know for sure what you have, that there is always some approximations. So you say you want a thing that has some derivatives and then consider all the things where it and its first m derivatives are all sufficiently close to what you imagined, then you image using some random thing from that set.

That's similar to the specifications you'd make in your lab notes, that you machine a material to be a certain size with certain error and then maybe you also want the edge to have a certain lack of wiggle to some error and maybe you want that wiggle to not change up to some error. But at some point you stopped measuring and stopped specifying and so you don't know or care what you have. If your regularly reproduce your results then that vagueness of specification didn't matter, if you can't you might find out that you don't just want the size to be within 1mm you also need the edge to not jump around from one slope to another too much, or maybe you need the slope to not change too much, if it matters you'll specify it.

Also keep in mind the distinction between a macroscopic (averaged) electromagnetic field and a microscopic one (that shoots up around every individual atom). Also, a velocity field is an averaged field too, it isn't the velocity of every water molecule in the fluid.

So the lack of commutativity is usually assumed away. Either by switching to weak derivatives, or considering fields that had certain differentiability and then considering the stuff who it and its derivatives are all sufficiently close to the one you had in mind.

Or even just noting that your mathematical function was just a model of the actual setup so details about limits at a point might just be beyond the scope of your model.

For instance, those weak derivatives are actually only sensitive to the average derivative in some finite region, they don't care about a point.


A discontinuity in the flow of water could be a wall, or a clog that water is still getting around, but not flowing directly through. In finite electric current it could be a substance with a different conductivity, notably zero or ∞. In theory, the mixed partial second derivatives would not be generally equal, just on the cusp of a boundary such as these. In practice, if one looks close enough at a so called physical discontinuity, one may find it to be just a very high valued derivative, and not a discontinuity at all, since things tend to blur as one looks very close, and not have any sharp edges. I am not sure if discontinuities actually exist in experimental physics, but we can talk about them theoretically.

  • $\begingroup$ "if one looks close enough at a so called physical discontinuity, one may find it to be just a very high valued derivative, and not a discontinuity at all, since things tend to blur as one looks very close, and not have any sharp edges"..Can you please explain this a bit more please? Keep in mind that i know about discontinuities when something interferes with a flowing water or electric current, although i am searching for something that is not a change in geometry or substance of the path of a flow(electric or fluid).I am seeking for something(subtle) that might give this inequality of the $\endgroup$ Aug 14, 2015 at 12:35
  • $\begingroup$ [Continuing] two mixed partial derivatives without changing the characteristics of the medium that the flow is moving through.(and i do not know if something like this has ever been experimentally observed or theorized yet) $\endgroup$ Aug 14, 2015 at 12:36
  • $\begingroup$ I like where your answer is going,but can you clarify it a bit more please?(or even extend it) $\endgroup$ Aug 14, 2015 at 12:37
  • $\begingroup$ If you take a seemingly sharp edge and look closer and closer, eventually it looks round. Look even closer and eventually it looks flat. This is analogous to a change in media. If you have a copper conductor transition to a gold conductor, looking close enough there will be a small amount of mixing where the probability densities of the two substances overlap, there is no sharp transition. Likewise, at the wall of a pipe, there is a gradual probability increase of where the wall of the pipe may start. It does not merely begin in an infinitesimal distance; $\endgroup$
    – hydroxide
    Aug 14, 2015 at 21:46
  • $\begingroup$ therefore, there is not actually a discontinuity. $\endgroup$
    – hydroxide
    Aug 14, 2015 at 21:47

Singularities in functions often lead to non commuting second derivatives. As for a Physical interpretation I think the following exercise may help:

  1. The partial derivative can be from First Principles can be written as df(x,y)/dx = (f(x+h,y)-f(x,y))/h i.e the function is incremented by h and then the derivative is found. (x,y+h). .(x+h,y+h)

    (x,y). .(x+h,y)

When you take the partial wrt x and then wrt y you move horizontally and then vertically. In the other case you first move vertically and then horizontally.

For nice continuous functions you reach the same place but if the function does not have any singularities and still the derivatives do not commute then that means that you are in a space where (x+y) != (y+x) Such non-commuting spaces can lead to non-commuting derivatives as well.

All derivatives are partial sorry I am still learning latex so sorry for the weird font.


Not the answer you're looking for? Browse other questions tagged or ask your own question.