# How does Legendre transformation in classical mechanics relate to Adrien-Marie Legendre?

I tried to look for the history of Legendre transformation, which transformed Lagrangian mechanics to Hamiltonian mechanics, usually formulated as

$$\begin{cases} p_i = \frac{\partial L}{\partial v_i} \\ H = \sum_{i=1}^n p_iv_i - L \end{cases}$$ for a given function $$\varphi(x_1,\cdots, x_n)$$.

I want to know how it was first derived in the history since the idea of this transformation is too counterintuitive. However, I realized that there is not even a single literature stating how the mathematician Adrien-Marie Legendre proposed this transformation. In W.R.Hamilton's original paper proposing Hamilton mechanics (and the second essay, where he proposed the Hamilton canonical equations we know nowadays), he did not even mention the name "Legendre" (in contrast, he mentioned Lagrange, Poisson, Laplace several times).

Therefore, what on earth did Legendre do for this transformation? What problem was Legendre trying to solve when he proposed this transformation? Or is it that he did not propose this transformation and people named this transformation after him just by mistake?

"“Au lieu de considérer $$z, p, q$$ comme des fonctions de $$x$$ & $$y$$, rien n’empêche de regarder $$x, y, z$$ comme des fonctions de $$p$$ & $$q$$; [. . . ]” (p. 315). This is the very beginning of what we now call the Legendre transformation. Here it is about a function $$z$$ of two variables x and y with $$p = \partial z/\partial x$$ and $$q = \partial z/\partial y$$. The symmetry or duality between $$z, p, q$$ and $$x, y, z$$ is evident. Later in the article the author considers functions of more than two variables."
"The classical Legendre transformation was introduced purely formally by Legendre. That it is an involution and closely related to duality was, however, as far as I know, first discovered by Monge somewhat later. One shall of course keep the name Legendre transformation... W. H. Young has in a small paper from 1912 proved [his inequality for] a special case of the classical Legendre transformation, which Young, however, did not notice, even though this is clear from his proof. He is only interested in the inequality. The next contribution to the topic is due to Z. W. Birnbaum & W. Orlicz, 1931... Here the “complementary” function $$\widetilde{f}$$ to $$f$$ is defined by $$\widetilde{f}(y)=\sup_{x\in\mathbb{R}}\big(xy-f(x)\big)$$ and it is shown that $$\tilde{\widetilde{f}}=f$$... The inequality (**) is called Young’s inequality by several authors. This is OK, but I cannot see any reason for calling $$f\mapsto\widetilde{f}$$ the Young transformation. If you want to include a personal name, it seems Legendre is the closest at hand, even though it does not create the correct association. The “maximum transformation” I have not seen."