Let the hypotenuse = c
One of the legs = c - 80
The other leg = c - 40
(c - 80)^2 + (c - 40)^2 = c^2 Expand the left hand side.
c^2 - 160c + 6400 + c^2 - 80c + 1600 = c^2 Subtract c^2 from both sides.
c^2 - 160c + 6400 + c^2 - c^2 - 80c + 1600 = 0 Combine like terms.
c^2 - 240c + 8000 = 0
(c - 200)(c - 40) is how that factors. It looks like you have two solutions. You don't. Not really
(c - 200) = 0
c - 200 = 0
c = 200
The other solution is
c - 40 = 0
c = 40
The last solution does not work. Why? It's because the let that was forty smaller than c would give that leg a length of 40 - 40 = 0
So c = 200
The lengths of the triangle are
c (the hypotenuse) = 200
The next leg = 200 - 40 = 160
The third leg = 200 - 80 = 120
Check
a^2 + b^2 = c^2
120^2 + 160^2 = 200^2
14400 + 25600 = 40000
40000 = 40000
They check