.
From the condition, you have 2 equations
x + y = 17. (1)
x^2 - y^2 = 17. (2)
Factor equation (2)
(x+y)*(x-y) = 17.
Replace here x+y by 17, based on equation (1). You will get
17*(x-y) = 17, or x-y = 1.
Thus, instead of equations (1) and (2), you have much simpler system
x + y = 17 (3)
x - y = 1 (4)
Add the equations, and get 2x - 19, x = 9.
Hence, y = 17-9 = 8.
ANSWER. The sides of the square are 9 cm and 8 cm.
Solved.