Lagrange multiplier applied to the Legendre transform
Since the Legendre transform is a stationary point of a function, Lagrange multipliers should be the natural choice for handling constraints. However, there is a problem due to the fact that we are mostly interested in its functional dependence on the transform parameter, and not on its value.
THE LEGENDRELAGRANGE PROBLEM
Let $f(\overline{x})$ be a function of the real nvector $\overline{x}$ and $g(\overline{p})$ its Legendre transform defined by
$g(\overline{p})=\overline{p}.\overline{x}f(\overline{x})\mathit{\hspace{1em}\hspace{1em}}{p}_{i}={\displaystyle \frac{\partial f}{\partial {x}_{i}}}$  (1) 
The vector $\overline{p}$ is a function of $\overline{x}$, or conversely, $\overline{x}$ is a function of $\overline{p}$, so that $g(\overline{p})$ is a function of $\overline{p}$ alone. The Legendre transform is also alternatively defined as the maximum of the function $\overline{p}.\overline{x}f(\overline{x})$. This maximum is reached for $\overline{x}$ satifying the second set of equations in (1). Suppose now that the components^{} ${x}_{i}$ are not all independent, but are linked by the constraint:
$h(\overline{x})=\mathrm{\hspace{0.33em}0}$  (2) 
This equation defines one of the components, ${x}_{\alpha}$ for example, as a function of all the others. Putting this function into (1) would give us the transform $g(\overline{p})$ as a function of the vector $\overline{p}$ with n1 components. It would be nice if we could instead use a Lagrange multiplier $k$ and compute the maximum of the function
$$\overline{p}.\overline{x}f(\overline{x})+kh(\overline{x})$$ 
with all its n components. But then, how does the constraint (2) on $\overline{x}$ translate^{} to $\overline{p}$? The answer is amazingly simple, as we shall see next.
DIRECT COMPUTATION OF THE TRANSFORM
We are going first to compute the Legendre transform the hard way, without the help of a multiplier, by considering ${x}_{\alpha}$ as a function of the other components:
${p}_{i}={\displaystyle \frac{df}{d{x}_{i}}}={\displaystyle \frac{\partial f}{\partial {x}_{i}}}+{\displaystyle \frac{\partial f}{\partial {x}_{\alpha}}}{\displaystyle \frac{\partial {x}_{\alpha}}{\partial {x}_{i}}}\mathit{\hspace{1em}\hspace{1em}}{\displaystyle \frac{dh}{d{x}_{i}}}={\displaystyle \frac{\partial h}{\partial {x}_{i}}}+{\displaystyle \frac{\partial h}{\partial {x}_{\alpha}}}{\displaystyle \frac{\partial {x}_{\alpha}}{\partial {x}_{i}}}=0\mathit{\hspace{1em}\hspace{1em}}i\ne \alpha $  (3) 
Taking the value of $\frac{\partial {x}_{\alpha}}{\partial {x}_{i}}$ from the second set of equations (3) and putting it into the first set, we get:
${p}_{i}={\displaystyle \frac{\partial f}{\partial {x}_{i}}}\mathrm{\Phi}{\displaystyle \frac{\partial h}{\partial {x}_{i}}}\mathit{\hspace{1em}}\text{with}\mathit{\hspace{1em}}\mathrm{\Phi}={\displaystyle \frac{\frac{\partial f}{\partial {x}_{\alpha}}}{\frac{\partial h}{\partial {x}_{\alpha}}}}\mathit{\hspace{1em}}\text{and}\mathit{\hspace{1em}}i\ne \alpha $  (4) 
From definition (1), the Legendre transform $g$ is therefore:
$g(\overline{p})={\displaystyle \sum _{i\ne \alpha}}{x}_{i}\left({\displaystyle \frac{\partial f}{\partial {x}_{i}}}\mathrm{\Phi}{\displaystyle \frac{\partial h}{\partial {x}_{i}}}\right)f(\overline{x})$  (5) 
BACK TO THE LAGRANGE MULTIPLIER
In the first equation (4), if we set $i=\alpha $ we get ${p}_{\alpha}=0$ and conversely, getting the value of $\mathrm{\Phi}$. So, in (5), we may remove the condition $i\ne \alpha $ and sum over all the n components of $\overline{p}$. The constraint ${p}_{\alpha}=0$ reduces the number of independent components to n1. In fact, we are back to the traditional Lagrange method with the multiplier $\mathrm{\Phi}$ and an additional constraint. We even have the choice between n such constraints. They generate up to n functionally different transforms corresponding to the n possible forms of the function $\overline{x}$, according to which component ${x}_{\alpha}$ we choose to eliminate.
The method extends easily to the case of more than one constraint:
${h}_{1}={h}_{2}=\mathrm{\dots}{h}_{m}=0$. We use m multipliers ${\mathrm{\Phi}}_{1},{\mathrm{\Phi}}_{2}\mathrm{\dots}{\mathrm{\Phi}}_{m}$. They are computed by equating to zero any set of m components from $\overline{p}$.
References

1
http://planetmath.org/encyclopedia/LegendreTransform.htmlFersanz at PM  Legendre Transform
This link is actually broken but, hopefully, should be operative soon.  2 http://en.wikipedia.org/wiki/Legendre_transformationWikipedia  Legendre transformation
Title  Lagrange multiplier applied to the Legendre transform 

Canonical name  LagrangeMultiplierAppliedToTheLegendreTransform 
Date of creation  20130322 18:52:47 
Last modified on  20130322 18:52:47 
Owner  dh2718 (16929) 
Last modified by  dh2718 (16929) 
Numerical id  7 
Author  dh2718 (16929) 
Entry type  Example 
Classification  msc 26B10 