UC Berkeley Integral Problem: Show that $\int_0^{2\pi} \frac{\min(\sin x, \cos x)}{\max(e^{\sin x},e^{\cos x})}\ {\rm d}x = -4\sinh(1/{\sqrt2})$.

Because the function is periodic, the integral over any interval of length $2 \pi$ leads to the same result. With that said, rewrite this as $$ \int_{\pi/4}^{9 \pi /4} f(x)\,dx = \int_{\pi/4}^{5\pi/4} f(x)\,dx + \int_{5 \pi/4}^{9\pi/4} f(x)\,dx\\ = \int_{\pi/4}^{5 \pi/4} \frac{\cos(x)}{e^{\sin(x)}}\,dx + \int_{\pi/4}^{5 \pi/4} \frac{\sin(x)}{e^{\cos(x)}}\,dx\\ = \int_{\pi/4}^{5 \pi/4} e^{- \sin(x)}\cos(x)\,dx + \int_{\pi/4}^{5 \pi/4} e^{- \cos(x)}\sin(x)\,dx. $$ The integrals can be handled separately, via $u$-substitution.


If we call $f_1(x)=\min(\sin x,\cos x),\,f_2(x)=\max(e^{\sin x},e^{\cos x})$ then we see that: $$f_1(x)=\sin(x) \{0\le x\le \frac{\pi}4,\frac{5\pi}4\le x\le2\pi\}$$ $$f_1(x)=\cos(x)\{\frac{\pi}4\le x\le\frac{5\pi}4\}$$ $$f_2(x)=e^{\cos x}\{0\le x\le\frac{\pi}4,\frac{5\pi}4\le x\le2\pi\}$$ $$f_2(x)=e^{\sin x}\{\frac{\pi}4\le x\le \frac{5\pi}4\}$$ and so: $$\int_0^{2\pi}\frac{\min(\sin x,\cos x)}{\max(e^{\sin x},e^{\cos x})}dx=\int_0^{\pi/4}\frac{\sin(x)}{e^{\cos x}}dx+\int_{\pi/4}^{5\pi/4}\frac{\cos(x)}{e^{\sin x}}dx+\int_{5\pi/4}^{2\pi}\frac{\sin(x)}{e^{\cos x}}dx$$ And this is now easy to solve using simple $u$ substitution