Legendre Transformation is an involutive transformation on real-valued functions that are convex on a real variable. Specifically, if a real-valued multivariable function is convex on one of its independent real variables, then the Legendre transform with respect to this variable is applicable to the function.
This uses the fact that points and lines are related by some sort of duality, which let's us relate different ideas of physics to each other. Although, we learn it just as a transformation in Classical Mechanics & Thermodynamics, it is really simple and intuitive.
Suppose we have some function y=f(x). We can draw it as some curve on x-y plane. So, all the information of the function is stored in that graph. But as It can be seen below if we just draw all the tangent lines of the graph, we can get the curve itself, i.e., All the information of the curve is stored in it's tangent lines. To be more precise y intercepts of it's tangent lines(but not for all type of functions).
What kind of information is present here? The answer is for any value x on the real number we have a value f(x)=x2. Our goal is to transform f from depending on x to a new function g such that it depends on p. But the catch is: we don't want to loose any information in the process.
This is done through derivative. If we take the derivative of f(x), we get,
p(x)=dxdfβ=2x
0,0
xβ = 0.00
P
(0, 0.00)
So, p gives the slope of the tangent line at every x. In this specific example, for every value of x we get a specific value of p, i.e., there is a 1 to 1 corresondance between x and p. This allows us to to consider another function x(p), i.e.,
x(p)=2pβ
Hence, we have two ways of understanding:
Either p as a function of x.
Or x as a function of p.
We can then plug x as a function of p directly into f, making it now function of p. This gives us:
f(x(p))=4p2β=g(p)
It seems we have suceed in transforming f from a function that depends on x to a new function that depends on p without lossing any information. But sadly it's not that simple.
In this case dy/dx=2(xβd)=p. If we plug it back, we get,
f(p)=4p2β
again! So, whatever value we choose for d, we will get the same end function. The information about d is lost in the procedure we are currently following. The reason it happens is very simple. This happens because we have only been considering the tangent lines of each function which turns out to be the same everywhere just shifted.
0,0
yβ = 4.00
Pβ
Pβ
Blue: fβ(x)=xΒ²
Green: fβ(x)=(xβ4)Β²
Tangents remain parallel at equal heights
Fortunately, there is a closely related quantity that is able to capture the uniqueness of each of these functions and that is the y intercepts of the tangent line which we can see actually do differ depending on the original function. So, taking that into account, we can solve this problem.
Let's say (x,y)=(x,f) is a point on the parabola (y=f(x)=x2). Then, as mentioned slope is df/dx=p and the y intercept is g. This g can be given by,
p=xβ0f+gββΉg=pxβf
This truely captures all the information of the function.
Finally, in general if we have a function f(x), then Legendre Transformation of it is,
g(p)=pβ x(p)βf(x(p))
i.e., a transformation which converts one function into another such that the information remains same and whose parameter is slope of the previous one.
For our two functions f1β(x)=x2 and f2β(x)=(xβd)2. We get,
g1β(p)=4pβ and g2β(p)=4p2β+pd
We have now included information of y intercept too, so each of the original functions of x maps to a unique function of p. Also, beacuse no information has been lost in this, we can also find the Legendre transform of g and get back original functions f's.
We now truly have two ways of expressing the same information. One that depends on x and other on p, providing a beautiful duality between points and lines. This mapping is 1-to-1, i.e., unique.
Now the question is does it works for all functions?, sadly the answer is no!
To motivate the answer let's start with the function f(x)=x3. We do the exact same things, we have done before,
f(x)=x3βΉfβ²(x)=3x2=p(x)βΉx=Β±(3pβ)1/2
Immediately we run into a problem. This is not a function (not bijective). Any value we put for p will gives us two different values of x. This means, there are many airs of points that have same slope. We can see it in the interactive plot below. With the exception of the origin(not Gojo Saturo), we are always able to find two points that have exact same value. In terms of f(x), these values correspond to producing the exact same slope for tangent lines.
0,0
p (slope) = 3.00
xβ
xβ
f(x)=xΒ³ (blue), p(x)=3xΒ² (pink)
Two tangents share the same slope p
This gives us the key thing we need in order to be able to find the legendre transform of a given function. We need all the slopes of tangent lines to be unique and this will happen if the function's derivative is always increasing or decreasing, i.e., monotonically increasing or decreasing. From f's point of view, for f to have legendre transformation, f(x) must be convex, means if we connect any two points on the curve, the line is always on the same side of the curve. To check if any function is convex, we can just find it's second derivative and then if,
fβ²β²(x)β₯0 for all x in the domain
then f(x) is convex. With all of these, we now know what is Legendre Transform and on which functions we can apply it on.
But does it only works on single variable functions?, Well no!, we can apply the idea on multivariable functions too! and also there can be some variables which don't participate in the transformation. Let's see this:
Suppose we have a function f(x1β,x2β,β―,xnβ,u1β,u2β,β―,umβ) then let's say we want to create a function for studying the same system but with p1β,p2β,p3β,β―,pnβ where piβ=βf/βxiβ and keep uiβ's as they are. Then, the Legendre Transform is,
There are many applications of this transformation. But the most iconic ones are in Classical Mechanics and Thermodynamics. As thermodyanics one is much more popular, we will see that one here.
As we know internal energy(U) of s system is a function of state which means that a system undergoes the same change in U when we move it from one equilibrium state to another, irrespetive of which route we take through parameter space. This makes U a very useful quantity. But we know U=U(V,S), i.e., it's function of entropy and volume(keeping particle number constant).
But to be honest S is very hard to control. Rather controlling T and p is much more easy. But then what we do?
To truly undertsand it let's start with U. From 1st law of thermodynamics,
So, for constant volume process of our system, dU=TdS and much more.
But now we want to study a system where the temperature is constant. How are we going to study such systems?.. How are we going to study the energy change?
The answer just find a function which is also energy but one of it's parameters are T. As we know S and T are related and as we just showed they are related by derivative(like p and x in previous examples). This should shout the name of our legendary Legendre Transformation.
So, we will define,
F=UβTS
(We can also use TSβU but then the physical interpretations will not be straight-forward, so we use this convention of using UβTS). This then tells us,
dF=TdSβpdVβTdSβSdT=βSdTβpdV
This implies that the natural variables for F are V and T, i.e., F=F(V,T). Then for a Isothermal process, we have,
dF=βpdVβΉΞF=ββ«V1βV2ββpdV
Hence, a positive change in F represents reversible work done on the system by the surroundings, while a negative change in F means reversible work done on the surrounding by the system.
We can also see as dF=dUβTdS (for constant T) and dWβ₯dUβTdS (equality holds for reversible process). So, we have,
dWβ₯dF
What it means is, adding work to the system increases the system's F(called Helmholtz energy). In a reversible process, dW=dF and the work added to the system goes directly into increasing the Helmholtz energy. If we extract a certain amount of work from system(dW<0), then this will be associated with at least as big a drop in the system's F.
This shows how powerful Legendre Transformation is. Using it we just found something F which is also energy(check the dimension) and not just any energy, It represent a very powerful energy, i.e., free energy. This tells us how much energy we can extract from the system, i.e., how much energy is avaliable for us to extract from the system.
In this way, we can find many more useful things. Maybe in another blog I will discuss them.
If you guys are interested read:
A Student's Guide to Entropy by Lemons
An Introductory Course of Statistical Mechanics by P.B. Pal