# Is it true that $\left| \int_{-\pi}^\pi f(x) \sin nx dx\right| \leq \frac{f(-\pi)-f(\pi)}{n}$?

Let $f: [-\pi, \pi] \rightarrow \mathbb{R}$ be nonincreasing. Is it true that $$\left| \int_{-\pi}^\pi f(x) \sin (nx) dx \right| \leq \frac{f(-\pi)-f(\pi)}{n}.$$ (Please, without Stieltjes integrals.)

I obtain something similar by using the second mean value theorem for integrals but with right hand side equal $2 \frac{f(-\pi)-f(\pi)}{n}$.

Thanks.

Sorry, I mistaked and this inequality is generally not true.

It holds the following inequality

$$\left| \int_{-\pi}^\pi f(x) \sin (nx) dx \right| \leq 2 \frac{f(-\pi)-f(\pi)}{n}.$$

The proof goes in the followig way. By the second mean value theorem there exists a $c\in [-\pi,\pi]$ such that $$\int_{-\pi}^\pi f(x) \sin nxdx=f(-\pi)\int_{-\pi}^c \sin nx dx+f(\pi) \int_c^\pi \sin nx dx$$ $$=-\frac{f(-\pi)}{n} (\cos nc-\cos n\pi)-\frac{f(\pi)}{n} (\cos n\pi-\cos nc)$$ $$=\frac{f(-\pi)-f(\pi)}{n} (\cos n\pi-\cos nc).$$ Since $|(\cos n\pi-\cos nc)| \leq 2$ we obtain $$\left| \int_{-\pi}^\pi f(x) \sin (nx) dx \right| \leq 2 \frac{f(-\pi)-f(\pi)}{n}.$$

-
Hint one: If $f$ is differentiable, then you can do this by integration by parts. Hint two: You can deduce the general case from the differentiable case. –  David Speyer Dec 5 '11 at 18:20
Thanks for hints. Actually I suppose that I mistaked and inequality holds but with RHS equal $2\frac{f(-\pi)-f(\pi)}{n}$ instead $\frac{f(-\pi)-f(\pi)}{n}$. It follows also with the second mean theorem for integrals. But your hints are interesting. I check that inequality holds when $f$ is of $C^1$, but don't know how to use hints 2. How to approximate $f$ by decreasing functions of class $C^1$ ? –  Richard Dec 5 '11 at 21:20

I apologize; I missed a factor of $2$ in the integration by parts argument. The optimal bound is, indeed, $2 (f(-\pi) -f(\pi))/n$. Take $n=1$ and let $f(x)$ be $1$ for $- \pi \leq x < 0$ and $0 \leq x \leq \pi$. Then $\int f(x) \sin x dx = -2 = 2 (f(-1) - f(1))$.
As Thomas points out below, for all $n$ odd, this same $f$ gives $\int f(x) \sin(nx) dx = 2 (f(-\pi) -f(\pi))/n$.
uhmm -- you are contradicting yourself, or you missed inserting a $2$ at two places, didn't you? If $f= 1$ for $x\le0$ and $f=0$ for $x\gt 0$ then $n=1$, so the inequality is in fact becomes an equality $|\int f(x) \sin(x) dx | = 2(f(-\pi) - f(\pi))$. The same test function shows that you can't do better than $... \le \frac{2}{n}(f(-\pi) - f(\pi))$ in the general case. –  user20266 Dec 6 '11 at 7:30