For each point x on a curve, its tangent line has a slope p and a y-intercept b. The Legendre transform
is just f*(p) = −b: track the y-intercept as the tangent slope sweeps through
every value, and you get a new function of p instead of x. It only works cleanly when f is convex.
At x₀ =-
f(x₀):-
p = f′(x₀) [tangent slope]:-
b [y-intercept]:-
f*(p) = p·x₀ − f(x₀) = −b:-
Exact f*(p), closed form:-
Definition
$$f^*(p) = \sup_{x} \big[\,p\,x - f(x)\,\big]$$
Geometrically: among all lines of slope p, find the one that sits highest below nothing and
touches the curve — i.e. the tangent line with that slope. Its equation is
$y = p x + b$ with $b = f(x_0) - p\,x_0$, so $-b = p\,x_0 - f(x_0) = f^*(p)$. The transform is
literally "negative y-intercept of the tangent, as a function of its slope."
When f is convex, $f'(x)$ is monotonic, so each slope p comes from exactly one x — the sup is
achieved uniquely and $f^*$ is a well-defined, itself-convex function, with $f^{**}=f$.
Why does it break for non-convex f?
Pick the double-well function. Its slope $f'(x)=x^3-x$ rises, then falls, then rises again
as x sweeps left to right — it is not monotonic. That means some slopes p are hit by
three different tangent points, not one.
Sweep x₀ slowly through the middle of the domain and watch the lower panel: the traced point
doesn't move steadily rightward in p, it doubles back on itself, tracing an S-shaped fold. The
tangent-line construction still exists at every x, but "$-b$ as a function of $p$" is no longer a
function at all in that region — it's triple-valued.
The true supremum only keeps the highest of the competing tangent lines, which means
jumping abruptly from one branch of x to another as p crosses a threshold — exactly the
mathematics behind first-order phase transitions (the Maxwell construction / common-tangent rule) in
thermodynamics, where a non-convex free energy has to be replaced by its convex envelope.
f(x) with Tangent Line
f(x)
tangent at x₀
(x₀, f(x₀))
y-intercept (0, b)
Transformed Variable: f*(p) vs. p
f*(p) = −b(x), traced in x₀ order
current x₀
For non-convex f, watch this curve fold back on itself.