Solve the given system of equations

System of equations is:

 x1 + 2x2 - 3x3 = 9
2x1 -  x2 +  x3 = 0
4x1 -  x2 +  x3 = 4


I start by creating the augmented matrix for this system:

1   2 -3  | 9
2  -1  1  | 0
4  -1  1  | 4


I then want to reduce this to row-echelon form. I must have missed an easier path, because the numbers were not so pretty. I'll list out the steps, and then give the final result.

R2 = R2 -  2R1
R3 = R3 -  4R1
R2 = -1/5R2
R3 = -1/9R3
R3 = R3 - R2
R3 = -45/2R2

Reduced-echelon form:
1   2   -3   | 9
0   1   -7/5 | -18/5
0   0   1    | -161


Using the reduced matrix and back substitution, we get our variables

x3 = -161
x2 = -229
x1 = -16


Here's the problem, when I substitute these numbers into the equations they all check out except for the middle one:

2x1 - x2 + x3 = 0
2(-16) + 229 - 161 = 36
36 != 0


Where did I go wrong? Also, if anyone see's an obviously better way to reduce the matrix please feel free to share. I seem to always struggle with these by missing the easier "moves".

Simpler method -

eq$3$ - eq$2$ gives $2x_1=4 ; x_1 =2$

from eq$3$ , $x_2-x_3=4 \implies 2x_2-2x_3=8$

from eq$1$ , $2x_2-3x_3=7$

from these two, $x_3=1$ and then $x_2 =5$

Where did I go wrong?

This is difficult to answer when you did not write the full solution. However, if I follow the same steps as you wrote in your question, I get:

$$\left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 2 &-1 & 1 & 0 \\ 4 &-1 & 1 & 4 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 0 &-5 & 7 &-18\\ 4 &-1 & 1 & 4 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 0 &-5 & 7 &-18\\ 0 &-9 & 13&-32 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 0 & 1 &-\frac75 & \frac{18}5\\ 0 & 1 &-\frac{13}9& \frac{32}9 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 0 & 1 &-\frac75 & \frac{18}5\\ 0 & 0 &-\frac{2}{45}& -\frac{2}{45} \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 0 & 1 &-\frac75 & \frac{18}5\\ 0 & 0 & 1 & 1 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 & 0 &12\\ 0 & 1 & 0 & 5\\ 0 & 0 & 1 & 1 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2\\ 0 & 1 & 0 & 5\\ 0 & 0 & 1 & 1 \end{array}\right)$$

I will also add a link to another answer of mine, where I explained one possibility how to find in which step you made a mistake.

Also, if anyone see's an obviously better way to reduce the matrix please feel free to share.

This was already explained in another answer. But if you want to write the same thing in the matrix form, you can do it like this:

$$\left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 2 &-1 & 1 & 0 \\ 4 &-1 & 1 & 4 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 2 &-1 & 1 & 0 \\ 2 & 0 & 0 & 4 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 2 &-3 & 9 \\ 2 &-1 & 1 & 0 \\ 1 & 0 & 0 & 2 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 2 &-1 & 1 & 0 \\ 1 & 2 &-3 & 9 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 &-1 & 1 &-4 \\ 0 & 2 &-3 & 7 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 &-1 & 1 &-4 \\ 0 & 0 &-1 &-1 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 &-1 & 0 &-5 \\ 0 & 0 &-1 &-1 \end{array}\right)\sim \left(\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 5 \\ 0 & 0 & 1 & 1 \end{array}\right)$$