# Why Legendre transform works?

Consider a function $f=f(x,y)$, with $df=u\ dx+v\ dy$, and we want the Legendre transformation $g=f-ux$, with $dg=df-u\ dx-x\ du=\color{red}{u\ dx}+v\ dy\color{red}{-u\ dx}-x\ du=v\ dy-x\ du$ (eliminating the dependence with $x$), then $g=g(u,y)$.

I don't understand why this works, since we have, in principle, that $g=g(x,y,u)=f(x,y)-ux$, but if $g$ doesn't depends on $x$, then $\partial g/\partial x$ must be zero: $$\frac{\partial g}{\partial x}=\color{red}{\frac{\partial f}{\partial x}-u}-\frac{\partial^2 f}{\partial^2 x}x=-\frac{\partial^2 f}{\partial^2 x}x=0$$ (Since $\frac{\partial f}{\partial x}=u$) But why is $-\frac{\partial^2 f}{\partial^2 x}x=0$? Clearly I'm missing something here, I will appreciate your help.

• – Qmechanic Feb 16 '17 at 7:00

The point of the Legendre transform is to switch out independent variables. You can't write $g(x,y,u)$, because $x$ and $u$ aren't independent from one another.

Another way of looking at it is that a partial derivative means taking the derivative with respect to one variable while holding all other independent variables constant. If the variables aren't independent, you're not really taking a partial derivative since you can't hold the other variables constant. Note that this means that a partial derivative with respect to one variable implies a knowledge of all other independent variables.

We must either write $g(x,y)$ or $g(u,y)$. If the former, then

$g(x,y) = f(x,y) - \frac{\partial f}{\partial x} x$

then

$\frac{\partial g}{\partial x} = \frac{\partial f}{\partial x} - \frac{\partial f}{\partial x} - \frac{\partial^2 f}{\partial x^2} x = -\frac{\partial^2 f}{\partial x^2} x$

and it is not zero in general.

And if we write $g(u,y)$, then $\frac{\partial g}{\partial x}$ is meaningless.

• If $u$ and $x$ are not independent, one could write $\frac{\partial g}{\partial x}= \frac{\partial g}{\partial u}\frac{\partial u}{\partial x}$, so this is not a problem? Or otherwise said, $\frac{\partial g}{\partial x}$ still has a sense, hasn't it ? – Frederic Thomas Feb 16 '17 at 7:42
• @FredericThomas If you do that, then $u$ isn't really an independent variable anymore. $x$ is the independent variable, and $u(x)$ is dependent on $x$, so it reduces to $g(u(x),y)=g(x,y)$. It's a bit of a semantical argument, I suppose. – LedHead Feb 16 '17 at 12:44