These two triangles are congruent by the hypotenuse leg theorem

since we already know the triangles are congruent by HL, that simply means that
x - y = x + 2
and
2x - y = 4x + 2y
therefore
[tex] \bf \stackrel{Legs}{x-y=x+2}\implies -y=2\implies \boxed{y=-2}\\\\
-------------------------------\\\\
\stackrel{Hypotenuses}{2x-y=4x+2y}\implies 2x-(\stackrel{y}{-2})=4x+2(\stackrel{y}{-2})\implies 2x+2=4x-4
\\\\\\
6=2x\implies \cfrac{6}{2}=x\implies \boxed{3=x} [/tex]