Finding the matrix of multiplication by $\theta^2$, where $\theta^3 - 3\theta + 1 = 0$ This is a problem from a on-line source which yet comes with a solution (self-studier; not h.w.).
Let $E = \mathbb Q(\theta)$, where $\theta$ is a root of the irreducible polynomial
\[
X^3 -3X + 1.
\]
I was wondering how one gets the matrix of the endomorphism $E \to E$ induced by multiplication by $\theta^2$.
I can see that $\theta^2 \cdot 1 = \theta^2$, $\theta^2 \cdot \theta = \theta^3 = 3\theta - 1$, and $\theta^2 \cdot \theta^2 = \theta \cdot \theta^3 = 3\theta^2 - \theta$.
This is where I fall apart. The solution gives the matrix
\begin{bmatrix} 0&- 1&0 \\ 0&3&-1 \\ 1&0&3 \end{bmatrix}
I can that see if you multiply this by a $3 \times 1$ column vector of $1$'s, $4\theta^2$ + $2\theta$ $- 1$ emerges. 
But I don't see how to derive the matrix; and, further, if it is unique. That is to say, if the $-1$ in the top row was in a different position in the top row, it seems you would still get $-1$ in the top position in the product.
Only a little of this is mine — except for the misstatements and confusion.
Thanks.
 A: Let's first check that $X^3 - 3X + 1$ is irreducible over $\mathbb Q$. Since it's a cubic, it's enough to show that it does not have a root in $\mathbb Q$. The rational root theorem tells you that the only possible roots in $\mathbb Q$ are $\pm 1$, and neither of these works.
Some general facts: if I have a field $F$ and an element $\alpha$ algebraic over $F$ with minimal polynomial $p(X)$ of degree $n$, then $\{1, \alpha, \ldots, \alpha^{n - 1}\}$ is a basis for $F(\alpha)$ over $F$. A proof should be in any reference, but it isn't so hard to come up with on your own: the relation $p(\alpha) = 0$ allows you to ignore higher powers of $\alpha$, and an honest linear dependence would give you a non-zero polynomial of degree $< n$ having $\alpha$ as a root, which is impossible.
The given matrix, as Olivier pointed out, is using exactly this sort of basis for both the source and target. And you've actually calculated the entries of this matrix — the second column, for example, gives the coefficients of  $\theta^2 \cdot \theta = (-1) \cdot 1 + 3 \cdot\theta + 0 \cdot \theta^2$. Of course, if you use different bases then your matrix will change, but that is now a question of linear algebra.
