The diagonal is the hypotenuse of a right triangle so the diagonal would be the result of using the Pythagorean theorem

c^2 = 9^2 + 40^2

c^2 = 81 + 1600

c^2 = 1681

c = 41 inches

So the diagonal (hypotenuse) of a 9 in x 40 in rectangle is 41 inches (remember a rectangle has right angles like a square does, the only difference between a rectangle and a square is that the length and height of the square are the same, whereas the length and height of a rectangle are different)