# Understanding the Legendre transform

In physics, I've seen the Legendre transform motivated by "changing the variable $$x$$ of a function $$x \mapsto f(x)$$ to the variable $$u = \frac{df}{dx}$$."

I don't quite see what that means and why the Legendre transform is the answer to this heuristic. I'd understand it as follows:

Let $$f: \mathbb{R} \to\mathbb{R}$$ be strictly convex and differentiable. Then for every $$x_0 \in \mathbb{R}$$ the slope $$\frac{df(x_0)}{dx}$$ is unique. We want to find a function $$f^*: f'(\mathbb{R}) \to \mathbb{R}$$ such that $$f(x_0)=f^*(\frac{df(x_0)}{dx})$$ for every $$x_0 \in \mathbb{R}$$. In fact we can view the function $$f^*$$ as a function on a subset of the dual space $$\mathbb{R^*}$$ such that $$f^*(df(x_0))=f(x_0)$$.

However, this doesn't seem to capture the Legendre transform, for example by the above the Legendre transform of the exponential function should be the identity function. How can the physicists heuristic be made precise?