Example CBP Change of basis with polynomials

The vector space $P_4$ (Example VSP) has two nice bases (Example BP), \begin{align*} B&=\set{1,x,x^2,x^3,x^4}\\ C&=\set{1,1+x,1+x+x^2,1+x+x^2+x^3,1+x+x^2+x^3+x^4} \end{align*}

To build the change-of-basis matrix between $B$ and $C$, we must first build a vector representation of each vector in $B$ relative to $C$, \begin{align*} \vectrep{C}{1} &=\vectrep{C}{(1)\left(1\right)} =\colvector{1\\0\\0\\0\\0}\\ \vectrep{C}{x} &=\vectrep{C}{(-1)\left(1\right)+(1)\left(1+x\right)} =\colvector{-1\\1\\0\\0\\0}\\ \vectrep{C}{x^2} &=\vectrep{C}{(-1)\left(1+x\right)+(1)\left(1+x+x^2\right)} =\colvector{0\\-1\\1\\0\\0}\\ \vectrep{C}{x^3} &=\vectrep{C}{(-1)\left(1+x+x^2\right)+(1)\left(1+x+x^2+x^3\right)} =\colvector{0\\0\\-1\\1\\0}\\ \vectrep{C}{x^4} &=\vectrep{C}{(-1)\left(1+x+x^2+x^3\right)+(1)\left(1+x+x^2+x^3+x^4\right)} =\colvector{0\\0\\0\\-1\\1} \end{align*}

Then we package up these vectors as the columns of a matrix, \begin{equation*} \cbm{B}{C}= \begin{bmatrix} 1 &-1 & 0 & 0 & 0\\ 0 & 1 &-1 & 0 & 0\\ 0 & 0 & 1 &-1 & 0\\ 0 & 0 & 0 & 1 &-1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \end{equation*}

Now, to illustrate Theorem CB, consider the vector $\vect{u}=5-3x+2x^2+8x^3-3x^4$. We can build the representation of $\vect{u}$ relative to $B$ easily, \begin{equation*} \vectrep{B}{\vect{u}}= \vectrep{B}{5-3x+2x^2+8x^3-3x^4}= \colvector{5\\-3\\2\\8\\-3} \end{equation*}

Applying Theorem CB, we obtain a second representation of $\vect{u}$, but now relative to $C$, \begin{align*} \vectrep{C}{\vect{u}} &=\cbm{B}{C}\vectrep{B}{\vect{u}}&&\knowl{./knowls/theorem.CB.knowl}{\text{Theorem CB}}\\ &= \begin{bmatrix} 1 &-1 & 0 & 0 & 0\\ 0 & 1 &-1 & 0 & 0\\ 0 & 0 & 1 &-1 & 0\\ 0 & 0 & 0 & 1 &-1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \colvector{5\\-3\\2\\8\\-3}\\ &=\colvector{8\\-5\\-6\\11\\-3}&&\knowl{./knowls/definition.MVP.knowl}{\text{Definition MVP}} \end{align*}

We can check our work by unraveling this second representation, \begin{align*} \vect{u} &=\vectrepinv{C}{\vectrep{C}{\vect{u}}} &&\knowl{./knowls/definition.IVLT.knowl}{\text{Definition IVLT}}\\ &=\vectrepinv{C}{\colvector{8\\-5\\-6\\11\\-3}}\\ &=8(1)+(-5)(1+x)+(-6)(1+x+x^2)\\ &\quad\quad+(11)(1+x+x^2+x^3)+(-3)(1+x+x^2+x^3+x^4) &&\knowl{./knowls/definition.VR.knowl}{\text{Definition VR}}\\ &=5-3x+2x^2+8x^3-3x^4 \end{align*}

The change-of-basis matrix from $C$ to $B$ is actually easier to build. Grab each vector in the basis $C$ and form its representation relative to $B$ \begin{align*} \vectrep{B}{1} &=\vectrep{B}{(1)1} =\colvector{1\\0\\0\\0\\0}\\ \vectrep{B}{1+x} &=\vectrep{B}{(1)1+(1)x} =\colvector{1\\1\\0\\0\\0}\\ \vectrep{B}{1+x+x^2} &=\vectrep{B}{(1)1+(1)x+(1)x^2} =\colvector{1\\1\\1\\0\\0}\\ \vectrep{B}{1+x+x^2+x^3} &=\vectrep{B}{(1)1+(1)x+(1)x^2+(1)x^3} =\colvector{1\\1\\1\\1\\0}\\ \vectrep{B}{1+x+x^2+x^3+x^4} &=\vectrep{B}{(1)1+(1)x+(1)x^2+(1)x^3+(1)x^4} =\colvector{1\\1\\1\\1\\1}\\ \end{align*}

Then we package up these vectors as the columns of a matrix, \begin{equation*} \cbm{C}{B}= \begin{bmatrix} 1 & 1 & 1 & 1 & 1\\ 0 & 1 & 1 & 1 & 1\\ 0 & 0 & 1 & 1 & 1\\ 0 & 0 & 0 & 1 & 1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \end{equation*}

We formed two representations of the vector $\vect{u}$ above, so we can again provide a check on our computations by converting from the representation of $\vect{u}$ relative to $C$ to the representation of $\vect{u}$ relative to $B$, \begin{align*} \vectrep{B}{\vect{u}} &=\cbm{C}{B}\vectrep{C}{\vect{u}}&&\knowl{./knowls/theorem.CB.knowl}{\text{Theorem CB}}\\ &= \begin{bmatrix} 1 & 1 & 1 & 1 & 1\\ 0 & 1 & 1 & 1 & 1\\ 0 & 0 & 1 & 1 & 1\\ 0 & 0 & 0 & 1 & 1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \colvector{8\\-5\\-6\\11\\-3}\\ &=\colvector{5\\-3\\2\\8\\-3}&&\knowl{./knowls/definition.MVP.knowl}{\text{Definition MVP}}\\ \end{align*}

One more computation that is either a check on our work, or an illustration of a theorem. The two change-of-basis matrices, $\cbm{B}{C}$ and $\cbm{C}{B}$, should be inverses of each other, according to Theorem ICBM. Here we go, \begin{equation*} \cbm{B}{C}\cbm{C}{B}= \begin{bmatrix} 1 &-1 & 0 & 0 & 0\\ 0 & 1 &-1 & 0 & 0\\ 0 & 0 & 1 &-1 & 0\\ 0 & 0 & 0 & 1 &-1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 & 1 & 1\\ 0 & 1 & 1 & 1 & 1\\ 0 & 0 & 1 & 1 & 1\\ 0 & 0 & 0 & 1 & 1\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 1\\ \end{bmatrix} \end{equation*}

(in context)