The following is a proof of a lemma from page 10 of Calculus of Variations by Gelfand and Fomin (tr. Silverman):
Lemma 2: If $\alpha(x)$ is continuous in $[a,b]$, and if $$\int_a^b\alpha(x)h'(x)\ dx = 0$$ for every function $h(x)$ [that is continuously differentiable on the interval $[a,b]$] such that $h(a)=h(b)=0$, then $\alpha(x)=c$ for all $x$ in $[a,b]$ where $c$ is a constant.
Proof. Let $c$ be defined by the condition $$\int_a^b[\alpha(x)-c]\ dx=0,$$ and let $$h(x)=\int_a^x[\alpha(\xi)-c]\ d\xi,$$ so that $h(x)$ automatically belongs to [the set of continuously differentiable functions on $[a,b]$] and satisfies the conditions $h(a)=h(b)=0$. Then, on the one hand, $$\int_a^b[\alpha(x)-c]h'(x)\ dx=\int_a^b\alpha(x)h'(x)\ dx-c[h(b)-h(a)]=0,$$ while on the other hand, $$\int_a^b[\alpha(x)-c]h'(x)\ dx=\int_a^b[\alpha(x)-c]^2\ dx.$$ It follows that $\alpha(x)-c=0$, i.e., $\alpha(x)=c$, for all $x$ in $[a,b]$.
This proof appears to show that $\alpha(x)=c$, and I can't find any steps that appear to be in error.
However, I seem to have found a contradiction: suppose that $\alpha(x)=c$ causes $\int_a^b\alpha(x)h'(x)\ \mathrm dx=0$. Let $\alpha_k(x)=k\alpha(x)=kc$ for some $k\in \mathbb R$. Then
$$\int_a^b\alpha_k(x)h'(x)\ \mathrm dx=\int_a^bk \alpha(x)h'(x)\ \mathrm dx=k\int_a^b \alpha(x)h'(x)\ \mathrm dx=0$$
So now the situation is this: the proof from the book clearly shows $\alpha(x)$ must be $c$ determined from $\int_a^b\alpha(x)-c\ \mathrm dx=0$, and yet, any $\alpha(x)=kc$ appears to satisfy the original condition that $\int_a^b\alpha(x)h'(x)\ \mathrm dx = 0$. Something is wrong: either the proof has an error (unlikely) or my reasoning is incorrect.
Can anyone help me understand the flaw in the argument? Thanks