Smooth function on $[-1,1]$ with specified integral against polynomials. I'm reading a book in which the following claim is made:
Suppose that $K$ is some smooth compactly supported function, and fix an integer $m\in\mathbb N$. Given scalars $\alpha_0,\ldots,\alpha_m>0$, it is always possible to find a smooth function $\phi$ compactly supported on $[0,1]$ such that
$$\int_\mathbb R\phi(x) x^k=\alpha_k\int_\mathbb R K(x)x^k,\qquad k=0,\ldots,m.$$
This is given without proof and it is claimed by the author that finding such a function is straightforward.
I've been thinking about this for a while and can't seem to come up with anything obvious. Am I missing something obvious here?

Let $X$ be the vector space of smooth functions supported on $[0,1]$ and consider the linear map $T:X\to \mathbb{R}^{m+1}$ sending $\phi$ to the tuple $(c_0,\dots,c_m)$ where $c_k=\int\phi(x)x^k$.  The claim is that $T$ is surjective.  If $T$ is not surjective, then its image is a proper linear subspace of $\mathbb{R}^{m+1}$, so there is some nonzero functional $\beta:\mathbb{R}^{m+1}\to \mathbb{R}$ such that $\beta\circ T=0$.  Explicitly, if the value of $\beta$ on the $k$th standard basis vector is $\beta_k$, this means there exist $\beta_0,\dots,\beta_m\in\mathbb{R}$, not all $0$, such that $$\sum_{k=0}^m\beta_k\int\phi(x)x^k=0$$ for all $\phi\in X$.  But this just means $\int\phi(x)p(x)=0$, where $p(x)$ is the polynomial $\sum \beta_k x^k$.  Since this holds for arbitrary $\phi\in X$, this means $p$ is identically $0$ on $[0,1]$ (if $p(t)\neq 0$ for some $t\in[0,1]$, choose $\phi$ to be a bump function near $t$).  But a nonzero polynomial cannot be zero on an entire interval, so this implies $\beta_k=0$ for all $k$, which is a contradiction.
