General formula to find the sides of right triangle is
a² + b² = c²
c stands for the hypotenuse
We can assume a stands for the shorter leg and b is the longer leg, the equation will be
b = a + 2
a = b - 2
Now input the number to the formula
a² + b² = c²
(b-2)² + b² = 8²
b² - 4b + 4 + b² = 64
2b² - 4b + 4 - 64 = 0
2b² - 4b - 60 = 0
b² - 2b - 30 = 0
Work the equation by completing the square
b² - 2b - 30 = 0
b² - 2b = 30
b² - 2b + 1 = 30 + 1
(b + 1)² = 31
b + 1 = √31
b = -1 + √31
b = -1 + 5.5678
b = 4.5678
b = 4.6
The longer leg is approximately 4.6