Let R={m+n(2)^(1/2)|m,n are integers}

Show that m+n(2)^(1/2) is a unit in R if and only if m^2-2n^2=+-1

I know a we have a unit a if ab=1.

I was given a hint to try (m+n(2)^(1/2))(x+y(2)^(1/2))=1 then(m-n(2)^(1/2))(x-y(2)^(1/2))=1 and multiply the 2 equations, but I don't understand the reasoning for this hint.