The side lengths of a right triangle are
;
.
Apply Pythagorean theorem: 
(Substitute 30 for a and 40 for b)
(Evaluate powers:
)
(Add:
)
(Apply square root on each side)
(Write
)
(Cancel sqaure and root)
The length of the hypotenuse is
.