The question is, considering
- The vector space $\mathcal{P}_3(\mathbb{R})$ of the polynomials with real coefficients of degree $\leq$ 3
- The inner product defined by $\left<p,q\right>=\int_{-1}^{1}pq$
how to find a basis for the orthogonal complement of the space spanned by $\{x-1, x^2+3\}$?
I tried making $$\int_{-1}^{1}(x-1)p(x)=0$$ and $$\int_{-1}^{1}(x^2+3)p(x)=0,$$ which gave me the spanning sets $\{x^3+\frac{1}{5}, x^2-\frac{1}{3}, x+\frac{1}{3}\}$ and $\{x^3, x^2-\frac{9}{25}, x\}$ respectively. Then I think we may determine a basis for the intersection os these subspaces, but didn't see how.
Write a linear combination of one of the spanning spaces, such as $$ ax^3 + b\left(x^2-\frac{9}{25}\right) + cx $$ and take the inner product with the other polynomial (in this case $x-1$). Set it equal to zero and solve for $c$, then plug it back into the above expression and collect terms proportional to $a$ and $b$ to get a spanning set orthogonal to both.
You could also use the Gram-Schmidt process on the basis $\{x - 1, x^2 + 3, 1, x^3\}$ (the last two vectors are arbitrary elements of the complement of the span of $\{x-1,x^2+3\}$). At the end of the process, the last two vectors will be an orthogonal basis for the the orthogonal complement of the span of the first two.