Can someone help me understand Cramer's Rule? I'm taking notes for my class and they define cramers rule and afterwards give us an example problem. 
\begin{align*}
x_1 + 2\,x_2 =& 2\\
-x_1 + 4\,x_2 =& 1
\end{align*}
They compute 
$$\det(a_1(b)) = \begin{vmatrix}2&2\\ 1&4\end{vmatrix}$$ 
and then they compute 
$$\det (a_2(b)) = \begin{vmatrix}1&2\\-1&1\end{vmatrix}\text{.}$$
I was wondering why for the first determinant the column 2,1 is before; however, for the second determinant the column 2,1 is after. Shouldn't the column 2,1 be the second column for both determinants.

No, the matrices are correct. 
For Cramer's rule, you replace the column corresponding to the variable with the column of numbers on the other side of the equals sign. As Amzoti pointed out, to get to the final answer, you divide both $\det(a_1)$ and $\det(a_2)$ by the same determinant of the matrix of the coefficients (with no replacement).
