9514 1404 393
Answer:
 yes, about 2.05 inches
Step-by-step explanation:
The Pythagorean theorem can be used to find the width of the TV.
 w^2 +h^2 = d^2
 w = √(d^2 -h^2)
 w = √(42^2 -18^2) = √1440 = 12√10
 w ≈ 37.95 . . . inches
This dimension is less than 40 inches by a margin of ...
 40 -37.95 = 2.05 . . . inches
The TV will fit, with 2.05 inches of space remaining.