Hi,
Let x represent the length of one of the legs, then (21-x) would be the other leg
Applying the Pythagorean Theorem
x^2 + (21-x)^2 = 15^2
x^2 + 441 - 42x + x^2 = 225
2x^2 -42x + 216 = 0
x^2 -21x + 108 = 0
(x-12)(x-9) = 0
x= 12
x= 9
legs are 9in and 12in (21in - 9in)