The formula for the hypotenuse of a triangle is:
[a squared] plus [b squared] = c squared
a and b represent the two sides of the triangle.
You would have to square 8 and 4, add them, then take the square root of it to find the length of the hypotenuse.
The first equation is correct.