Linear algebra, finding basis for orthogonal complement of a vector space. Sorry for the text, I am new to this.
We have the vector space $$V=P_3(R)$$ under the inner product:
$$\langle f,g\rangle=f(-2)g(-2)+f(-1)g(-1)+f(0)g(0)+f(1)g(1)$$
Let:
$$p(x)=x^3+3x^2+2x$$
and:
$$q(x)=x-1$$
Let the vector space $W$:
$$W=\mathrm {span}(p(x),q(x))$$
Give a basis for the orthogonal complement of $W$, that is $W^\perp$
I already have the correct answer, and made large amount progress of this question, but I cannot figure  out fully how the process is done.
Answer: $$(7x^2+4x-11, 7x^3-16x+9)$$
 A: Notice that $p(x)=x(x+1)(x+2)$, so the values at $x=-2,-1,0,1$:
$$
\begin{array}{c|cccc}
 & -2 & -1 & 0& 1 \\
\hline
p & 0 & 0 & 0&6 \\
q & -3 & -2 & -1&0 \\
\end{array}
$$
Then to find a orthonormal complement $g,h$, we just need to satisfying the inner product with each other being $0$, which shouldn't give too messy calculation.
For example, the following works:$$
\begin{array}{c|cccc}
 & -2 & -1 & 0& 1 \\
\hline
g & 0 & -1 & 2 &0 \\
h & -\frac 53 & 2 & 1&0 \\
\end{array}
$$
With other places $0$. Using this, you then can easily find $2$ degree $3$ polynomial that satisfy the condition.
An example way to find it is shown below:
Based on the zeros of $g$, we have:
$$g(x)=g'(x)\,(x-1)(x+2)$$
With $g'(0)=-1$, $\,g'(-1)=\frac 12$, then $g'(x)=-\frac 32x-1$, so:
$$g(x)=-(\frac32x+1)(x-1)(x+2)$$
Now if $h(x)=1-x+h'(x)$, then $h(x)$ is matched except at $x=-2$, so
$$h'(x)=kx(x+1)(x-1)$$
Plugging in $x=-2$, we have $-\frac 53=3-6k$, and $k=\frac 79$, so:
$$h(x)=-(x-1)+\frac 79x(x+1)(x-1)=\frac 19(x-1)(7x^2+7x-9)$$
A: Hint:  Writing down what it means for the inner products $\langle p(x),f(x)\rangle,\langle q(x),f(x)\rangle$ to be zero will give you a couple of equations.  Let $f(x)=a_3x^3+a_2x^2+a_1x+a_0$.  The two equations will knock the dimension down by two:  you should get a two-dimensional vector space as your solution.
