Let $V = \mathbb{P^4}$ denote the space of quartic polynomials, with the $L^2$ inner product $$\langle p,q \rangle = \int^1_{-1} p(x)q(x)dx.$$ Let $W = \mathbb{P^2}$ be the subspace of quadratic polynomials. Find a basis for and the dimension of $W^{\perp}$.
The answer is $$t^3 - \frac{3}{5}t, t^4 - \frac{6}{7}t^2 + \frac{3}{35};\,\, \dim (W^{\perp}) =2$$
How did they get that?
Well, for a finite dimensional vector space we have $\dim W + \dim W^\perp = \dim V$ so that covers the dimension part. For the basis of the orthogonal complement, we have $$\int_{-1}^1 ax^4 + bx^3 + cx^2 + dx + e\ dx = 0$$ $$\int_{-1}^1 x(ax^4 + bx^3 + cx^2 + dx + e)\ dx = 0$$ $$\int_{-1}^1x^2(ax^4 + bx^3 + cx^2 + dx + e)\ dx = 0$$ Because the standard basis of $\mathbb{P}^2$ must satisfy the orthogonality conditions. Therefore we get $$\frac{a}{5} + \frac{c}{3} + e = 0$$ $$\frac{b}{5} + \frac{d}{3} = 0$$ $$\frac{a}{7} + \frac{c}{5} + \frac{e}{3} = 0$$ Solving this system yields $$a = \frac{35}{3}e,\ \ b=-\frac{5}{3}d,\ \ c=-10e$$ with two parameters to vary. Your solutions follows by taking $(a=0,\ b=1)$ and $(a=1,\ b=0)$ respectively.