Let $V=P_{2}(\mathbb{R})$ be the vector space of all real polynomials of degree at most 2. We equip $V$ with the following inner product: $$<p,q> \; = \; p(0)q(0) \; + \; p'(1)q'(1) \; + \; p''(2)q''(2) \: \; \text{for} \; \; p,q\in V.$$ Let $$U= \{\;p \in V\; | \; p(0) \; + \;p'(1) \; + \; p''(2) \; = \;0 \},$$ and let $q(x) = x^2$. Find the polynomial $p \in U$ such that $||p-q||$ is minimal among all polynomials $p \in U$, where $||\cdot||$ is the norm associated with $<\cdot , \cdot >$.
This seems like a problem where I apply the Gram Schmidt method to my standard basis in $P_2(\mathbb{R})$ $\beta = \{ 1,x,x^2 \}$. If I do that I get my Orthonormal Basis for $U$ with $\beta = \{ 1,x, \frac{1}{2}x^2-x \}$.
I'm not exactly what to do now, supposing what I've done so far is the right idea. Can someone point me in the right direction? Any help will be appreciated!
Note: This is a duplicate of a previous problem I posted a little bit ago, but I still have had no progress.
To summarize the discussion in the comments, you first find an orthogonal basis for $U$ and then use that to compute the orthogonal projection of $x^2$ onto $U$ relative to the given inner product. (You could normalize the basis vectors, but it’s not really necessary as long as you remember to account for not having unit vectors when computing the final projection.)
For an arbitrary polynomial $ax^2+bx+c$, the defining equation for $U$ becomes $4a+b+c=0$, from which we can read off a basis for $U$, for instance, $p_1=x-1$ and $p_2=x^2-4$. Then, turn this into an orthogonal basis by computing the orthogonal rejection of one of these vectors from the other, say $q_1=p_1$ and $q_2=p_2-{\langle p_2,q_1 \rangle \over \langle q_1,q_1 \rangle} q_1$. Finally, compute the projection of $x^2$ onto $U$: $${\langle x^2,q_1 \rangle \over \langle q_1,q_1 \rangle}q_1+{\langle x^2,q_2\rangle \over \langle q_2,q_2\rangle}q_2.$$
Alternatively, you could simply move everything to $\mathbb R^3$. It’s not a lot of work to work out the inner products of the standard basis vectors $\{1,x,x^2\}$. If you collect them into the matrix $$Q=\begin{bmatrix}1&0&0\\0&1&2\\0&2&8\end{bmatrix}$$ this inner product is $\mathbf v^TQ\mathbf w$ when expressed in terms of coordinate vectors relative to the standard basis. You can use the same process as above, but with coordinate vectors, or compute the projection onto $U$ directly without first orthogonalizing its basis. With some abuse of notation, let $$U=\begin{bmatrix}-1&-4\\1&0\\0&4\end{bmatrix},$$ the matrix with our basis vectors for $U$ from above. Then, the projection of a vector $\mathbf v$ onto $U$ is given by the expression $$U(U^TQU)^{-1}U^TQ\mathbf v,$$ and for $x^2$ this is simply the third column of that matrix product in the expression. For this low-dimensional problem, the first method looks like it’s less work, but it’s worth knowing this method of computing a projection matrix.