Let $P_2(\mathbb{R})$ be the set of all polynomials of at most degree $2$.
Define $W = \{p \in P_2(\mathbb{R}): p(1) = 0\}$.
Find the dimension of $W$.
My thoughts: $W$, in other words, are all polynomials of at most degree $2$ which intersect the $x$-axis at $x = 1$.
We know that $dim(P_2(\mathbb{R})) = 3$. ($a, b$ and $c$)
I could not think of a solution except that the $dim$ must be $2$ since $c$ (given $p = ax^2 + bx + c$) has to be $= (-a -b)$, therefore you can only have the basis: $x^2 - 1$ and $x - 1$.
Note that
$$p(x)=ax^2+bx+c \implies p(1)=0 \iff a+b+c=0$$
thus $p\in W$ has the form
$$p(x)=ax^2+bx-(a+b)=a(x^2-1)+b(x-1)$$
then your conclusion is correct.