Apply Pythagorean theorem:
c^2 = a^2+b^2
Where:
c= hypotenuse (longest side )
a & b = the other 2 sides of the triangle
Replacing with the values (smaller triangle)
c^2 = 4^2 + 2^2
c = √4^2 + 2^2
c = √16+4
c=√20
c= 4.472 ( RT )
For the big triangle:
c^2 = a^2+ b^2
XZ^2 = XY^2 + 3^2
Since both triangles are similar :
2 x =3
x = 3/2 (ratio)
4*3/2= 6 (XY )