Let $ f $ be a continuous function defined on $ [0,\pi] $. Suppose that

$$ \int_{0}^{\pi}f(x)\sin {x} dx=0, \int_{0}^{\pi}f(x)\cos {x} dx=0 $$

Prove that $ f(x) $ has at least two real roots in $ (0,\pi) $

  • $\begingroup$ I have the feeling that the Fourier expansion $f(x) = a_0 + \sum_{n\geq 1} (a_n \sin 2n x + b_n \cos 2n x)$ might help, but can't see how exactly. $\endgroup$
    – Lior B-S
    Nov 29, 2012 at 17:20
  • $\begingroup$ @LiorB-S Since $f$ is "just@ continuous you can't be sure that Fourier series of $f$ converges to $f$. $\endgroup$
    – Norbert
    Nov 29, 2012 at 17:27
  • $\begingroup$ @Norbert: You are right, but I have no proof for smooth $f$'s either. Moreover it would be nice, I think, to have if a proof using Fourier expansion exists... $\endgroup$
    – Lior B-S
    Nov 29, 2012 at 17:32
  • 3
    $\begingroup$ It's worth remarking that the function $f(x)=\sin(3x)$ satisfies the conditions and has exactly 2 roots in $(0,\pi)$, so 2 is the best possible integer in this problem. $\endgroup$ Nov 29, 2012 at 21:04

5 Answers 5


Here is one root: Let $F(x) = \int_{0}^x f(t) \sin t dt$. Then $F(0)=0$ and $F(\pi)=\int_{0}^\pi f(t)\sin tdt=0$. So by the intermediate value theorem, there exists $0<c<\pi$ such that $$ 0=F'(c) = f(c)\sin c. $$
But since $\sin c\neq 0$, we get that $f(c)=0$.


If f has only one real root on $ (0,\pi)$, say $ a \in (0,\pi) $, then define $ g(x) = f(x) \sin(x-a) = f(x) (\sin(x)\cos(a) - \cos(x)\sin(a))$, then $ g(x) $ is either non-positive or non-negative, not identically zero, and has integral $ 0 $. Contradiction.

  • 2
    $\begingroup$ Why is $g(x)$ either non-positive or non-negative? $\endgroup$
    – TonyK
    Nov 29, 2012 at 19:32
  • $\begingroup$ @Lev - I think you assume that $f$ changes sign at its root, which doesn't necessarily happen (the function could be tangent to the $x$-axis). However, if $f$ doesn't change sign and is not identically zero, the integral $\int_0^\pi f(x) \sin(x)dx$ would be strictly positive (or strictly negative, if you take $f\leq 0$). This is again a contradiction. $\endgroup$ Nov 29, 2012 at 19:53
  • $\begingroup$ @TonyK: Note that $\sin (x-a)>0$ for $a<x<\pi$ and $\sin(x-a) <0$ for $0<x<a$. $\endgroup$
    – Lior B-S
    Nov 29, 2012 at 19:57
  • 1
    $\begingroup$ Yes, OK -- if $f$ doesn't change sign at $a$, then the $\sin$ integral can't be zero. So $f$ does change sign at $a$, and therefore $f(x)\sin(x-a)$ doesn't. $\endgroup$
    – TonyK
    Nov 29, 2012 at 20:01
  • $\begingroup$ @James Fennell: thank you, I missed the case when f does not change sign. $\endgroup$
    – Lev
    Nov 29, 2012 at 20:36

Since another question has been closed and linked to here, I figure it would be good to make sure there's an answer here that compiles everything nicely.

First, we show that $f$ has at least one root, as in Lior B-S's answer.

Let $F(x) = \int_{0}^x f(t) \sin(t)\, dt$. Then $F(0)=0$, and by hypothesis $F(\pi)=0$ too. It follows from the intermediate value theorem that there is some $c \in (0,\pi)$ with

$$0=F'(c) = f(c)\sin c.$$

Because $\sin$ has no zeroes in $(0,\pi)$, we obtain that $f(c)=0$.

We now show that $f$ must have more than one root, by contradiction. This is in line with Lev's answer and the addtitional explanantions in the comments under it.

Suppose that $f$ has the single root at $c$; there are two possibilities:

  • $f$ does not change signs at the root $c$.

In this case, because the sine also does not change signs on $(0,\pi)$, we'd have that $f(x)\sin(x)$ does not change signs on $(0,\pi)$. This implies that for $x\in(0,\pi)$, $f(x)\sin(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi f(t)\sin(t)\,dt =0$.

  • $f$ changes signs at the root $c$.

In this case, consider

$$g(x) = f(x)\cdot \sin(x-c) = f(x) \Big(\sin(x)\cos(c) - \cos(x)\sin(c)\Big).$$

Notice that

$$\int_0^\pi g(t)\,dt = \cos(c)\underbrace{\int_0^\pi f(t)\sin(t)\,dt}_0 - \sin(c)\underbrace{\int_0^\pi f(t)\cos(t)\,dt}_0 = 0.$$

However, $\sin(x-c)$ changes sign exactly once for $x\in(0,\pi)$, on $x=c$. This implies that for $x\in(0,\pi)$, $g(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi g(t)\,dt =0$.

Regardless of the situation, we see that the assumption that $f$ has a single root at $c$ leads to a contradiction, so we conclude that $f$ must have more than one root, as desired.

Moreover, as per James Fennell's comment under the question, $f(x)=\sin(3x)$ satisfies the conditions in the statement and has exactly $2$ roots in $(0,\pi)$, so 'at least two roots in $(0,\pi)$' is tight.


This is a problem of complex calculus.

The linear combination of both given integral can be used to represent a path. The function $f$ can be rewritten with the path inside. This is possible because $f$ depends on one real variable.

The path can be interpreted as the upper half circle above the real axis in the complex plane.

Look at for example: Line integral.

Now just given the pair of identies allows us the combine with $i$ and $-i$. The path can be run clockwise and counterclockwise.

If $F$ is the function $f$ on the complex path over the upper half of the unit circle. With $F$ is the $\overline F$ a solution. This gives without the complexes the existence of two solutions for $f$.

The steadiness of $f$ is needed to the exitence of the integrals. This does not follow from the identities. A function that is steady has an integral. Functions that are steady have integrals multiplied with transcendent functions. These are in the class of steady functions too. This attribut hat to be given in the interval $[0,\pi]$.

If the identities were not given alone the solution will not be double.

I am the opinion it is better practice to be more precise on the question regarding for $x$. The question is hard because it has not contexts. There is reason to mark this duplicate. Now that a correct answer/proof is given the situation changes.

  • $\begingroup$ You can flag a question as “low quality” or “duplicate” if you find that appropriate, but that does not belong in an answer. – Regarding your answer: What is a “steady” function? Do you mean “continuous”? Generally that all is quite vague. Can you demonstrate more concretely how you conclude that $f$ has at least two distinct zeros? $\endgroup$
    – Martin R
    Feb 28, 2021 at 17:13

This statement is not true. Actually, we should prove that $$\int_0^\pi f(x)[\cos x-\sin x]dx=0$$Now, define $$f(x)=\begin{cases}a\left(e-e^{4x\over \pi}\right)+1&,\quad 0\le x\le {\pi\over 4}\\1&,\quad {\pi\over 4}<x\le \pi\end{cases}$$where $a\ge 0$. It is clear that $f(x)\ge 1$ over $[0,\pi]$ for all $a\ge 0$ hence it has no root. However, by defining $$I=\int_0^\pi f(x)[\cos x-\sin x]dx$$we immediately conclude that $I=-2<0$ for $a=0$ and $\lim_{a\to \infty } I=\infty$. Based on intermediate value theorem and since $I$ is continuous w.r.t. $a$, there is a value for $a$ for which $I=0$, hence the statement is not true.

Here is a sketch of the two functions using Python:

enter image description here

  • $\begingroup$ You have found an example where $\int_{0}^{\pi}f(x)\sin {x} dx= \int_{0}^{\pi}f(x)\cos {x} dx$, but not necessarilty $\int_{0}^{\pi}f(x)\sin {x} dx = \int_{0}^{\pi}f(x)\cos {x} dx=0$. So this is not a counterexample. $\endgroup$
    – Martin R
    Feb 12, 2021 at 12:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .