from the diagram below 2nd row is multiplied by m1

1st and 3rd rows are swapped.

But i dont know how to do the rest of the row operations.

these are my workings without swapping (or doing any of the above first)

row 1 - (row 3 * m1)

= row 1 = 0 -m1 1 m1*g

row1 + (row 2 / m2 * m1 = 0 m1 m1/m2 m1g)

= row1 = 0 0 1+m1/m2 2*m1g*m2

swap row 1 and 3

multiply row 2 by m1

and thats it i think.

is this correct? is there an easier way to do this?