## Compute the matrix of a given linear transformation

Let $V \subseteq \mathbb{Q}[x]$ be the set of all polynomials with rational coefficients having degree at most 5. Let $\varphi : V \rightarrow V$ be the linear transformation given by $\varphi(p) = p^\prime$ (the usual derivative of $p$ with respect to $x$). Compute the matrix of $\varphi$ with respect to the bases $B = \{x^t \ |\ 0 \leq t \leq 5\}$ and $E = \{\sum_{i=0}^t x^i \ |\ 0 \leq t \leq 5\}$. That is, compute $M^B_B(\varphi)$ and $M^E_E(\varphi)$.

First we compute $M^B_B(\varphi)$. Note the following:

1. $\varphi(1) = 0$
2. $\varphi(x) = (1)1$
3. $\varphi(x^2) = (2)x$
4. $\varphi(x^3) = (3)x^2$
5. $\varphi(x^4) = (4)x^3$
6. $\varphi(x^5) = (5)x^4$

Thus, we have

$M^B_B(\varphi) = \begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 3 & 0 & 0 \\ 0 & 0 & 0 & 0 & 4 & 0 \\ 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}$

Now we compute $M^E_E(\varphi)$.

1. $\varphi(1) = 0$
2. $\varphi(x+1) = 1(1)$
3. $\varphi(x^2+x+1) = 2x+1$ $= 2(x+1) - 1(1)$
4. $\varphi(x^3+x^2+x+1) = 3x^2+2x+1$ $= 3(x^2+x+1) - 1(x+1) - 1(1)$
5. $\varphi(x^4+x^3+x^2+x+1) = 4x^3+3x^2+2x+1$ $= 4(x^3+x^2+x+1) - 1(x^2+x+1) - 1(x+1) - 1(1)$
6. $\varphi(x^5+x^4+x^3+x^2+x+1) = 5x^4 + 4x^3 + 3x^2 + 2x + 1$ $= 5(x^4+x^3+x^2+x+1) - 1(x^3+x^2+x+1) - 1(x^2+x+1) - 1(x+1) - 1(1)$.

Thus we have

$M^E_E(\varphi) = \begin{bmatrix} 0 & 1 & \text{-}1 & \text{-}1 & \text{-}1 & \text{-}1 \\ 0 & 0 & 2 & \text{-}1 & \text{-}1 & \text{-}1 \\ 0 & 0 & 0 & 3 & \text{-}1 & \text{-}1 \\ 0 & 0 & 0 & 0 & 4 & \text{-}1 \\ 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}$

Just for fun, we can also compute $M^B_E(\varphi)$ and $M^E_B(\varphi)$. Note first that

1. $\varphi(1) = 0$
2. $\varphi(x) = 1(1)$
3. $\varphi(x^2) = 2x$ $= 2(x+1) - 2(1)$
4. $\varphi(x^3) = 3x^2$ $= 3(x^2+x+1) - 3(x+1)$
5. $\varphi(x^4) = 4x^3$ $= 4(x^3+x^2+x+1) - 4(x^2+x+1)$
6. $\varphi(x^5) = 5x^4$ $= 5(x^4+x^3+x^2+x+1) - 5(x^3+x^2+x+1)$

so that

$M^E_B(\varphi) = \begin{bmatrix} 0 & 1 & \text{-}2 & 0 & 0 & 0 \\ 0 & 0 & 2 & \text{-}3 & 0 & 0 \\ 0 & 0 & 0 & 3 & \text{-}4 & 0 \\ 0 & 0 & 0 & 0 & 4 & \text{-}5 \\ 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.$

Finally,

1. $\varphi(1) = 0$
2. $\varphi(x+1) = 1$ $= 1(1)$
3. $\varphi(x^2+x+1) = 2x+1$ $= 2(x) + 1(1)$
4. $\varphi(x^3+x^2+x+1) = 3x^2+2x+1$ $= 3(x^2) + 2(x) + 1(1)$
5. $\varphi(x^4+x^3+x^2+x+1) = 4x^3+3x^2+2x+1$ $= 4(x^3) + 3(x^2) + 2(x) + 1(1)$
6. $\varphi(x^5+x^4+x^3+x^2+x+1) = 5x^4+4x^3+3x^2+2x+1$ $= 5(x^4) + 4(x^3) + 3(x^2) + 2(x) + 1(1)$

Thus

$M^B_E(\varphi) = \begin{bmatrix} 0 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 2 & 2 & 2 & 2 \\ 0 & 0 & 0 & 3 & 3 & 3 \\ 0 & 0 & 0 & 0 & 4 & 4 \\ 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}.$