TITLE: Why such function does not exist?
QUESTION [5 upvotes]: I could not prove the following: 

A function $f \in \mathscr{C}^2([0, \pi])$, such that $$f(0) = f(\pi) = 0,\\
\int_0^{\pi} (f'(x))^2dx = 1,\\
\text{and }\int_0^{\pi} (f(x))^2dx = 2$$
  Then such function does not exist. 

I think that I have to use the Rayleigh quotient and have a contradiction for the eigenvalue $\frac{1}{2}$. Thanks in advance.

REPLY [4 votes]: I think for user40276 mentioned the Rayleigh quotient, he meant to prove that 

There does not exist such $f\in C^2$ solving the Dirichlet eigenvalue problem for 
  $$-\Delta f= -f''= \lambda f\tag{1}$$ on the interval satisfying those conditions.

Notice the condition means that the $f$ is an eigenfunction of $-\Delta$ with eigenvalue $2$. All the eigenfunction have the form 
$$v(x) = A\sin(\sqrt{\lambda}x) + B\cos(\sqrt{\lambda}x)$$
which solves problem (1). Now for the boundary condition:
$$
v(0) =0 \implies B=0,
$$
so $v(x) = A\sin(\sqrt{\lambda}x)$, now apply the other boundary condition:
$$
v(\pi) =0 \implies A\sin(\sqrt{\lambda}\pi) = 0\implies \sqrt{\lambda} = k\in \mathbb{Z}.
$$
This says that the eigenvalue for problem (1) can only be complete squares, $1,4,9,\ldots$. Hence $2$ can not be one.

UPDATE: OP updated that the eigenvalue problem should be 
$$f' + \lambda f = 0,\tag{2}$$
then the first integration condition is
$$
\int_0^{\pi} \big(f'(x)\big)^2dx = \int_0^{\pi} \big(\lambda f(x)\big)^2dx= 2,
$$
together with the second it implies $\lambda = \pm\sqrt{2}$. The solution to $(2)$ is $f = Ce^{\pm \sqrt{2} x}$. Notice here it is not $f =c_1 e^{\sqrt{2} x} + c_2 e^{-\sqrt{2} x}$, $f$ can be just one, not a linear combination of both. So there is no way $f(0) = f(\pi) = 0$.