# Determine/prove what is the dimension of the subspace $S=\{p\in P_2\ |\ p(0)=p(1) \}$ of $P_2$

Determine/prove what is the dimension of the subspace $$S=\{p\in P_2\ |\ p(0)=p(1) \}$$ of $$P_2$$

I believe that I need to find a basis for the subspace to determine the dimension but I need help.

• What is $\bP_2$? Commented Mar 5, 2019 at 20:44
• polynomials of degree 2 Commented Mar 5, 2019 at 20:45
• Polynomials of degree $2$ are not a subspace. Commented Mar 5, 2019 at 20:46
• OK. So yes, you could find a basis for $S$. Do you know the rank-nullity theorem? You could show that $S$ is the kernel of some linear transformation. Commented Mar 5, 2019 at 20:46

So you have $$p(x)=ax^2+bx+c$$ and $$p(0)=p(1)\implies c=a+b+c\implies b=-a$$
so $$S = \{ax^2-ax+c;a,c\in\mathbb{C}\}$$ So we have exactly two independent parameters so $$\dim S =2$$
As mentioned in the comments, polynomials of degree $$2$$ don't form a vector space (consider $$f\in P_2$$, then $$-f\in P_2$$ but their sum is $$0$$ which is not a degree $$2$$ polynomial). Rather, it should be "polynomials of degree at most $$2$$" which makes it a vector space.
Now, consider $$f\in P_2$$ as $$f(x)=ax^2+bx+c$$ where $$a,b,c\in\Bbb R$$. For $$f\in S$$, we have $$f(0)=f(1)$$, ie, $$c=a+b+c$$, ie, $$a+b=0$$
So, if $$a=k$$, then $$b=-k$$ and $$c$$ is unrestricted, so for $$f\in S$$, it must be of the form $$kx^2-kx+c=k(x^2-x)+c\cdot 1$$
Can you show that $$\{x^2-x,1\}$$ forms a basis for $$S$$ and hence conclude that $$\dim S=\ldots$$