Explanation:
First, let us find the magic sum in each row/column/diagonal.
Sum of numbers from 1 to 9 = 45.
45 divide by 3 rows = 15 each row.
The magic sum is 15.
For the diagonals, we have:
8 + 5 + x = Magic sum = 15,
6 + 5 + y = Magic sum = 15.
Therefore x = 2 and y = 4.