This is a very easy determinant to calculate, but I get two different results when I calculate it in two different ways. \begin{equation} A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 2 & 2 & 4 \end{bmatrix} \end{equation}
When I used Laplace expansion right away I got: \begin{equation} \det(A) = 1 \cdot \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} - 0 \cdot \begin{bmatrix} 2 & 3 \\ 2 & 4 \end{bmatrix} + 2 \cdot \begin{bmatrix} 2 & 3 \\ 1 & 2\end{bmatrix} = 1 \cdot (4 - 4) + 2 \cdot (4 - 3) = 2 \end{equation}
But when I rearrange the rows in the matrix and then try to calculate the determinant: \begin{equation} A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 2 & 2 & 4 \\ \end{bmatrix} \overset{r_1 \leftarrow 2 \cdot r_1 - r_3}{\longrightarrow} \begin{bmatrix} 0 & 2 & 2 \\ 0 & 1 & 2 \\ 2 & 2 & 4 \\ \end{bmatrix}\\ \det(A) = 0 \cdot \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} - 0 \cdot \begin{bmatrix} 2 & 2 \\ 2 & 4 \end{bmatrix} + 2 \cdot \begin{bmatrix} 2 & 2 \\ 1 & 2\end{bmatrix} = 2 \cdot (4 - 2) = 4 \end{equation}
I have probably made a simple mistake, but I can't figure out where and I really want to get the basics down, before I move to harder examples.
The operation $r_1 \leftarrow 2r_1 - r_3$ does not preserve the determinant. Indeed, if you check the rules, the determinant is preserved if you subtract a multiple of a row from the actual other row (and not a multiple of it).
Suppose you did $r_1 \leftarrow r_1 - r_3$, then did Laplace expansion, things would work. Suppose you did $r_1 \leftarrow r_1 - 2r_3$ followed by Laplace expansion, then things would work. However, because you did changed $r_1$ to $2r_1$ during the row change, the determinant got multiplied by exactly $2$ , which came out to be the decisive factor in the end, since $\frac 42 = 2$.