why the curl of the gradient of a scalar field is zero? geometric interpretation This is probably a very silly question, but am I correct in saying that a vector field has non zero curl at some point when the direction of transformation changes? If so I can think of plenty of two variable scalar fields whose gradient vector field changes direction. Isn't the curl non zero at these points? I'm not asking for purely an algebraic computation.
There is a visualisation on page 2 that I don't understand.
https://ccom.ucsd.edu/~ctiee/notes/grad_n_curl.pdf
Why the need to have the vectors going around in a circle, can't they just wave around? Even as they go around in a circle, you can complete the loop by having a sort of maximum where the vectors have zero magnitude.
 A: What you've encountered is that "the direction changes" is not complete intuition about what curl means -- because indeed there are many "curved" vector fields with zero curl.
A better way to think of the curl is to think of a test particle, moving with the flow, and surrounded by a bunch of other test particles arranged in a circle. As the particles move with the flow, the direction between each particle and the center may change -- and the curl measures the speed of that change averaged over the entire circle. If some parts of the circle drift clockwise and other parts drift counterclockwise, the curl may still add up to zero!
In particular: If the flow line curves to the right, then part of our test circle that are just in front of (or just behind) the center will move clockwise with respect to the center. However, if the strength of neighboring flows vary in the right way (namely, stronger on the inside of the bend), we can get the parts of the cicle that are perpendicular to the flow to drift counterclockwise, and still get zero curl out of it.

As for the demonstration you link to, remember that gradient and curl are both linear. So assume we have some scalar field $f$ such that $\nabla\times\nabla f(x_0)$ is nonzero for some $x_0$. We can then find a $g$ such that $\nabla g(x) = \nabla f(x_0)$ for every $x$ (that is simple linear algebra). Then obviously $\nabla g$ at least has zero curl, so by linearity $\nabla\times \nabla(f-g)$ is the same as $\nabla \times \nabla f$, which we assumed to be nonzero at $x_0$. But we also have $\nabla(f-g)(x_0)=0$, so the gradient of $f-g$ does look like the picture on top of page 2 in your link -- at least close to $x_0$ -- and the argument shows that this shape is impossible for a gradient.
(This is not actually true; you may need to subtract a more complicated gradient to get a nice rotation like that out of an arbitrary vector field).
A: The $i$th component of $\nabla\times\nabla\phi$ is $\sum_{jk}\epsilon_{ijk}\partial_j\partial_k\phi$, which vanishes because one factor is symmetric under $j\leftrightarrow k$ while the other factor is antisymmetric.
