How do I show that for positive integer $n$ and $f(x)$ all real polynomial functions of degree less than $n$ there exist constants $a_i$ such that $$\int_0^1 f(x)e^xdx=\sum_{i=1}^na_if(i)?$$ I thought maybe I can do something with the basis $(1,x,x^2,...,x^{n-1})$ of the vector space of polynomials, but I'm not sure what exactly?
Edit: $a_i$ have to be chosen independently of $f$
Really, this isn't about integrals. The mapping $f \mapsto \int_0^1 f(x)e^x \, dx$ is a linear functional on the $n$-dimensional space $V$ of polynomials of degree $< n$. The problem asks you to prove that in the dual space $V^{*}$, this functional is in the span of the functionals $$\phi_1 \colon f \mapsto f(1), \quad \phi_2 \colon f \mapsto f(2),\dots, \quad \phi_n \colon f \mapsto f(n).$$ Letting this span be $X \subseteq V^{*}$, it will be enough to prove that $X = V^{*}$. If we had $X \ne V^{*}$, then there would be some nonzero $f \in X^{\bot},$ that is, we'd have $f(1) = f(2) = \dots f(n) = 0$. But this is impossible, since a nonzero polynomial of degree $< n$ cannot have $n$ distinct roots.