Legendre Transformations

480 Views Asked by At

I'm taking a calculus of variations course and I need to take the Legendre transforms of a few functions:

$$ f(x)=-log(x) $$ $$ f(x)=\frac{1}{2}ax^2+bx+c $$ $$ f(x_1, x_2)=(x_1^2+x_2^2)+x_1x_2 $$

My professor didn't really explain the mechanics of it. I understand that the transform is

$$ f^*(p)=\sup(px-f(x)) $$

but I am not sure how to actually take the transform. Help would be appreciated.

1

There are 1 best solutions below

0
On

All your examples are smooth, which makes the theory considerably easier.

Let $$f^*(p) = \sup_{x}\{xp-f(x)\}.$$ Let us now fix $p$, and let us denote $x_p$ as the value of $x$ which maximizes $xp - f(x)$. Thus $x_p$ is the critical point of this function, and upon differentiating, we find that we must have $$p - f'(x_p) = 0.$$ Thus for a differentiable function $f$, we must have $p = f'(x_p)$. This relation will be very useful for us.

Let us work with your first example. Then $f(x) = -\log x$ and hence $p = -1/x_p$. Inverting this relation, we have $x_p = -1/p$. This shows that for any given $p$, the Legendre transform is given by $$f^*(p) = x_pp - f(x_p) = -1 + \log\left(-\frac{1}{p}\right) = -1 - \log(-p).$$ Note that the Legendre transform here is defined as a function on $(-\infty,0)$.

I will leave the second example for you, and instead work with the third example, which involves the transform in $2$ dimensions. Likewise, the idea is very similar to the case of a single dimension.

In multi-dimensions, say over $\mathbb{R}^n$, the Legendre transform is defined by $$f^*(\mathbf{p}) = \sup_{\mathbf{x}}\{\mathbf{x}\cdot \mathbf{p}-f(\mathbf{x})\},$$ where $\mathbf{x},\mathbf{p}\in \mathbb{R}^n$. As before, let $\mathbf{x}_p$ be the vector which maximizes the function $\mathbf{x}\cdot \mathbf{p}-f(\mathbf{x})$ for fixed $\mathbf{p}$. Thus the gradient of the function must vanish at $\mathbf{x_p}$, hence $$\mathbf{p} = \nabla f(\mathbf{x_p}).$$ In your third example, we have $f(x_1,x_2) = x_1^2 + x_2^2 + x_1x_2$. Hence the gradient is given by $$\nabla f(x_1,x_2) = \pmatrix{2x_1 + x_2\\2x_2 + x_1},$$ and the value $(x_{1p},x_{2p})$ which maximizes $\mathbf{x}\cdot\mathbf{p}-f(\mathbf{x})$ is hence given by $$\pmatrix{p_1\\p_2} = \pmatrix{2x_{1p} + x_{2p}\\2x_{2p} + x_{1p}}.$$ Inverting the above equation, we get $$\pmatrix{x_{1p}\\x_{2p}} = \frac{1}{3}\pmatrix{2p_1 - p_2\\2p_2 - p_1}.$$ After some algebra, we find that the Legendre transform is given by $$f^*(p_1,p_2) =x_{1p}p_1 + x_{2p}p_2 - f(x_{1p},x_{2p}) = p_1^2 + p_2^2 - p_1p_2.$$