We can see that the top of the box is formed by 2 right triangles.
Since is a right triangle we can apply the Pythagorean theorem:
c^2 = a^2 + b^2
Where:
c= hypotenuse = x (the longest side)
a & b = the other 2 legs of the triangle
Replacing:
x^2 = 2^2+ 4^2
x^2 = 4 + 16
x^2 = 20
x = √20
x = 4.5 inches