<s>[INST] If $f(x):[1,3]\to [-1,1]$ satisfies $\int_1^3 f(x)dx=0$, then find max value of $\int_1^3 \frac{f(x)}{x}dx$ I managed to graph a very rough sketch, which involves $f(2)=0$ and the crests peaking at $-1$ and $1$ on either side of $x=2$
Now for maximization, assume $f(x)=1$ in $[1,2)$ and $f(x) = -1$ in $(2,3]$
So $$\int_1^2 \frac{f(x)}{x}dx + \int_2^3 \frac{f(x)}{x}dx$$
$$=\ln 2$$
However this isn’t in the options. Where am I going wrong
 [/INST] Let $f(x)$ satisfies the condition. Then using $1-f(x)\ge 0$ and $f(x) +1 \ge 0$,
\begin{align}
\int_1^3 \frac{f(x)}{x} dx &=  \int_1^2 \frac 1x dx - \int_1^2 \frac{1-f(x)}{x} dx -\int_2^3 \frac 1x dx + \int_2^3 \frac{f(x) +1}{x}dx\\
&= \ln \frac 43 - \int_1^2 \frac{1-f(x)}{x} dx + \int_2^3 \frac{f(x) +1}{x}dx.\\
& \le \ln \frac 43 -\frac 12 \int_1^2 (1-f(x))dx + \frac 12 \int_2^3 (f(x) + 1) dx\\
&= \ln \frac 43 + \int_1^3 f(x) dx = \ln \frac 43. 
\end{align}
Thus the maximum is really $\ln (4/3)$.
</s>