In every case, the Pythagorean theorem applies.
The square of the hypotenuse is equal to the sum of the squares of the other two sides. You may need to do some addition or subtraction and root-taking to find the value of interest.
4. 6^2 = 4^2 +x^2
.. x = √(36 -16) = 2√5