How prove this $\left(\int_{-\pi}^{\pi}f(x)\sin{x}dx\right)^2+\left(\int_{-\pi}^{\pi}f(x)\cos{x}dx\right)^2\le\frac{\pi}{2}\int_{-\pi}^{+\pi}f^2(x)dx$

Note that \begin{align*} \int_{-\pi}^\pi f(x) \sin x \,dx &= \int_0^{\pi/2} (f(x) - f(x - \pi) + f(\pi - x) - f(-x)) \sin x \,dx \\ &= \int_0^{\pi/2} (g(x) + h(x)) \sin x \,dx \end{align*} and similarly \begin{align*} \int_{-\pi}^\pi f(x) \cos x \,dx &= \int_0^{\pi/2} (f(x) - f(x - \pi) - f(\pi - x) + f(-x)) \cos x \,dx \\ &= \int_0^{\pi/2} (g(x) - h(x)) \cos x \,dx \end{align*} where we define $g, h : [0, \pi/2] \to \mathbb{R}$ by $g(x) = f(x) - f(x - \pi)$ and $h(x) = f(\pi - x) - f(-x)$.

Then by Cauchy-Schwarz, \begin{align*} \left(\int_0^{\pi/2} (g(x) + h(x)) \sin x \,dx\right)^2 &\leq \int_0^{\pi/2} \sin^2 x \,dx \int_0^{\pi/2} (g(x) + h(x))^2 \,dx \\ &= \frac{\pi}{4} \int_0^{\pi/2} (g(x) + h(x))^2 \,dx \end{align*} and \begin{align*} \left(\int_0^{\pi/2} (g(x) - h(x)) \cos x \,dx\right)^2 &\leq \int_0^{\pi/2} \cos^2 x \,dx \int_0^{\pi/2} (g(x) - h(x))^2 \,dx \\ &= \frac{\pi}{4} \int_0^{\pi/2} (g(x) - h(x))^2 \,dx \end{align*} hence \begin{align*} \left(\int_{-\pi}^\pi f(x) \sin x \,dx\right)^2 &+ \left(\int_{-\pi}^\pi f(x) \cos x \,dx\right)^2 \\ &\leq \frac{\pi}{4} \int_0^{\pi/2} (g(x) + h(x))^2 \,dx + \frac{\pi}{4} \int_0^{\pi/2} (g(x) - h(x))^2 \,dx\\ &= \frac{\pi}{2} \int_0^{\pi/2} (g(x))^2 + (h(x))^2 \,dx \\ &\leq \frac{\pi}{2} \int_0^{\pi/2} (f(x))^2 + (f(x - \pi))^2 + (f(\pi - x))^2 + (f(-x))^2 \,dx \\ &= \frac{\pi}{2} \int_{-\pi}^\pi (f(x))^2 \,dx \end{align*} as desired, where the last inequality holds because $f$ is nonnegative.


I think so. We can assume that $f$ is $2\pi$-periodic over $\mathbb{R}$. The sum of integrals on the left-hand side is presented in the form $\left|\displaystyle\int\limits_{-\pi}^{\pi}f(x)e^{ix}\,dx\right|^2=|\rho e^{i\alpha}|^2=\rho^2$. But due to $2\pi$-periodicity, $$\rho=\rho e^{i\alpha}e^{-i\alpha}=\displaystyle\int\limits_{-\pi}^{\pi}f(x)e^{i(x-\alpha)}\,dx=\displaystyle\int\limits_{-\pi}^{\pi}f(t+\alpha)e^{it}\,dt.$$ Since $f$ is real-valued, $\rho=\displaystyle\int\limits_{-\pi}^{\pi}f(t+\alpha)\cos t\,dt$. Since $f\geq0$ we have $\rho\leq\displaystyle\int\limits_{-\frac{\pi}{2}}^{\frac{\pi}{2}}f(t+\alpha)\cos t\,dt$. Therefore, $$\rho^2\leq\displaystyle\int\limits_{-\frac{\pi}{2}}^{\frac{\pi}{2}}f^2(t+\alpha)\,dt\displaystyle\int\limits_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\cos^2 t\,dt\leq\frac{\pi}{2}\displaystyle\int\limits_{-\pi}^{\pi}f^2(t+\alpha)\,dt=\frac{\pi}{2}\displaystyle\int\limits_{-\pi}^{\pi}f^2(\tau)\,d\tau.$$