Putnam 2012, Problem B-5

Prove that, for any two bounded functions $g_1, g_2 : \mathbb{R} \to [1, \infty)$, there exist functions $h_1, h_2 : \mathbb{R} \to \mathbb{R}$ such that, for every $x \in \mathbb{R}$,  
$$\sup_{s \in \mathbb{R}} \left( g_1(s)^x g_2(s) \right) = \max_{t \in \mathbb{R}} \left( x h_1(t) + h_2(t) \right).$$

Solution:
Define the function
$$f(x) = \sup_{s \in \mathbb{R}} \{x \log g_1(s) + \log g_2(s)\}.$$

As a function of $x$, $f$ is the supremum of a collection of affine functions, so it is convex. The function $e^{f(x)}$ is then also convex, as may be checked directly from the definition: for $x_1, x_2 \in \mathbb{R}$ and $t \in [0,1]$, by the weighted AM-GM inequality
$$t e^{f(x_1)} + (1-t) e^{f(x_2)} \geq e^{tf(x_1) + (1-t)f(x_2)}$$
$$\geq e^{f(tx_1 + (1-t)x_2)}.$$

For each $t \in \mathbb{R}$, draw a supporting line to the graph of $e^{f(x)}$ at $x = t$; it has the form $y = xh_1(t) + h_2(t)$ for some $h_1(t), h_2(t) \in \mathbb{R}$. For all $x$, we then have
$$\sup_{s \in \mathbb{R}} \{g_1(s)^x g_2(s)\} \geq xh_1(t) + h_2(t)$$
with equality for $x = t$. This proves the desired equality (including the fact that the maximum on the right side is achieved).

**Remark.** This problem demonstrates an example of duality for convex functions.