.
You are given
a + b = 25 (1)
a^2 + b^2 = 337. (2)
Square equation (1). Keep equation (2) as is. You will get
a^2 + 2ab + b^2 = 625 (1')
a^2 + b^2 = 337. (2')
From equation (1'), subtract equation (2'). You will get
2ab = 625 - 337 = 288, or
ab = 144.
Thus you need to find "a" and "b" in the way that
a + b = 25,
ab = 144.
You can reduce it to the quadratic equation a*(25-a) = 144 and solve it using Algebra.
But you can (alternatively) to guess the solution in 8 seconds.
ANSWER. The solution is two pairs (a,b) = (16,9) and (a,b) = (9,16).
Solved.
----------------
Be aware ! The solution and the answer 19 and 6 in the post by @josgarithmetic both are FATALLY WRONG (!)