You are on page 1of 3

Legendre transform short tutorial

c Nino Cuti
University in Zagreb, Faculty of Science, Physics Department
A This is L TEX version of short text tutorial on Legendre transform from sci.physics.research. A Author is unknown. I only made L TEXversion.

I.

LEGENDRE TRANSFORM

The Legendre transformation is used extensively in mechanics (taking us from Lagrangians to Hamiltonians and back) and thermodynamics (relating energy to Helmholtz and Gibbs free energies, and enthalpy). However, few texts show the geometric meaning behind it, so lets look at that now. Ill go into more detail about the Lagrangian and Hamiltonian in a follow-up post; this post is long enough as it is! Lets imagine that we have a graph of some concave function of one variable (keeping things simple for now), called f (x) for lack of a better term. (By concave I mean that if you pick two points on the function, the straight line connecting them never crosses below the function. The second derivative of f - when it exists - is never negative.) We can dene a new function as follows. Imagine a straight line of slope p which we can place somewhere far below the function, so that this line y = px + b doesnt intersect the given function (this wont always be possible for every slope p). Of course, b in the above equation represents the intercept - the y-value of the point where the line crosses the y-axis. Now, lets move b up, while holding p xed, until the line JUST touches the function. This means the above equation y = px + b and y = f (x) hold simultaneously for the value of x where this happens, which we can call x0 . (Note that we might be touching the function on an entire linear interval, so x0 may not be unique.) This denes a special value for b which well call b0 , again for lack of a better term. It should be clear that b0 will depend on both the function f (x) and the slope p. In fact, we can solve the above equations for b0 very easily, by eliminating y: px0 + b0 = f (x0 ) (for any of the values x0 where f (x) and the line touch) so b0 = f (x0 ) px0 Now, we can repeat this for every value of p which makes

sense. (Dont worry; some examples will be given very soon!) Then we have a map from p to b0 , which is unique under the assuptions outlined above. Given a value of p, we either have no line which doesnt cross the function or we can nd a unique b0 . What does one of these pairs (p, b0 ) tell us about the function? Answer: not very much! All we know for sure is that f (x) doesnt go below the line y = px + b0 , and that it touches this line in at least one point. However, the values (p, b0 ) for every possible value of p tell us a lot about f (x)!! Lets graph all of these values: it denes a new function, which we can call g(p). Our new function g(p) is only dened for the values of p for which the above procedure works. The new function g(p) is called the Legendre transform of the function f (x). Note that it depends on a dierent variable. Time for some examples! The easiest example is a straight line: f (x) = mx + b We cant draw any straight lines which dont cross this unless they have the same slope (non-Euclidean geometries aside!). So we draw a line of slope p = m, and move it up until it touches this line. The Legendre transform of f (x) = mx + b is thus the single point (m, b) or y= b if p = m undef ined othervise

Lets try a slightly harder example: two half-lines meeting at a point. f (x) looks like on the illustration (1) this: f (x) = p1 x + b1 x < x p2 x + b2 x > x (1)

Now the Legendre transform clearly has the points (p1 , b1 ) and (p2 , b2 ) on it, but it also has an innitude of points (p, b) with p1 < p < p2 and b1 > b > b2 . These correspond to all lines which can be drawn tangent to the graph at x = x , while not crossing the function. Its not hard to convince oneself that these points lie on a straight line in (p, b) space! All the lines we can draw tangent at x satisfy f (x ) = px + b Since g(p) = b in this equation, we have a line segment in p-space, with slope x and intercept which would be at f (x ): g(p) = x p + f (x )

y slope p2

to one another!

f(x)

x x* b1

b2 slope p1

Slika 1: Function dened in (1). Legendre transform is shown on (2)

Now, we can take the Legendre transform of g(p) again, and then the transform of that, etc. etc. and conceivably construct an innite series of convoluted transforms of f (x). The remarkable thing is that this series has only two distinct members: the L.T. of g(p) gives back f (x) again. Well, almost... because of the funny minus sign above, we actually get f (x). In physics, the L.T. is usually minus the one we have dened above, so that we keep track of the pairs (p, b), where b is the intercept of the line with slope p. But I didnt want to introduce that before showing the motivation behind it. We thus see a pattern emerging: a single point of the L.T. tells us little of the original function, but the entire L.T. tells us the whole function, as the envelope of tangents to the original function. Its good to stop and think about this for a while. Now, things get interesting when f is dierentiable! Then we can proceed further with the formula for the Legendre transformation, because the lines were drawing will be tangent to the graph of f (x). Instead of choosing p, then moving its line up until it touches the graph of f (x) somewhere, we can pick an x, and take the derivative of f there to nd p corresponding to that x. Thus: p= df dx

In fact, the Legendre transform of f looks as shown on graph (2): This g(p) is just a line segment, with

or (partial derivative, if f has other variables)

b
p=

f x

p1

p2

b1

g(p), with slope - x*

This equation needs a set of instructions to go with it: for a given x0 , we evaluate df /dx at the point x0 . This gives a p corresponding to that x0 . But the same p could be found for other values of x besides x0 , as the linear f (x) examples above show. So the map from x to p is not necessarily 1-1. However, the graph g(p) for all p is enough to know f (x) for all x, so we dont lose any information. Thus the Legendre transform of a dierentiable function looks like g(p) = xp f (x)

b2

where weve inserted the overall minus sign, so g(p) is minus the intercept of the line with slope p which touches the graph of f (x). This formula also should have instructions. We dont pick a value of x and a value of p to nd g, despite the appearance of the equation! Instead, we either: - Pick a value of x = x0 . Find df /dx at x0 , and call it p. This gives one point (p, g(p)) on the graph of the Legendre transform of f (x). Doing this for all values of x will produce the entire graph of g(p). So x is the dependent variable in this case, and p is a function of x. If we dont restrict to dierentiable f s, we might get a whole slew of ps for that x, so it isnt necessarily a

Slika 2: Legendre transform of function (1) shown on graph (1)

endpoints corresponding to the lines in f (x). The middle line segment comes from the point x , where we found a bunch of slopes that touched. This is a general feature of Legendre transformations: points and lines are dual

3 function. or: - Pick a value of p. We must use the move the line up procedure to nd the value(s) of x which go in the above equation. However, we dont really need to nd them: we just read o the intercept of the line when it rst touches f (x). In this case, the appearance of x above is a bit spurious: x can be found given a p, but we might get a whole slew of xs, so this isnt necessarily a function. After g(p) has been constructed, this latter procedure is equivalent to just looking a the graph of g(p) and reading o the value of g(p) for a given value of p, so p is the dependent variable. Hope this makes things less confusing. Now for some fun . . . If we relax the condition that f be a convex function, and allow for concave functions, multivalued graphs, and the like, we can dene Legendre transformations of shapes if were careful. (Just gotta make sure the envelope of tangents denes the shape were looking at; this can be done by inspection more easily than by giving a bunch of scary-looking conditions.) As exercises, try to show that: The Legendre transform of a circle is a hyperbola The L.T. of a parabola is a parabola This last fact is of great importance in nonrelativistic classical mechanics. For relativistic mechanics, we need to see that the L.T.of f (x) = 1 x2 . . . end of post . . . following was added from http: mathworld. wolfram. com Given a function of two variables df = f f dx + dy x y udx + vdy (2) (3)

change the dierentials from dx and dy to du and dy with the transformation g f ux (4)

dg = df udx xdu = udx + vdy udx xdu = vdy xdu then x g u g v y

(5) (6) (7)

(8) (9)

(dened on the interval 1 < x < 1) is g(p) = 1 + p2

following was added from http: en. wikipedia. org In mathematics, two dierentiable functions f and g are said to be Legendre transforms of each other if their rst derivatives are inverse functions of each other: Df = (Dg)
1

(10)

Next time, well see why we take the Legendre transform of the Lagrangian with respect to v = dx/dt, and not with respect to x, to get the Hamiltonian. Well also see why the Lagrangian is a function on the tangent bundle of conguration space, and the Hamiltonian a function on the cotangent bundle.

... f and g are unique up to an additive constant which is usually xed by additional requirement that f (x) + g(y) = xy (11)

Electronic address: nnctc@fizika.org

You might also like