**Ex 7** Suppose
$$W=\mathrm{span}(1,x)$$
$$W_1=\mathrm{span}(x^2,x^3)$$
$$W_2=\mathrm{span}(1+x+x^2+x^3,1+x+x^2-x^3)$$
Show that
$$
P_3=W\oplus W_1
$$
and
$$
P_3=W\oplus W_2
$$
**Proof** Firstly, we prove that
$$
P_3=W\oplus W_1.
$$
It suffices to show that
$$
P_3=W+W_1
$$
and
$$
W\cap W_1=\{\vec 0\}
$$
To show $W\cap W_1=\{\vec 0\}$, it suffices to show that for any $\vec v\in W\cap W_1$, we have $\vec v=\vec 0$. Indeed, since $\vec v\in W$ and $\vec v\in W_1$, there exists scalars $a_1,a_2,a_3,a_4\in \mathbb R$ such that
$$
\vec v = a_1\cdot 1+a_2\cdot x
$$
and
$$
\vec v = a_3\cdot x^2+a_4\cdot x^3.
$$
Therefore
$$
\vec v(x)=a_1+a_2x=a_3x^2+a_4x^3
$$
Let $x=0$, we have
$$
a_1+a_2\cdot 0=a_3\cdot 0+a_4\cdot 0 = 0
$$
So $a_1=0$. Therefore
$$
\vec v(x)=a_2x=a_3x^2+a_4x^3
$$
Taking derivative with respect to $x$, we have
$$
a_2=2a_3\cdot x+3a_4\cdot x^2
$$
Let $x=0$, we have
$$
a_2=0.
$$
Therefore, $\vec v(x)=a_1+a_2\cdot x=0+0\cdot x=0$.
This completes the proof that $\vec v=\vec 0$.
</br></br></br></br></br></br></br>
Then we show that
$$
P_3=W\oplus W_2.
$$