[HN Gopher] Legendre transform, better explained (2017)
       ___________________________________________________________________
        
       Legendre transform, better explained (2017)
        
       Author : harperlee
       Score  : 89 points
       Date   : 2024-04-03 11:44 UTC (11 hours ago)
        
 (HTM) web link (blog.jessriedel.com)
 (TXT) w3m dump (blog.jessriedel.com)
        
       | cl3misch wrote:
       | Previous comment thread:
       | https://news.ycombinator.com/item?id=19765389
        
       | metadat wrote:
       | (2017)
        
       | kevindamm wrote:
       | Really enjoyed this post, it is both understandable and
       | revelatory. I had some introduction to the concepts here from
       | calculus and physics classes but my mathematics interests are
       | more along the branches of Abstract Algebra than Analysis so I
       | didn't expect to enjoy it much, and I wonder if I would have hung
       | on for as long if it didn't have the poor exposition first (and
       | the promise of a better presentation).
       | 
       | I wonder if more math-related material was given in this "look
       | how confusing, now wait look at it this way" would be more
       | engaging, overall. Perhaps replacing the first part with a
       | demonstration instead of mocking established representations. But
       | maybe there is something to the "you're not alone, this way of
       | looking at it is confusing and hand-wavy" even if done
       | deliberately, just to give comfort to students making sense of a
       | concept for the first time. Especially with math, I think mamy
       | people would be more eager to learn it if that initial
       | uncomfortable and confusing stage is considered normal for
       | everyone.
       | 
       | Also, side question, is the content of this post considered
       | Tropical Mathematics?
        
       | crdrost wrote:
       | I, too, spent a long time staring at expressions like
       | "half-invert p(x, v) to get v(x, p) s.t.               p(x, v(x,
       | q)) = q              then the Legendre transform is
       | H(x, p) = p v(x, p) - L(x, v(x, p))"
       | 
       | And I did come to one of the same conclusions as this article,
       | which is that if we're talking pure mathematics, these
       | "thermodynamic" expressions like ([?]L/[?]v)_x, ([?]L/[?]p)_x are
       | deeply easy to get confused about and in fact you should just say
       | "the derivative of the function with respect to its first
       | argument holding the other arguments constant" and therefore
       | introduce different functions which compute the same value under
       | different symbols, say                   L(x, p) = L(x, v(x, p))
       | [?]2L = [?]2L [?]2v
       | 
       | so that you're not scratching your head about "why is the
       | derivative of L with respect to _v_ showing up here, v is now a
       | function isn 't it?"
       | 
       | The formulation of first f derivatives as inverse functions is
       | new to me but makes sense.
       | 
       | However, I do think that we do even worse with linear algebra. I
       | believe I could walk up to any college senior in physics and they
       | wouldn't know that "the determinant is the product of the
       | eigenvalues," but this should be as well-known as "the
       | mitochondria are the powerhouse of the cell." I think this is
       | because we introduce a complicated way to calculate determinants
       | and then we use determinants to calculate the eigenvalues?
        
         | prof-dr-ir wrote:
         | Agreed, the way thermodynamics is often taught is such a mess.
         | 
         | My personal and controversial [0] take is that the free energy
         | should really be seen as the Legendre transform of the entropy,
         | not of the energy.
         | 
         | I know it is ultimately semantics, but this viewpoint makes the
         | passage from the micro-canonical to the canonical ensemble so
         | much nicer. In particular, the saddle point approximation for
         | the canonical partition function makes it natural that the
         | ensembles are equivalent in the thermodynamic limit... through
         | a Legendre transform!
         | 
         | Bonus corollary: the statement mentioned in the blog about the
         | derivatives being each other's inverses is just saying that
         | T(E) and E(T) in respectively the micro-canonical and the
         | canonical ensemble define the same relation between E and T.
         | 
         | [0] Proof of controversiality: even Wikipedia disagrees with me
         | here, see
         | https://en.wikipedia.org/wiki/Thermodynamic_free_energy
        
           | shiandow wrote:
           | I'm not even sure if it makes sense to view it as a Legendre
           | transform. Or well, it is one, I'm just not sure if it's a
           | good _definition_.
           | 
           | You get the free energy for 'free' if you use a Lagrange
           | multiplier to maximize entropy while keeping the energy fixed
           | (temperature is the inverse of that Lagrange parameter). In
           | one fell swoop this shows why temperature is a thing and why
           | minimizing the free energy is important.
           | 
           | The Legendre transform just returns the value of the
           | constraint from the minimized function, but at that point why
           | bother?
           | 
           | I do agree that it makes more sense to see the fee energy as
           | a Legendre transform of the entropy, that's kind of what you
           | end up doing if you minimize entropy in this way.
        
         | shiandow wrote:
         | I know programmers like to blame mathematicians for writing
         | functions with lots of one letter variable names, but it's the
         | physicists who insist on doing so without defining any of them.
         | 
         | You want to know what V is? It's clearly the potential, we've
         | defined it six papers ago! Oh you were wondering what it's type
         | was, well it's usually a scalar field. No, don't write the
         | parameter as t that changes the whole meaning!
        
           | Phiwise_ wrote:
           | Sussman has a great guest lecture that mentions exactly these
           | sorts of issues, and that he found it much easier to verify
           | work he and his grad students did in mathematical physics
           | after developing the "mechanics programming" notation he
           | explains in Structure and Interpretarion of Classical
           | Mechanics and Functional Differential Geometry.
        
         | mydogcanpurr wrote:
         | > I think this is because we introduce a complicated way to
         | calculate determinants and then we use determinants to
         | calculate the eigenvalues?
         | 
         | Yes, the determinant should be taught and defined as the volume
         | of the parallelepiped in n-dimensions defined by the columns of
         | the given square matrix. This perspective makes it immediately
         | obvious that the eigenvalues scale the parallelepiped in each
         | of its dimensions (a basis of eigenvectors makes it even
         | simpler). Of course the volume (determinant) must be the
         | product of these scaling factors (eigenvalues)! Since algebra
         | is too convenient for solving problems, this geometric
         | intuition is often an afterthought if it's even taught at all.
        
           | lupire wrote:
           | What trash math classes were you all in that didn't teach all
           | of this?
        
       | ericdfoley wrote:
       | Helliwell & Sahakian Modern Classical Mechanics at least seems to
       | do a much better job of explaining the Legendre transform than
       | Goldstein, but it still never mentions the convexity requirement
       | on f.
       | 
       | I feel like understanding the general convex conjugate and then
       | seeing the Legendre transform as a special case is almost more
       | intuitive.
        
       | ykonstant wrote:
       | Very nice article, kudos to the author. The inverse relation
       | between Jacobians generalizes to a duality statement via the
       | symplectic structure of the configuration space; the section
       | https://en.wikipedia.org/wiki/Hamiltonian_mechanics#From_sym...
       | on Wikipedia has some details. This symplectic duality is my
       | preferred way of looking at Hamiltonian-Lagrangian transitions.
        
       | doppioandante wrote:
       | Wow, I've been looking for a meaningful definition of the
       | Legendre transform for ages, thanks for writing this up
        
       | LolWolf wrote:
       | It's neat! To be fair, as a physicist, I did not understand the
       | Legrendre transform essentially until taking convex optimization
       | (where it is known as the Fenchel conjugate).
       | 
       | Many sources, but all of them are reasonable and give a
       | constructive definition that actually explains what it does: we
       | can characterize a function either by its graph, or its
       | supporting hyperplanes (when it is a closed, convex function).
       | 
       | While the observation is almost silly, it has very deep
       | consequences for different characterizations of problems and
       | other constructions!
        
       | bigbacaloa wrote:
       | I found this explanation quite bad. Poorly motivated and making a
       | priori regularity assumptions that are not necessary. The quoted
       | explanation by Arnold is much better.
        
       | ijustlovemath wrote:
       | The abuse of differentials in explanations like this reminds of
       | this classic and insightful MathOverflow answer:
       | https://math.stackexchange.com/questions/3266639/notation-fo...
        
         | abetusk wrote:
         | Thank you so much for this link. I was having trouble following
         | some of the notation that came up with automatic
         | differentiation and I think this clears it up.
        
         | dang wrote:
         | Thanks! That is enlightening. It made me realize that the
         | confusion I always felt was actually in the notation all along.
         | 
         | That link was discussed here btw:
         | 
         |  _On Leibniz Notation_ -
         | https://news.ycombinator.com/item?id=39064174 - Jan 2024 (95
         | comments)
        
       | SpaceManNabs wrote:
       | How beautiful that this blog post was made years after I was
       | struggling in thermodynamics to understand these transforms. Now
       | if someone could make a post for the Laplace Transform with the
       | audience being people familiar with the fourier transform.
        
       | mgaunard wrote:
       | Not nearly as good as the explanation of the Fourier transform we
       | had the other day.
        
       | lupire wrote:
       | Legendre transform moves a ruler (tangent line) along a convex
       | function, measuring how much "lag" the function accumulated while
       | "accelerating" up to its velocity at a certain moment, relative
       | to having constant velocity for its entire history.
       | 
       | The larger the function's 2nd derivative is, the smaller the
       | transform value is. And vice versa. Since the tranform is written
       | in terms of the original function's derivative, not it's "x
       | value", the derivative of the transform is inversely proportional
       | to the derivative of the function
       | 
       | ?
        
       ___________________________________________________________________
       (page generated 2024-04-03 23:00 UTC)