First times both sides by m and n at the same time to get rid of the fractions. This will give you:
xn + n^2 m = xm + m^2 n
Then take x terms to one side:
xn - xm = n^2 m + m^2 n
Factorise the left hand side to get:
x(n-m) = n^2 m + m^2 n
Divide both sides by (n-m) to get x on its own and the answer:
x = (n^2 m / (n-m)) + (m^2 n / (n-m))
Hope this helps. I believe the question would’ve been asking for it to be in terms of x.