A right triangle has two legs and a hypotenuse
a = shorter leg
b = longer leg
c = hypotenuse
We know b-a=4, or b = a+4
The Pythagorean theorem states:
a2 + b2 = c2
a2 + (a+4)2 = c2
a2 + (a+4)2 = 80
a2 + a2 + 8a + 16 = 80
Combine terms
2a2 + 8a - 64 = 0
Divide by 2
a2 + 4a - 32 = 0
Factor
(a+8)(a-4) = 0
a = 4, -8
We throw out the -8 solution because we can't have a negative measure.
So a = 4
b = 8
c = √80 = 4√5
The legs are 4 and 8.