Answer:
The lengths of the legs are 12 and 35 units
Step-by-step explanation:
Let c represent the hypotenuse and a and b represent the legs.  Then the Pythagorean Theorem requires that a^2 + b^2 = c^2 = 37^2 = Hypotenuse^2
Also:  a + b + c = Perimeter = 84 units.  
Since c = 37 units, a + b + 37 units = 84 units, or a + b = 47 units, or a = 47 - b.
Then a^2 + b^2 = 37^2 becomes (47 - b)^2 + b^2 = 37^2, or 1369.  Therefore:
2209 - 94b + b^2 + b^2 = 1369.
Simplifying by combining like terms, we get:   
840 - 94b + 2b^2 = 0, which is a quadratic equation in standard form.
Reducing all terms by division by 2, we get:
420 - 47b + b^2 = 0.  Here the coefficients are a = 1, b = -47 and c = 420.
The discriminant is therefore b^2 - 4ac, or 529, whose square root is ± 23.
Then the b values of this quadratic in b are
 
       47 ± 23
b = -------------- , so that b is either 35 or 12
              2
and then side a has length a = 47 - b = 12  or  35.
Thus, a = 12 and b = 35, and c is given:  37.
Check:  Is 12^2 + 35^2 = 37^2 true?  Is 144 + 1225 = 1369?  YES
The lengths of the legs are 12 and 35 units.