Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Legendre transformation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== ===Example 1=== [[Image:LegendreExample.svg|right|thumb|200px|<math> f(x) = e^x</math> over the domain <math>I=\mathbb{R}</math> is plotted in red and its Legendre transform <math> f^*(x^*) = x^*(\ln(x^*) - 1) </math> over the domain <math>I^* = (0, \infty)</math> in dashed blue. Note that the Legendre transform appears convex.]] Consider the [[exponential function]] <math> f(x) = e^x,</math> which has the domain <math>I=\mathbb{R}</math>. From the definition, the Legendre transform is <math display="block"> f^*(x^*) = \sup_{x\in \mathbb{R}}(x^*x-e^x),\quad x^*\in I^*</math> where <math>I^*</math> remains to be determined. To evaluate the [[Infimum and supremum|supremum]], compute the derivative of <math>x^*x-e^x</math> with respect to <math>x</math> and set equal to zero: <math display="block"> \frac{d}{dx} (x^*x-e^x) = x^*-e^x = 0. </math> The [[Derivative_test#Second-derivative_test_(single_variable)|second derivative]] <math>-e^x</math> is negative everywhere, so the maximal value is achieved at <math>x = \ln(x^*)</math>. Thus, the Legendre transform is <math display="block"> f^*(x^*) = x^*\ln(x^*)-e^{\ln(x^*)} = x^*(\ln(x^*) - 1) </math> and has domain <math>I^* = (0, \infty).</math> This illustrates that the [[domain of a function|domain]]s of a function and its Legendre transform can be different. To find the Legendre transformation of the Legendre transformation of <math> f</math>, <math display="block"> f^{**}(x) = \sup_{x^*\in \mathbb{R}}(xx^*-x^*(\ln(x^*) - 1)),\quad x\in I, </math> where a variable <math> x </math> is intentionally used as the argument of the function <math> f^{**} </math> to show the [[Involution (mathematics)|involution]] property of the Legendre transform as <math> f^{**} = f </math>. we compute <math display="block"> \begin{aligned} 0 &= \frac{d}{dx^*}\big( xx^*-x^*(\ln(x^*) - 1) \big) = x - \ln(x^*) \end{aligned} </math> thus the maximum occurs at <math>x^* = e^x</math> because the second derivative <math> \frac{d^2}{{dx^*}^2}f^{**}(x) = - \frac{1}{x^*} < 0 </math> over the domain of <math> f^{**} </math> as <math>I^* = (0, \infty).</math> As a result, <math> f^{**} </math> is found as <math display="block"> \begin{aligned} f^{**}(x) &= xe^x - e^x(\ln(e^x) - 1) = e^x, \end{aligned} </math> thereby confirming that <math>f = f^{**},</math> as expected. ===Example 2=== Let {{math|1=''f''(''x'') = ''cx''<sup>2</sup>}} defined on {{math|'''R'''}}, where {{math|''c'' > 0}} is a fixed constant. For {{math|''x''*}} fixed, the function of {{mvar|x}}, {{math|1=''x''*''x'' β ''f''(''x'') = ''x''*''x'' β ''cx''<sup>2</sup>}} has the first derivative {{math|''x''* β 2''cx''}} and second derivative {{math|β2''c''}}; there is one stationary point at {{math|1=''x'' = ''x''*/2''c''}}, which is always a maximum. Thus, {{math|1=''I''* = '''R'''}} and <math display="block">f^*(x^*)=\frac{ {x^*}^2}{4c} ~.</math> The first derivatives of {{math|''f''}}, 2{{math|''cx''}}, and of {{math|''f'' *}}, {{math|''x''*/(2''c'')}}, are inverse functions to each other. Clearly, furthermore, <math display="block">f^{**}(x)=\frac{1}{4 (1/4c)}x^2=cx^2~,</math> namely {{math|1=''f'' ** = ''f''}}. ===Example 3=== Let {{math|1=''f''(''x'') = ''x''<sup>2</sup>}} for {{math|1=''x'' β (''I'' = [2, 3])}}. For {{math|''x''*}} fixed, {{math|''x''*''x'' β ''f''(''x'')}} is continuous on {{mvar|I}} [[compact space|compact]], hence it always takes a finite maximum on it; it follows that the domain of the Legendre transform of <math>f</math> is {{math|1=''I''* = '''R'''}}. The stationary point at {{math|1=''x'' = ''x''*/2}} (found by setting that the first derivative of {{math|''x''*''x'' β ''f''(''x'')}} with respect to <math>x</math> equal to zero) is in the domain {{math|[2, 3]}} if and only if {{math|4 β€ ''x''* β€ 6}}. Otherwise the maximum is taken either at {{math|1=''x'' = 2}} or {{math|1=''x'' = 3}} because the second derivative of {{math|''x''*''x'' β ''f''(''x'')}} with respect to <math>x</math> is negative as <math>-2</math>; for a part of the domain <math>x^* < 4</math> the maximum that {{math|''x''*''x'' β ''f''(''x'')}} can take with respect to <math>x \in [2,3]</math> is obtained at <math>x = 2</math> while for <math>x^* > 6</math> it becomes the maximum at <math>x = 3</math>. Thus, it follows that <math display="block">f^*(x^*)=\begin{cases} 2x^*-4, & x^*<4\\ \frac{{x^*}^2}{4}, & 4\leq x^*\leq 6,\\ 3x^*-9, & x^*>6. \end{cases}</math> ===Example 4=== The function {{math|1=''f''(''x'') = ''cx''}} is convex, for every {{mvar|x}} (strict convexity is not required for the Legendre transformation to be well defined). Clearly {{math|1=''x''*''x'' β ''f''(''x'') = (''x''* β ''c'')''x''}} is never [[Bounded function|bounded from above]] as a function of {{mvar|x}}, unless {{math|1=''x''* β ''c'' = 0}}. Hence {{math|''f''*}} is defined on {{math|1=''I''* = {''c''}<nowiki/>}} and {{math|1=''f''*(''c'') = 0}}. ([[#Definition|The definition of the Legendre transform]] requires the existence of the [[Infimum and supremum|supremum]], that requires upper bounds.) One may check involutivity: of course, {{math|''x''*''x'' β ''f''*(''x''*)}} is always bounded as a function of {{math|''x''*β{''c''}<nowiki/>}}, hence {{math|1=''I''** = '''R'''}}. Then, for all {{mvar|x}} one has <math display="block">\sup_{x^*\in\{c\}}(xx^*-f^*(x^*))=xc,</math> and hence {{math|1=''f'' **(''x'') = ''cx'' = ''f''(''x'')}}. === Example 5 === As an example of a convex continuous function that is not everywhere differentiable, consider <math>f(x)= |x|</math>. This gives<math display="block">f^*(x^*) = \sup_{ x }(xx^*-|x|)=\max\left(\sup_{x\ge 0} x(x^*-1), \,\sup_{x\le 0} x(x^*+1) \right),</math>and thus <math>f^*(x^*)=0</math> on its domain <math>I^*=[-1,1]</math>. ===Example 6: several variables=== Let <math display="block">f(x)=\langle x,Ax\rangle+c</math> be defined on {{math|1=''X'' = '''R'''<sup>''n''</sup>}}, where {{mvar|A}} is a real, positive definite matrix. Then {{mvar|f}} is convex, and <math display="block">\langle p,x\rangle-f(x)=\langle p,x \rangle-\langle x,Ax\rangle-c,</math> has gradient {{math|''p'' β 2''Ax''}} and [[Hessian matrix|Hessian]] {{math|β2''A''}}, which is negative; hence the stationary point {{math|1=''x'' = ''A''<sup>β1</sup>''p''/2}} is a maximum. We have {{math|1=''X''* = '''R'''<sup>''n''</sup>}}, and <math display="block">f^*(p)=\frac{1}{4}\langle p,A^{-1}p\rangle-c.</math> ==Behavior of differentials under Legendre transforms== The Legendre transform is linked to [[integration by parts]], {{math|1=''p dx'' = ''d''(''px'') β ''x dp''}}. Let {{math|''f''(''x'',''y'')}} be a function of two independent variables {{mvar|x}} and {{mvar|y}}, with the differential <math display="block">df = \frac{\partial f}{\partial x}\,dx + \frac{\partial f}{\partial y}\,dy = p\,dx + v\,dy.</math> Assume that the function {{mvar|f}} is convex in {{mvar|x}} for all {{mvar|y}}, so that one may perform the Legendre transform on {{mvar|f}} in {{mvar|x}}, with {{mvar|p}} the variable conjugate to {{mvar|x}} (for information, there is a relation <math>\frac{\partial f}{\partial x} |_{\bar{x}} = p</math> where <math>\bar{x}</math> is a point in {{mvar|x}} maximizing or making <math>px - f(x,y)</math> bounded for given {{mvar|p}} and {{mvar|y}}). Since the new independent variable of the transform with respect to {{mvar|f}} is {{mvar|p}}, the differentials {{math|''dx''}} and {{math|''dy''}} in {{mvar|df}} devolve to {{math|''dp''}} and {{math|''dy''}} in the differential of the transform, i.e., we build another function with its differential expressed in terms of the new basis {{math|''dp''}} and {{math|''dy''}}. We thus consider the function {{math|1=''g''(''p'', ''y'') = ''f'' β ''px''}} so that <math display="block">dg = df - p\,dx - x\,dp = -x\,dp + v\,dy</math> <math display="block">x = -\frac{\partial g}{\partial p}</math> <math display="block">v = \frac{\partial g}{\partial y}.</math> The function {{math|β''g''(''p'', ''y'')}} is the Legendre transform of {{math|''f''(''x'', ''y'')}}, where only the independent variable {{mvar|x}} has been supplanted by {{mvar|p}}. This is widely used in [[thermodynamics]], as illustrated below.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)