# Conceptual difficulty with the Legendre transformation

I feel like I have a fairly muddled understanding of function transformations, and so I'm hoping someone can clarify things for me a bit. I think this might be in part to do with confusion surrounding when we are thinking about functions as what they are physically, and what they do to their arguments.

For example, let $$x$$ be a Cartesian coordinate, and say $$f(x)$$ is the value of $$f$$ at $$x$$. In physics, I am thinking of $$f$$ as being a thing in its own right, rather than some sort of rule about what to do with the argument $$x$$. For example, we could define another perfectly good coordinate system by $$u = x^3$$, and then I would write $$f(u) = u^{1/3}$$, keeping the symbol $$f$$ despite the fact that the actual expression in $$f(u)$$ is different from $$f(x)$$.

I just don't really understand what function transformations fundamentally are. Consider something like the Legendre transformation, where we might write $$s = \frac{df}{dx}$$. We then say we're looking for a function $$g$$ such that $$g(s) = f(x)$$ (I am interpreting this as meaning $$g(s(x)) = f(x)$$, by the way). For starters, I don't really see why we are calling this function $$g$$. In the interpretation of functions I've given above, provided each point $$x$$ has a unique value of $$f'(x)$$, couldn't we argue that there is a bijection between $$x$$ and $$s$$, and so $$s$$ is just as good of a coordinate as $$x$$. Then, we would just write $$f(x) = f(s)$$, where we $$x$$ and $$s$$ represent the same physical point.

In the stuff I have read, there is usually an argument which says that if we translate $$f$$ along by some fixed value $$x_0$$, then we can have multiple values of $$x$$ which have the same value of $$s$$, and we can't tell which is which, motivating the need to include information about where the tangent line crosses some axis. I don't really understand this argument, but I also can't see why it is necessary. We have 'fixed' $$f$$ at the beginning, and are interested in representing $$f$$ using its derivative with respect to $$x$$ as the coordinate, rather than $$x$$ itself. Why are we suddenly interested in the translated function? And, why isn't it as simple as writing $$f(x) = f(s)$$, where we understand the actually expressions of these functions to be different?

This document I have found suggests that my confusion results from thinking about $$f$$ as a physical quantity, rather than its action on its argument. However, I can't really follow the discussion in the document at the time being, and I don't understand how else we can think of functions in physics.

I feel like there are some things I am missing here, and I am probably not appreciating something key about function transformations in general. Can anyone help out?

At heart, a function transform is just a formal map from functions to other functions, usually invertible. For example, the Fourier transform changes a function of time $$f(t)$$ to a function of frequency $$\tilde{f}(\omega)$$. These aren't literally "the same" function: it makes no sense to write $$f(t) = \tilde{f}(\omega)$$, for instance. (But since the transform is invertible, you can think of it as highlighting different information about the same physical thing. So I suppose whether $$f$$ and $$\tilde{f}$$ are "really" the same function is kind of up to opinion.)
The Legendre transform is additionally confusing because it seems to be unnecessary. You will read, for example, that it changes a function $$f(t)$$ into a function $$g(s)$$, where $$s = df/dt$$. But we could have done that perfectly well with a trivial change of variables. We could solve for $$t$$ in terms of $$s$$, then plug that into the expression for $$f(t)$$, to get $$f(s) = f(t(s))$$. Simple changes of variables like these are not function transforms.
The real point of the Legendre transform is that it takes a function which depends simply on $$t$$, and gives you a new function that depends simply on $$s$$, $$\frac{df}{dt} = s, \quad \frac{dg}{ds} = t.$$ This is "simple" as long as both $$s$$ and $$t$$ are simple quantities you already know about. By contrast, if you just did a trivial change of variables, then $$\frac{df}{ds} = \frac{df}{dt} \frac{dt}{ds} = s \frac{dt}{ds}$$ which is not simple, since $$dt/ds$$ can look terrible.
For example, the Lagrangian depends very simply on $$q$$ and $$\dot{q}$$, e.g. for a 1D problem, $$dL = F \, dq + p \, d\dot{q}$$ where $$F$$ is the generalized force, and $$p$$ is the generalized momentum. The Hamiltonian instead depends very simply on $$q$$ and $$p$$, $$dH = F \, dq + \dot{q} \, dp.$$ The two are related by Legendre transform. Trying to turn $$H$$ into a function of $$q$$ and $$\dot{q}$$, or $$L$$ into a function of $$q$$ and $$p$$, by direct substitution would instead leave a mess.