<s>[INST] Matrix that moves the graph of a polynomial. Consider the vector space of all polynomials of degree $\leq2$. Find the matrix which describes: $$p(t)\mapsto p(t-1)$$
So $t^2-2t+1$ for example would change to $(t-1)^2-2(t-1)+1$.
(The graph moves one unit to the right.)
First I set up this equation for the example above:
$$
\begin{pmatrix}
\cdot  & \cdot & \cdot\\
\cdot  & \cdot & \cdot\\
\cdot  & \cdot & \cdot
\end{pmatrix}
\begin{pmatrix}
t^2\\
-2t\\
1\\
\end{pmatrix}
=\begin{pmatrix}
(t-1)^2\\
-2(t-1)\\
1\\
\end{pmatrix}=
\begin{pmatrix}
t^2-2x+1\\
-2t+2\\
1\\
\end{pmatrix}
$$
I figured out that the matrix has to be
\begin{pmatrix}
1  & 1 & 1\\
0 & 1 & 2\\
0  & 0 & 1\\
\end{pmatrix}
Which looks very nice, so I thought I was done. Just to be sure, I took another example:
$$t^2+t+1 ~~~ \longmapsto ~~~(t-1)^2+(t-1)+1$$
But in this case, the matrix seems to be
\begin{pmatrix}
1  & -2 & 1\\
0 & 1 & -1\\
0  & 0 & 1\\
\end{pmatrix}
Finally, I multiplied out the first example to $t^2-4t+4$, took the representing vector and the matrix for that transformation had only entries on the diagonal (obviously, but still) - so which one is it/what am I doing wrong?
 [/INST] A polynomial of degree $\le 2$ is the linear combination of $x^0, x^1, x^2$.  It may be represented using $\begin{bmatrix} A \\ B \\ C\end{bmatrix}$ to represent $Ax^2 + Bx + C$.
Suppose you want to shift $P_1$ to the right $k$ units to produce $P_2$:
$$\begin{align}P_2(x) &= P_1(x - k) \\
                     &= A(x - k)^2 + B(x - k) + C \\
                     &= Ax^2 - 2Akx + Ak^2 + Bx - Bk + C \\
                     &= (A)x^2 + (B - 2Ak)x + (Ak^2 - Bk + C)
                     \end{align}$$
This leaves us to find some matrix $M$:
$$\begin{align}P_2 &= M(k)\times P_1 \\
               \begin{bmatrix} A \\ B - 2Ak \\ Ak^2 - Bk + C \end{bmatrix} &=
               \begin{bmatrix} \text{Your} \\ \text{Matrix} \\ \text{Here} \end{bmatrix}
               \begin{bmatrix} A \\ B \\ C \end{bmatrix}
\end{align}$$
So consider the top row of your matrix:
$$\begin{align}
               \begin{bmatrix} A \\ B - 2Ak \\ Ak^2 - Bk + C \end{bmatrix}  &=
               \begin{bmatrix} m_1 & m_2 & m_3 \\ &  \cdots  & \\  & \cdots &  \end{bmatrix}
               \begin{bmatrix} A \\ B \\ C \end{bmatrix}
\end{align}$$
This results in the equation:
  $$A = m_1 A + m_2 B + m_3 C$$
From this we see that $m_1 = 1, m_2 = 0$, and $m_3 = 0$.  The second row of the matrix gives us another result:
$$\begin{align}
               \begin{bmatrix} A \\ B - 2Ak \\ Ak^2 - Bk + C \end{bmatrix}  &=
               \begin{bmatrix} &  \cdots  & \\ m_4 & m_5 & m_6 \\  & \cdots &  \end{bmatrix}
               \begin{bmatrix} A \\ B \\ C \end{bmatrix}
\end{align}$$
Giving the equation $B - 2Ak = m_4 A + m_5 B + m_6 C$.  We can see from this that $m_4 = -2k, m_5 = 1$, and $m_6 = 0$.  The last row of the matrix gives 
  $$Ak^2 - Bk + C = m_7 A + m_8 B + m_9 C \tag{Last Row}$$
Find $m_7, m_8, m_9$ the same we way found the previous six matrix entries, and your final matrix becomes:
$$             \begin{bmatrix} A \\ B - 2Ak \\ Ak^2 - Bk + C \end{bmatrix} =
               \begin{bmatrix} 1 & 0 & 0 \\ -2k & 1 & 0 \\ m_7 & m_8 & m_9 \end{bmatrix}
               \begin{bmatrix} A \\ B \\ C \end{bmatrix}
$$
One way to check if your result is right, since shift a matrix to the right by $k$ twice is the same as shifting it to the right $2k$ once, you should check to see if:
$$\underbrace{M(k)^2}_{\text{shift right twice}} = \underbrace{M(2k)}_{\text{shift right once}}$$
</s>