Lucy is 2 years older than Sam. The sum of the squares of their ages is 52. How old are Lucy and Sam

if Sam's age is x, then

x^2 + (x+2)^2 = 52
you can do the math, but note that
4^2 + 6^2 = 52