The hypotenuse of a right triangle whose legs are consecutive whole numbers is 29 units. What is the sum of the lengths of the two legs?
I know that the Pythagorean theorem relates the lengths of the legs and the hypotenuse of a right triangle by the equation a^2 + b^2 = c^2, where a and b are the legs and c is the hypotenuse. Since the hypotenuse is 29, I can plug that into the equation and get a^2 + b^2 = 29^2. I also know that the legs are consecutive whole numbers, so I can assume that b = a + 1. If I substitute that into the equation, I get a^2 + (a + 1)^2 = 29^2. Expanding the square, I get a^2 + a^2 + 2a + 1 = 841. Combining like terms, I get 2a^2 + 2a - 840 = 0. Dividing both sides by 2, I get a^2 + a - 420 = 0. I recognize this as a quadratic equation that I can try to factor. I look for two numbers that multiply to -420 and add to 1. After some trial and error, I find that 21 and -20 work. So I can factor the equation as (a + 21)(a - 20) = 0. Setting each factor equal to zero, I get a = -21 or a = 20. Since a has to be a positive whole number, I reject the negative solution and take a = 20. Then b = a + 1 = 21. The sum of the lengths of the two legs is a + b = 20 + 21 = 41. 