# simple real analysis question on integration

it is trivial that $\int_0^{2\pi} \cos(x)\,dx = 0$. Intuitively, it is clear that for a strictly decreasing positive function $f(x)$, $$\int_0^{2\pi} f(x) \cos(x)\,dx \ge 0$$ but I have no glue how to prove that one. Any hints?

Cheers, Eric

edit: I checked it for power-type functions $(a+t)^{-\alpha}$ numerically.

-
Split the integral into two parts, from 0 to $\pi$ and from $\pi$ to $2\pi$. Then use some estimates for either of them... – Fabian Jan 13 '12 at 10:15
You should use the fact that $|\cos(x)|\le 1$. – Jon Jan 13 '12 at 10:17
@Fabian: I see that the part on $[0, \pi/2]$ dominates that of $[\pi/2, \pi$, this integral is clearly positive. But on $[\pi, 2\pi]$ the integral is negative. How do you see that the sum is postitive? – eric Jan 13 '12 at 10:25
@eric: I did not read your question too carefully. I thought you integrate $\int_0^{2\pi} f(x) \sin(x)$. In fact, if you replace $\cos$ by $\sin$ the statement is true. – Fabian Jan 13 '12 at 16:35

For real numbers $a>b>c>d>0$ consider the function $$f:[0,2\pi]\ni x \mapsto\left\{\begin{array}{ll} \frac{2}{3\pi}\left[a\left(\frac{3\pi}{2}-x\right)+bx\right] & \text{, }x\in\left[0,\frac{3\pi}{2}\right] \\ \frac{2}{\pi}\left[c\left(2\pi-x\right)+d\left(x-\frac{3\pi}{2}\right)\right] & \text{, }x\in\left(\frac{3\pi}{2},2\pi\right] \end{array}\right\} \in\mathbb{R}\text{.}$$ By construction, $f$ is positive and stricly decreasing. Furthermore, it holds $$\int_0^{\frac{3\pi}{2}} f(x) \cos(x)\,\mathrm{d} x =-\frac{(3\pi+2) b-2 a}{3\pi}$$ and $$\int_{\frac{3\pi}{2}}^{2\pi} f(x) \cos(x)\,\mathrm{d} x =\frac{2 d+(\pi-2) c}{\pi}\text{.}$$ Choosing $b>\frac{2 a}{3\pi+2}$ makes the value of the first integral negative.
Clearly, $c$ and $d$ can be chosen such that the value of the second integral becomes arbitrarily small.

Thus, there exists a function violating the original conjecture.

-

This is not true. For $\epsilon>0$ small, consider the function whose graph consists of the straight line segments:

$\ \ \bullet\$from $[0, 1+\epsilon]$ to $[{3\pi\over2}-\epsilon,1]$

$\ \ \bullet\$from $[{3\pi\over2}-\epsilon,1]$ to $[{3\pi\over2},\epsilon]$

and

$\ \ \bullet\$from $[{3\pi\over2},\epsilon]$ to $[2\pi,{\epsilon\over2}]$.

Here, $\int_0^{3\pi/2} f(x)\cos x\,dx\approx -1$ and $\int_{3\pi/2}^{2\pi}f(x)\cos x\,dx\approx 0$.

-
Thank you very much. Indeed, 40-x^2 wors as well. Both have one in common: non-convexity. indeed, when $f$ is additionally $C^2$ and convex, splitting in half in two integrals yields $$\int_0^\pi [f(x)-f(x+\pi)] |\cos(x)|\,dx$$. Notice that, $f'(x)-f'(x+\pi) = \pi f''(\eta)\le 0$ whence $g(x) = [f(x)-f(x+\pi)]$ decreases. Now split again on $[0,\pi/2]$ and estimate $g$ the positive part by the smallest value $g(1/2)$ and the negative part on $[\pi/2,\pi]$ by its largest value: $g(1/2)$. Result: $\int f(x) \cos(x)\,dx \ge 0$. – eric Jan 14 '12 at 9:56
Rem. I saw that convexity point some time after I put the question, but I was not allowed to write an answer. Thank you very much for your help. – eric Jan 14 '12 at 10:04

As the answers by precarious and David Mitra show, your intuited result is false. On the other hand, for a function $f(x)$ that is strictly decreasing and positive on $[0,2\pi)$, it is certainly true that $$\int_0^{2\pi} f(x)\sin(x)\mathrm dx > 0$$ and this can be shown by the method suggested to you by Fabian, viz., \begin{align*} \int_0^{2\pi} f(x)\sin(x)\mathrm dx &= \int_0^{\pi} f(x)\sin(x)\mathrm dx + \int_{\pi}^{2\pi} f(x)\sin(x)\mathrm dx\\ &= \int_0^{\pi} f(x)\sin(x)\mathrm dx - \int_0^{\pi} f(x+\pi)\sin(x)\mathrm dx\\ &= \int_0^{\pi} [f(x) - f(x+\pi)]\sin(x)\mathrm dx\\ &> 0. \end{align*} Perhaps you were thinking sine but absent-mindedly wrote cosine instead?

-

$$\int_0^{2\pi} f(x) \cos x\,{\rm d}x = \left[ f(x)\sin x \right]_{x=0}^{x=2\pi}-\int_0^{2\pi} \sin x\,f'(x)\,{\rm d}x$$

$$\left[ f(x)\sin x \right]_{x=0}^{x=2\pi} = 0$$ $$f'(x) \leq 0$$

So now you have to prove that

$$-\int_0^{2\pi} \sin x\,f'(x)\,{\rm d}x \ge 0$$ or expanded as

$$\int_0^{2\pi} \sin x\,f'(x)\,{\rm d}x = \int_0^{\pi} \sin x\,f'(x)\,{\rm d}x +\int_\pi^{2\pi} \sin x\,f'(x)\,{\rm d}x \leq 0$$

Since $\sin x$ is positive between $x=0\ldots\pi$ and negative otherwise the above can be written as

$$\int_0^{\pi} \sin x\,f'(x)\,{\rm d}x -\int_0^{\pi} \sin x\,f'(x+\pi)\,{\rm d}x \leq 0$$

or

$$\int_0^{\pi} \sin x\,\left(f'(x)-f'(x+\pi)\right)\,{\rm d}x \leq 0$$

Which is true only if $f'(x)-f'(x+\pi)\leq0$ for $x=0\ldots\pi$. If $f(x)$ is decreasing with negative slope then $|f'(\pi)|\leq|f'(0)|$ and thus the above is true.

-
Original function is not supposed to be differentiable. – Norbert Jan 13 '12 at 21:47
I agree that $f(\pi) \leq f(0)$ since $f(x)$ is a decreasing function, but I don't understand why $|f'(\pi)|\leq|f'(0)|$ also holds. Could you explain this? – Dilip Sarwate Jan 13 '12 at 23:10