You'd use the Pythagorean theorem for this since it's a right triangle.
[tex]a^2+b^2=c^2[/tex]
So plug in your given numbers to get: [tex]9^2+40^2=x^2[/tex]
Then solve:
[tex]81+1600=x^2[/tex]
[tex]1681=x^2[/tex]
[tex] \sqrt{1681}= \sqrt{x^2}[/tex]
[tex]41=x[/tex]