Let's call the lengths of the rectangular prism x, y, and z. The problem tells us that the sum of the edges is 40, so we can write:
x + y + z = 40
The problem also says that the surface area is 48. That means:
2(xy +yz + xz) = 48
Realize that if we square (x + y + z), that is equal to :
(x^2 + y^2 + z^2 + 2xy + 2xz + 2yz), or :
(x^2 + y^2 + z^2) + 2(xy + xz + yz)
(try expanding it out yourself if you want!)
(x^2 + y^2 + z^2 ) + 48 (since the surface area is 48. See how the substitution works?).
This is then equal to 1600(40 ^2).
Subtracting 48 on both sides, we get:
(x^2 + y^2 + z^2) = 1552
What's important to realize here is that the question asks us for the space diagonal(the diagonal connecting opposite corners of the prism). The general formula for the length of a space diagonal in a rectangular prism is: sqrt(x^2 + y^2 + z^2). This can be derived from using pythagorean theorem if you really want to see for yourself.
That means our desired diagonal length is sqrt(1552), which is simplifies to : 4sqrt(97)