Let $f(x) = x^3 - 3x + 1 \in \mathbb{Q}[x]$. It is irreducible over $\mathbb{Q}$ since it is irreducible over $\mathbb{F}_2$. The discriminant of $f$ is $81 = 9^2$, so the Galois group of $f$ is isomorphic to $A_3$ and the splitting field of $f$ is $\mathbb{Q}(\alpha)$, where $\alpha$ is a root of $f$.
Now I want to represent the elements of $G(\mathbb{Q}(\alpha)/\mathbb{Q})$ as matrices $3 \times 3$, but to do that I need a basis of $\mathbb{Q}(\alpha)$ over $\mathbb{Q}$. And the question is:
What basis of $\mathbb{Q}(\alpha)/\mathbb{Q}$ is better to choose and how to express the roots $\alpha, \beta$ and $\gamma$ in terms of that basis?
If I take ${1, \alpha, \alpha^2}$ as a basis, what is a good way of finding the coordinates of $\beta$ and $\gamma$?
Do synthetic division to see that
Do synthetic division to see that
Then the other roots are just
$$\beta,\gamma = {-\alpha\pm \sqrt{12-3\alpha^2}\over 2}$$
Now, the discriminant here must be a square in the field, and as $\alpha$ is an algebraic integer, the other roots are also integers, and so we suspect that if
$$12-3\alpha^2 = (a\alpha^2+b\alpha+c)^2$$
then let's guess $b=1$ since that will cancel with the $-\alpha$, and further we suspect that $a, b$ are both even so that division by $2$ in the denominator will keep them in the $\Bbb Z$-module spanned by $1,\alpha,\alpha^2$.
Writing
$$12-3\alpha^2 = (2k\alpha^2+\alpha + 2j)^2$$ $$=4k^2\alpha^4+\alpha^2+4j^2+2(2k\alpha^3+4kj\alpha^2+2j\alpha)$$ $$=4k^2(3\alpha^2-\alpha)+\alpha^2+4j^2+2(2k(3\alpha-1)+4kj\alpha^2+2j\alpha)$$
We conclude
$$\begin{cases} j^2-k = 3 \\ 3k-k^2+j=0 \\ 3k^2+2kj = -1 \end{cases}$$
which seems onerous, but the last one gives us $k=\pm 1$ since $k$ is a divisor of a unit, and using that with the first shows $j^2=4$ i.e. $j=\pm 2$. Checking against the second one, we see $3k+j = 1$ so $k=1, j=-2$ works and we get one solution is $\beta = \alpha^2 -2$. And clearly the opposite will still square to this, so negating all the coefficients verifies $\gamma = -\alpha^2-\alpha+2$. The image of $\alpha^2$ is the image of $\alpha$, squared, i.e. is $\beta^2$, so we square this to get:
$$\beta^2 = \alpha^4-4\alpha^2+4 = 3\alpha^2-\alpha-4\alpha^2+4 = -\alpha^2-\alpha + 4$$
So our matrix for a generator of the Galois group which corresponds to the permutation $\alpha\mapsto\beta\mapsto\gamma$ is just
We can even confirm that $\sigma^3= I$, the $3\times 3$ identity matrix, verifying its order.