In mathematics, the Legendre transformation (or Legendre transform), named after Adrien-Marie Legendre, is an involutive transformation on real-valued convex functions of one real variable. In physical problems, it is used to convert functions of one quantity (such as velocity, pressure, or temperature) into functions of the conjugate quantity (momentum, volume, and entropy, respectively). In this way, it is commonly used in classical mechanics to derive the Hamiltonian formalism out of the Lagrangian formalism (or vice versa) and in thermodynamics to derive the thermodynamic potentials, as well as in the solution of differential equations of several variables.
For sufficiently smooth functions on the real line, the Legendre transform of a function can be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other. This can be expressed in Euler's derivative notation as
where is an operator of differentiation, represents an argument or input to the associated function, is an inverse function such that ,
or equivalently, as and in Lagrange's notation.
The generalization of the Legendre transformation to affine spaces and non-convex functions is known as the convex conjugate (also called the Legendre–Fenchel transformation), which can be used to construct a function's convex hull.
Let be an interval, and a convex function; then the Legendre transform of is the function defined by
where denotes the supremum over (i.e., in is chosen such that is maximized), and the domain is
The transform is always well-defined when is convex. This definition requires to be bounded from above in in order for the supremum to exist.
The generalization to convex functions on a convex set is straightforward: has domain
and is defined by
where denotes the dot product of and .
The function is called the convex conjugate function of . For historical reasons (rooted in analytic mechanics), the conjugate variable is often denoted , instead of .