The sides of two squares differ by 25cm while the sum of their areas is 2425cm. What is the length of the sides of each square.

I know the answer--45&20 but I don't know the step by step solution.
(40)-(20)=25
(40)^2+(20)^2=2425
2025+400=2425
Please give the solution Sir & Mam.. Thank you

x and x+25

x^2 + x^2 + 50 x + 625 = 2425 cm^2

2 x^2 + 50 x - 1800 = 0

x^2 + 25 x - 900 = 0

(x-20)(x+45) = 0

x = 20
x+25 = 45