Legendre Transform
Calculates the Legendre transform of a strictly convex quadratic function.
Free theory articleCalculates the Legendre transform of a strictly convex quadratic function.
Concept & interpretation
The Legendre transform is an operation that transforms a strictly convex function into another function, called its convex conjugate or dual function. Instead of representing the original function by its values at specific points, the dual function represents it by its supporting tangent lines.
Experiment
You can interact with the Legendre Transform module to see these calculations in action.
- Set Quadratic coefficient a to
1. - Set Linear coefficient b to
0. - Set Dual slope p to
2. - Set Probe position z to
0. - Observe the results: The Maximizer x* is 2, f*(p) is 2, and the Probe gap is 2, matching our manual calculation. The original graph shows f(x) and its supporting tangent at x=2, and the dual graph shows f*(p).
- Set Quadratic coefficient a to 2, Linear coefficient b to 1, Dual slope p to 3 and Probe position z to 1. The contact is x* = 1, dual value 1 and gap 0.
- Set Quadratic coefficient a to 0.5, Linear coefficient b to -1, Dual slope p to 0 and Probe position z to 0. The contact is x* = 2, dual value 1 and gap 1.
- Keep a = 0.5, set b = -2, p = 4 and z = 0 using the same labelled controls. The maximizer is 12 and the dual value is 36. The original view includes that contact outside the probe's [-4,4] input range.
- Set Quadratic coefficient a to 0. The visible strict-convexity error replaces results. Restore a = 1, set b = 1, p = 1 and z = 0: the maximizer, dual value and gap are all 0. Pan, then choose Reset view; values remain unchanged.