Putnam 2014, Problem B-2

Suppose that $f$ is a function on the interval $[1, 3]$ such that $-1 \leq f(x) \leq 1$ for all $x$ and $\int_1^3 f(x) \, dx = 0$. How large can $\int_1^3 \frac{f(x)}{x} \, dx$ be?

Solution:
In all solutions, \(f\) is integrable.  
First solution: Let \(g(x) = 1\) for \(1 \leq x \leq 2\) and \(-1\) for \(2 < x \leq 3\), and \(h(x) = g(x) - f(x)\). Then \(\int_1^3 h(x) dx = 0\) and \(h(x) \geq 0\) for \(1 \leq x \leq 2\), \(h(x) \leq 0\) for \(2 < x \leq 3\). Now  
\[
\int_1^3 \frac{f(x)}{x} dx = \int_1^2 \frac{h(x)}{x} dx - \int_2^3 \frac{h(x)}{x} dx \geq \int_1^2 \frac{|h(x)|}{2} dx - \int_2^3 \frac{|h(x)|}{2} dx = 0,
\]  
and \(\int_1^3 \frac{g(x)}{x} dx = 2 \log 2 - \log 3 = \log \frac{4}{3}\). Since \(g(x)\) achieves the upper bound, the answer is \(\log \frac{4}{3}\).  
Reformulation: (by Karl Mahlburg and Karthik Adimurthi) Express \(f\) in the Hadamard basis: \(H_0(x) = \begin{cases} 1 & x \in [1,2), \\ -1 & x \in [2,3], \\ 0 & \text{otherwise}, \end{cases}\) and \(H_{n+1}(x) = H_n(2(x-1) + 1) + H_n(2(x-2) + 1)\). Then \(f(x) = \sum_n c_n H_n(x)\) with \(|c_0| + |c_1| + \dots \leq 1\). Let \(g_n = \int_1^3 \frac{H_n(x)}{x} dx\); the \(g_n\) are strictly decreasing. Thus \(\int_1^3 \frac{f(x)}{x} dx = c_0 g_0 + c_1 g_1 + \dots \leq 1 \cdot g_0 = \log \frac{4}{3}\).  
Second solution: (by Art of Problem Solving, user libra_gold) Define \(F(x) = \int_1^x f(t) dt\) for \(1 \leq x \leq 3\). Then \(F(1) = F(3) = 0\) and \(F(x) \leq \min\{x-1, 3-x\}\). Using integration by parts,  
\[
\int_1^3 \frac{f(x)}{x} dx = \int_1^3 \frac{F(x)}{x^2} dx \leq \int_1^2 \frac{x-1}{x^2} dx + \int_2^3 \frac{3-x}{x^2} dx = \log \frac{4}{3}.
\]