Let x be the larger number and y = smaller number
Then, x - y = 5. So, y = x - 5
x2 - (x-5)2 = 45
x2 - (x2 - 10x + 25) = 45
10x - 25 = 45
10x = 70
x = 7 and y = x-5 = 2