Jump to content

Legendre transformation

From Wikipedia, the free encyclopedia
The functionis defined on the interval.For a given,the differencetakes the maximum at.Thus, the Legendre transformation ofis.

Inmathematics,theLegendre transformation(orLegendre transform), first introduced byAdrien-Marie Legendrein 1787 when studying the minimal surface problem,[1]is aninvolutivetransformationonreal-valued functions that areconvexon 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.

In physical problems, the Legendre transform is used to convert functions of one quantity (such as position, pressure, or temperature) into functions of theconjugate quantity(momentum, volume, and entropy, respectively). In this way, it is commonly used inclassical mechanicsto derive theHamiltonianformalism out of theLagrangianformalism (or vice versa) and inthermodynamicsto derive thethermodynamic potentials,as well as in the solution ofdifferential equationsof several variables.

For sufficiently smooth functions on the real line, the Legendre transformof a functioncan be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other. This can be expressed inEuler's derivative notationas whereis an operator of differentiation,represents an argument or input to the associated function,is an inverse function such that,

or equivalently, asandinLagrange's notation.

The generalization of the Legendre transformation to affine spaces and non-convex functions is known as theconvex conjugate(also called the Legendre–Fenchel transformation), which can be used to construct a function'sconvex hull.

Definition[edit]

Definition in[edit]

Letbe aninterval,andaconvex function;then theLegendre transformofis the functiondefined by wheredenotes thesupremumover,e.g.,inis chosen such thatis maximized at each,oris such thatas a bounded value throughoutexists (e.g., whenis a linear function).

The transform is always well-defined whenisconvex.This definition requiresto bebounded from aboveinin order for the supremum to exist.

Definition in[edit]

The generalization to convex functionson aconvex setis straightforward:has domain and is defined by wheredenotes thedot productofand.

The functionis called theconvex conjugatefunction of.For historical reasons (rooted in analytic mechanics), the conjugate variable is often denoted,instead of.If the convex functionis defined on the whole line and is everywheredifferentiable,then can be interpreted as the negative of the-interceptof thetangent lineto thegraphofthat has slope.

The Legendre transformation is an application of thedualityrelationship between points and lines. The functional relationship specified bycan be represented equally well as a set ofpoints, or as a set of tangent lines specified by their slope and intercept values.

Understanding the Legendre transform in terms of derivatives[edit]

For a differentiable convex functionon the real line with the first derivativeand its inverse,the Legendre transform of,,can be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other, i.e.,and.

To see this, first note that ifas a convex function on the real line is differentiable andis acritical pointof the function of,then the supremum is achieved at(by convexity, see the first figure in this Wikipedia page). Therefore, the Legendre transform ofis.

Then, suppose that the first derivativeis invertible and let the inverse be.Then for each,the pointis the unique critical pointof the function(i.e.,) becauseand the function's first derivative with respect toatis.Hence we havefor each.By differentiating with respect to,we find Sincethis simplifies to.In other words,andare inverses to each other.

In general, ifas the inverse ofthenso integration giveswith a constant

In practical terms, giventhe parametric plot ofversusamounts to the graph ofversus

In some cases (e.g. thermodynamic potentials, below), a non-standard requirement is used, amounting to an alternative definition off*with aminus sign,

Formal Definition in Physics Context[edit]

In analytical mechanics and thermodynamics, Legendre transformation is usually defined as follows: supposeis a function ofthen we have

performing Legendre transformation on this function means that we takeas the independent variable, so that the above expression can be written as

and according to Leibniz's rulethen we have

and takingwe havewhich means

Whenis a function ofvariables,then we can perform the Legendre transformation on each one or several variables: we have

whereThen if we want to perform Legendre transformation on, e.g.then we taketogether withas independent variables, and with Leibniz's rule we have

so for functionwe have

We can also do this transformation for variables.If we do it to all the variables, then we have

where

In analytical mechanics, people perform this transformation on variablesof the Lagrangianto get the Hamiltonian:

and in thermodynamics, people perform this transformation on variables according to the type of thermodynamic system they want. E.g. starting from the cardinal function of state, the internal energy,we have

we can perform Legendre transformation on either or both ofyielding

and each of these three expressions has a physical meaning.

This definition of Legendre transformation is the one originally introduced by Legendre in his work in 1787,[1]and still applied by physicists nowadays. Indeed, this definition can be mathematically rigorous if we treat all the variables and functions defined above, e.g.as differentiable functions defined on an open set ofor on a differentiable manifold, andtheir differentials (which are treated as cotangent vector field in the context of differentiable manifold). And this definition is equivalent to the modern mathematicians' definition as long asis differentiable and convex for the variables

Properties[edit]

  • The Legendre transform of a convex function, of which double derivative values are all positive, is also a convex function of which double derivative values are all positive.
    Proof.Let us show this with a doubly differentiable functionwith all positive double derivative values and with a bijective (invertible) derivative.
    For a fixed,letmaximize or make the functionbounded over.Then the Legendre transformation ofis,thus,by the maximizing or bounding condition.Note thatdepends on.(This can be visually shown in the 1st figure of this page above.)
    Thuswhere,meaning thatis the inverse ofthat is the derivative of(so).
    Note thatis also differentiable with thefollowing derivative (Inverse function rule),Thus, the Legendre transformationis the composition of differentiable functions, hence it is differentiable.
    Applying theproduct ruleand thechain rulewith the found equalityyieldsgivingsois convex with its double derivatives are all positive.
  • The Legendre transformation is aninvolution,i.e.,.
    Proof.By using the above identities as,,and its derivative,Note that this derivation does not require the condition to have all positive values in double derivative of the original function.

Identities[edit]

As shownabove,for a convex function,withmaximizing or makingbounded at eachto define the Legendre transformand with,the following identities hold.

  • ,
  • ,
  • .

Examples[edit]

Example 1[edit]

over the domainis plotted in red and its Legendre transformover the domainin dashed blue. Note that the Legendre transform appears convex.

Consider theexponential functionwhich has the domain.From the definition, the Legendre transform is whereremains to be determined. To evaluate thesupremum,compute the derivative ofwith respect toand set equal to zero: Thesecond derivativeis negative everywhere, so the maximal value is achieved at.Thus, the Legendre transform is and has domainThis illustrates that thedomainsof a function and its Legendre transform can be different.

To find the Legendre transformation of the Legendre transformation of, where a variableis intentionally used as the argument of the functionto show theinvolutionproperty of the Legendre transform as.we compute thus the maximum occurs atbecause the second derivativeover the domain ofasAs a result,is found as thereby confirming thatas expected.

Example 2[edit]

Letf(x) =cx2defined onR,wherec> 0is a fixed constant.

Forx*fixed, the function ofx,x*xf(x) =x*xcx2has the first derivativex* − 2cxand second derivative−2c;there is one stationary point atx=x*/2c,which is always a maximum.

Thus,I* =Rand

The first derivatives off,2cx,and off*,x*/(2c),are inverse functions to each other. Clearly, furthermore, namelyf** =f.

Example 3[edit]

Letf(x) =x2forx∈ (I= [2, 3]).

Forx*fixed,x*xf(x)is continuous onIcompact,hence it always takes a finite maximum on it; it follows that the domain of the Legendre transform ofisI* =R.

The stationary point atx=x*/2(found by setting that the first derivative ofx*xf(x)with respect toequal to zero) is in the domain[2, 3]if and only if4 ≤x* ≤ 6.Otherwise the maximum is taken either atx= 2orx= 3because the second derivative ofx*xf(x)with respect tois negative as;for a part of the domainthe maximum thatx*xf(x)can take with respect tois obtained atwhile forit becomes the maximum at.Thus, it follows that

Example 4[edit]

The functionf(x) =cxis convex, for everyx(strict convexity is not required for the Legendre transformation to be well defined). Clearlyx*xf(x) = (x* −c)xis neverbounded from aboveas a function ofx,unlessx* −c= 0.Hencef*is defined onI* = {c}andf*(c) = 0.(The definition of the Legendre transformrequires the existence of thesupremum,that requires upper bounds.)

One may check involutivity: of course,x*xf*(x*)is always bounded as a function ofx*∈{c},henceI** =R.Then, for allxone has and hencef**(x) =cx=f(x).

Example 5[edit]

As an example of a convex continuous function that is not everywhere differentiable, consider.This givesand thuson its domain.

Example 6: several variables[edit]

Let be defined onX=Rn,whereAis a real, positive definite matrix.

Thenfis convex, and has gradientp− 2AxandHessian−2A,which is negative; hence the stationary pointx=A−1p/2is a maximum.

We haveX* =Rn,and

Behavior of differentials under Legendre transforms[edit]

The Legendre transform is linked tointegration by parts,p dx=d(px) −x dp.

Letf(x,y)be a function of two independent variablesxandy,with the differential

Assume that the functionfis convex inxfor ally,so that one may perform the Legendre transform onfinx,withpthe variable conjugate tox(for information, there is a relationwhereis a point inxmaximizing or makingbounded for givenpandy). Since the new independent variable of the transform with respect tofisp,the differentialsdxanddyindfdevolve todpanddyin the differential of the transform, i.e., we build another function with its differential expressed in terms of the new basisdpanddy.

We thus consider the functiong(p,y) =fpxso that

The functiong(p,y)is the Legendre transform off(x,y),where only the independent variablexhas been supplanted byp.This is widely used inthermodynamics,as illustrated below.

Applications[edit]

Analytical mechanics[edit]

A Legendre transform is used inclassical mechanicsto derive theHamiltonian formulationfrom theLagrangian formulation,and conversely. A typical Lagrangian has the form

whereare coordinates onRn×Rn,Mis a positive definite real matrix, and

For everyqfixed,is a convex function of,whileplays the role of a constant.

Hence the Legendre transform ofas a function ofis the Hamiltonian function,

In a more general setting,are local coordinates on thetangent bundleof a manifold.For eachq,is a convex function of the tangent spaceVq.The Legendre transform gives the Hamiltonianas a function of the coordinates(p,q)of thecotangent bundle;the inner product used to define the Legendre transform is inherited from the pertinent canonicalsymplectic structure.In this abstract setting, the Legendre transformation corresponds to thetautological one-form.[further explanation needed]

Thermodynamics[edit]

The strategy behind the use of Legendre transforms in thermodynamics is to shift from a function that depends on a variable to a new (conjugate) function that depends on a new variable, the conjugate of the original one. The new variable is the partial derivative of the original function with respect to the original variable. The new function is the difference between the original function and the product of the old and new variables. Typically, this transformation is useful because it shifts the dependence of, e.g., the energy from anextensive variableto its conjugate intensive variable, which can often be controlled more easily in a physical experiment.

For example, theinternal energyUis an explicit function of theextensive variablesentropyS,volumeV,andchemical compositionNi(e.g.,) which has a total differential

where.

(Subscripts are not necessary by the definition of partial derivatives but left here for clarifying variables.) Stipulating some common reference state, by using the (non-standard) Legendre transform of the internal energyUwith respect to volumeV,theenthalpyHmay be obtained as the following.

To get the (standard) Legendre transformof the internal energyUwith respect to volumeV,the functionis defined first, then it shall be maximized or bounded byV.To do this, the conditionneeds to be satisfied, sois obtained. This approach is justified becauseUis a linear function with respect toV(so a convex function onV) by the definition ofextensive variables.The non-standard Legendre transform here is obtained by negating the standard version, so.

His definitely astate functionas it is obtained by addingPV(PandVasstate variables) to a state function,so its differential is anexact differential.Because ofand the fact that it must be an exact differential,.

The enthalpy is suitable for description of processes in which the pressure is controlled from the surroundings.

It is likewise possible to shift the dependence of the energy from the extensive variable of entropy,S,to the (often more convenient) intensive variableT,resulting in theHelmholtzandGibbsfree energies.The Helmholtz free energyA,and Gibbs energyG,are obtained by performing Legendre transforms of the internal energy and enthalpy, respectively,

The Helmholtz free energy is often the most useful thermodynamic potential when temperature and volume are controlled from the surroundings, while the Gibbs energy is often the most useful when temperature and pressure are controlled from the surroundings.

Variable capacitor[edit]

As another example fromphysics,consider a parallel conductive platecapacitor,in which the plates can move relative to one another. Such a capacitor would allow transfer of the electric energy which is stored in the capacitor into external mechanical work, done by theforceacting on the plates. One may think of the electric charge as analogous to the "charge" of agasin acylinder,with the resulting mechanicalforceexerted on apiston.

Compute the force on the plates as a function ofx,the distance which separates them. To find the force, compute the potential energy, and then apply the definition of force as the gradient of the potential energy function.

Theelectrostatic potential energystored in a capacitor of thecapacitanceC(x)and a positiveelectric charge+Qor negative charge-Qon each conductive plate is (with using the definition of the capacitance as),

where the dependence on the area of the plates, the dielectric constant of the insulation material between the plates, and the separationxare abstracted away as thecapacitanceC(x).(For a parallel plate capacitor, this is proportional to the area of the plates and inversely proportional to the separation.)

The forceFbetween the plates due to the electric field created by the charge separation is then

If the capacitor is not connected to any electric circuit, then theelectric chargeson the plates remain constant and the voltage varies when the plates move with respect to each other, and the force is the negativegradientof theelectrostaticpotential energy as

whereas the charge is fixed in this configuration.

However, instead, suppose that thevoltagebetween the platesVis maintained constant as the plate moves by connection to abattery,which is a reservoir for electric charges at a constant potential difference. Then the amount ofchargesis a variableinstead of the voltage;andare the Legendre conjugate to each other. To find the force, first compute the non-standard Legendre transformwith respect to(also with using),

This transformation is possible becauseis now a linear function ofso is convex on it. The force now becomes the negative gradient of this Legendre transform, resulting in the same force obtained from the original function,

The two conjugate energiesandhappen to stand opposite to each other (their signs are opposite), only because of thelinearityof thecapacitance—except nowQis no longer a constant. They reflect the two different pathways of storing energy into the capacitor, resulting in, for instance, the same "pull" between a capacitor's plates.

Probability theory[edit]

Inlarge deviations theory,therate functionis defined as the Legendre transformation of the logarithm of themoment generating functionof a random variable. An important application of the rate function is in the calculation of tail probabilities of sums ofi.i.d. random variables,in particular inCramér's theorem.

Ifare i.i.d. random variables, letbe the associatedrandom walkandthe moment generating function of.For,.Hence, byMarkov's inequality,one has forand where.Since the left-hand side is independent of,we may take the infimum of the right-hand side, which leads one to consider the supremum of,i.e., the Legendre transform of,evaluated at.

Microeconomics[edit]

Legendre transformation arises naturally inmicroeconomicsin the process of finding thesupplyS(P)of some product given a fixed pricePon the market knowing thecost functionC(Q),i.e. the cost for the producer to make/mine/etc.Qunits of the given product.

A simple theory explains the shape of the supply curve based solely on the cost function. Let us suppose the market price for a one unit of our product isP.For a company selling this good, the best strategy is to adjust the productionQso that its profit is maximized. We can maximize the profit by differentiating with respect toQand solving

Qoptrepresents the optimal quantityQof goods that the producer is willing to supply, which is indeed the supply itself:

If we consider the maximal profit as a function of price,,we see that it is the Legendre transform of the cost function.

Geometric interpretation[edit]

For astrictly convex function,the Legendre transformation can be interpreted as a mapping between thegraphof the function and the family oftangentsof the graph. (For a function of one variable, the tangents are well-defined at all but at mostcountably manypoints, since a convex function isdifferentiableat all but at most countably many points.)

The equation of a line withslopeand-interceptis given by.For this line to be tangent to the graph of a functionat the pointrequires and

Being the derivative of a strictly convex function, the functionis strictly monotone and thusinjective.The second equation can be solved forallowing elimination offrom the first, and solving for the-interceptof the tangent as a function of its slopewheredenotes the Legendre transform of

Thefamilyof tangent lines of the graph ofparameterized by the slopeis therefore given by or, written implicitly, by the solutions of the equation

The graph of the original function can be reconstructed from this family of lines as theenvelopeof this family by demanding

Eliminatingfrom these two equations gives

Identifyingwithand recognizing the right side of the preceding equation as the Legendre transform ofyield

Legendre transformation in more than one dimension[edit]

For a differentiable real-valued function on anopenconvex subsetUofRnthe Legendre conjugate of the pair(U,f)is defined to be the pair(V,g),whereVis the image ofUunder thegradientmappingDf,andgis the function onVgiven by the formula where

is thescalar productonRn.The multidimensional transform can be interpreted as an encoding of theconvex hullof the function'sepigraphin terms of itssupporting hyperplanes.[2]This can be seen as consequence of the following two observations. On the one hand, the hyperplane tangent to the epigraph ofat some pointhas normal vector.On the other hand, any closed convex setcan be characterized via the set of itssupporting hyperplanesby the equations,whereis thesupport functionof.But the definition of Legendre transform via the maximization matches precisely that of the support function, that is,.We thus conclude that the Legendre transform characterizes the epigraph in the sense that the tangent plane to the epigraph at any pointis given explicitly by

Alternatively, ifXis avector spaceandYis itsdual vector space,then for each pointxofXandyofY,there is a natural identification of thecotangent spacesT*XxwithYandT*YywithX.Iffis a real differentiable function overX,then itsexterior derivative,df,is a section of thecotangent bundleT*Xand as such, we can construct a map fromXtoY.Similarly, ifgis a real differentiable function overY,thendgdefines a map fromYtoX.If both maps happen to be inverses of each other, we say we have a Legendre transform. The notion of thetautological one-formis commonly used in this setting.

When the function is not differentiable, the Legendre transform can still be extended, and is known as theLegendre-Fenchel transformation.In this more general setting, a few properties are lost: for example, the Legendre transform is no longer its own inverse (unless there are extra assumptions, likeconvexity).

Legendre transformation on manifolds[edit]

Letbe asmooth manifold,letandbe avector bundleonand its associatedbundle projection,respectively. Letbe a smooth function. We think ofas aLagrangianby analogy with the classical case where,andfor some positive numberand function.

As usual, thedualofis denote by.The fiber ofoveris denoted,and the restriction oftois denoted by.TheLegendre transformationofis the smooth morphismdefined by,where.Here we use the fact that sinceis a vector space,can be identified with. In other words,is the covector that sendsto the directional derivative.

To describe the Legendre transformation locally, letbe a coordinate chart over whichis trivial. Picking a trivialization ofover,we obtain chartsand.In terms of these charts, we have,wherefor all.If, as in the classical case, the restriction ofto each fiberis strictly convex and bounded below by a positive definite quadratic form minus a constant, then the Legendre transformis a diffeomorphism.[3]Suppose thatis a diffeomorphism and letbe the "Hamiltonian"function defined bywhere.Using the natural isomorphism,we may view the Legendre transformation ofas a map.Then we have[3]

Further properties[edit]

Scaling properties[edit]

The Legendre transformation has the following scaling properties: Fora> 0,

It follows that if a function ishomogeneous of degreerthen its image under the Legendre transformation is a homogeneous function of degrees,where1/r+ 1/s= 1.(Sincef(x) =xr/r,withr> 1,impliesf*(p) =ps/s.) Thus, the only monomial whose degree is invariant under Legendre transform is the quadratic.

Behavior under translation[edit]

Behavior under inversion[edit]

Behavior under linear transformations[edit]

LetA:RnRmbe alinear transformation.For any convex functionfonRn,one has whereA*is theadjoint operatorofAdefined by andAfis thepush-forwardoffalongA

A closed convex functionfis symmetric with respect to a given setGoforthogonal linear transformations, if and only iff*is symmetric with respect toG.

Infimal convolution[edit]

Theinfimal convolutionof two functionsfandgis defined as

Letf1,...,fmbe proper convex functions onRn.Then

Fenchel's inequality[edit]

For any functionfand its convex conjugatef*Fenchel's inequality(also known as theFenchel–Young inequality) holds for everyxXandpX*,i.e.,independentx,ppairs,

See also[edit]

References[edit]

  1. ^abLegendre, Adrien-Marie (1789).Mémoire sur l'intégration de quelques équations aux différences partielles. In Histoire de l'Académie royale des sciences, avec les mémoires de mathématique et de physique(in French). Paris: Imprimerie royale. pp. 309–351.
  2. ^"Legendre Transform | Nick Alger // Maps, art, etc".Archived fromthe originalon 2015-03-12.Retrieved2011-01-26.
  3. ^abAna Cannas da Silva.Lectures on Symplectic Geometry,Corrected 2nd printing. Springer-Verlag, 2008. pp. 147-148.ISBN978-3-540-42195-5.

Further reading[edit]

External links[edit]