To solve for x, you can use the Pythagorean theorem. The Pythagorean theorem is a squared+b squared=c squared, when a and b are the feet and c is the hypotenuse.
I'm going to put in the values I already know:
40(40)+9(9)=x(x)
1600+81=x(x)
1681=x(x)
41=x
The value of x is 41. Good luck!