To find the length of any side of a right triangle, when the length of two of the sides are known, use the formula a squared plus b squared equals c squared. C is the diagonal. A and b are the two sides that are at right angles to each other.
You are looking for the diagonal, because that is how much coverage you need. You know the lengths of the two sides that are at right angles to each other, so you can figure it out:
5 inches squared plus 7 inches squared equals the diagonal squared.
Therefore 74 square inches = the diagonal squared.
You are trying to find c, but you have c squared at the present time. To eliminate the exponent on c squared, to just make it plain-ol' c, you can find the square root of c squared. You know this because the square root of something that is squared is obviously just the base number. After doing this, to make the equation continue to hold true, you must do the same to that which is the other side of the equals sign. Therefore, the square root of 74 square inches equals the diagonal (c).
So, the answer boils down to, what is the square root of 74? If you know your basic multiplication tables, you know it is not a whole number. So, it is slow if not impossible to get it exact in your head, but you can get close enough for this application. 8 inches x 8 inches = 64 square inches and 9 inches x 9 inches = 81 square inches, so the square root is somewhere in between the two. Let's just call it 8.5 inches (finding the square route also turns the units of square inches into plain-ol' inches). Seems close enough. Multiply that by approximately 25 to convert it to millimeters (25.4 to be exact, but I am trying to show how to do it without a calculator), and you get about 210 mm.
So, you need a lens that will cover about 210mm at the f/stop at which you will be setting it.