The following is a Putnam math competition problem:
Let $f:[1,3] \rightarrow \mathbb{R}$ such that $-1 \leq f(x) \leq 1 $ for all x and $ \int_{1}^{3}f(x)dx = 0 $. What is the max value of $\int_{1}^{3} \frac{f(x)}{x}dx$ ?
What I did:
$$\int_{1}^{3} \frac{f(x)}{x}dx \leq \int_{1}^{3} \frac1x dx = \log(3) $$
if we define $g(x) = f(x) + 1$ then $0\leq g(x) \leq 2$ and:
$$\int_{1}^{3}g(x)dx = 2$$ $$\int_{1}^{3}\frac{f(x)}xdx = \int_{1}^{3} \frac{g(x)-1}{x}dx = \frac{\int_{1}^{3}g(x)dx}{c} - \log(3)$$
with $c \in (1,3)$ so the max value is on the interval $[\frac23 - \log(3), \log(3)]$
I thought about using $g_n(x) = f(x) + x^{n}$ and try to make a better lower bound, but I don't think this will help much to find the exact maximum value
Intuitively speaking, you are putting "mass" along the line $[1,3]$ such that the total mass is zero, and the density at any point must only be between $1$ and $-1$. Since you are trying to maximize the value of $\int_1^3 f(x) / x \; dx$, mass closer to $1$ is weighted higher and mass closer to $3$ is weighted lower. So you should put as much mass as possible close to $1$, which means the optimal function will be $1$ on the interval $[1,2]$ and $-1$ on the interval $[2,3]$.
Rigorous argument: Based on the above intuition, let $$ g(x) := \begin{cases} 1 & \text{if } 1 \le x \le 2 \\ -1 & \text{if } 2 \le x \le 3 \end{cases} $$ We wish to show that for any $f : [1,3] \to [-1,1]$ with integral $0$, $\int_1^3 f(x) / x \; dx \le \int_1^3 g(x) / x \; dx$. To prove this, take the difference : \begin{align*} \int_1^3 \frac{g(x)}{x} \; dx - \int_1^3 \frac{f(x)}{x} \; dx &= \int_1^3 \frac{g(x) - f(x)}{x} \; dx \\ &= \int_1^2 \frac{g(x) - f(x)}{x} \; dx + \int_2^3 \frac{g(x) - f(x)}{x} \; dx \\ &= \int_1^2 \frac{1 - f(x)}{x} \; dx + \int_2^3 \frac{-1 - f(x)}{x} \; dx \\ &= \int_1^2 \frac{1 - f(x)}{x} \; dx - \int_2^3 \frac{1 + f(x)}{x} \; dx \\ &\ge \int_1^2 \frac{1 - f(x)}{2} \; dx - \int_2^3 \frac{1 + f(x)}{2} \; dx \text{ (both integrands were positive)}\\ &= \frac12\left[1 - \int_1^2 f(x) \; dx \right] - \frac12 \left[1 + \int_2^3 f(x) \; dx \right] \\ &= 0 - \int_1^3 f(x) \; dx \\ &= 0. \end{align*}