Let the side of the squares be x and y meters.
According to the condition,
x2 + y2 = 500
4x – 4y = 40
(x – y) = 10
y = x – 10
Substituting the value of y in, we get
x2 + (x – 10)2 – 500
2x2 – 20x – 400 = 0
x2 – 10x – 200 = 0
x = 20 or x = – 10
As the side cannot be negative, x = 20
Hence, side of the first square, x = 20 m
Side of the second square, y = 20 – 10 = 10 m