Let $V$ be the real vector space of polynomials of degree $\leq2$ and the inner product is $\langle p,q\rangle =\int_{-1}^1p(x)q(x)dx$.
How do I show that there exists a $q\in V$ such that for all $p\in V$ we have $\langle p,q\rangle=p(2)$?
Let $V$ be the real vector space of polynomials of degree $\leq2$ and the inner product is $\langle p,q\rangle =\int_{-1}^1p(x)q(x)dx$.
How do I show that there exists a $q\in V$ such that for all $p\in V$ we have $\langle p,q\rangle=p(2)$?
On
Here's another way, if you don't need to find $q$: define $\varphi:\mathbb{R}_2\left[x\right]\to\mathbb{R}$ by $\varphi(p)=p(2)$. This is a linear functional on a finite dimensional space, and thus we may apply Riesz representation theorem to prove that such $q$ exists.
On
Let's assume that such $q$ exists for the sake of finding one. Since now for all $p\in V$ we have $\langle p,q\rangle=p(2)$, we know, for p(x)=1: $\int_{-1}^{1}{q(x)dx}=1$. For $p(x)=x$ we find $\int_{-1}^{1}{xq(x)dx}=2$ and for $p(x)=x^2$ we get $\int_{-1}^{1}{x^2q(x)dx}=4$. We know $q$ is of the form $ax^2+bx+c$, so we can substitute this, and we'll start with the second equality we found: $$\left[\frac{1}{4}ax^4+\frac{1}{3}bx^3+\frac{1}{2}cx^2\right]_{-1}^{1}=\frac{2}{3}b=2$$ This implies $b=3$. Now we'll do the first and last equality:$$\left[\frac{1}{3}ax^3+\frac{1}{2}bx^2+cx\right]_{-1}^{1}=\frac{2}{3}a+2c=1$$ $$\left[\frac{1}{5}ax^5+\frac{1}{4}bx^4+\frac{1}{3}cx^3\right]_{-1}^{1}=\frac{2}{5}a+\frac{2}{3}c=4$$ This is solvable and yields $a=\frac{165}{8}$ and $c=-\frac{51}{8}$. Thus, your polynomial is $q(x)=\frac{165}{8}x^2+3x+-\frac{51}{8}$. The only thing left is to check whether this $q$ actually does the job - I leave that to you.
Hope this helped!
It suffices to find $q$ that works for $1, x, x^2$, i.e., find $q$ such that $$\int_{-1}^1q(x)\,\mathrm dx = 1 $$ $$\int_{-1}^1xq(x)\,\mathrm dx = 2 $$ $$\int_{-1}^1x^2q(x)\,\mathrm dx = 4 $$ Those are three equations in the three coefficients of $q$, so you should be fine.
If you just want to show existence, note that the linear map $V\to V^*$, $q\mapsto \langle\cdot,q\rangle$ is injective (why?), hence bijective (why?). Therefore there exists $q$ that maps to the element of $V^*$ given by $p\mapsto p(2)$.