Question 860783
x^2 + (x + 17)^2 = 25^2
x^2 + x^2 + 34x + 289 = 625
2x^2 + 34x - 336 = 0
x^2 + 17x - 168 = 0
(x + 24)(x - 7) = 0
x = -24, x = 7


x has to be positive, so the shorter leg is 7 km and the longer leg is 24 km.


Alternatively, remember that 7, 24, and 25 make up a Pythagorean triple.