Sub topic 8
The space diagonal: √(l² + w² + h²)
What this chapter assumes
You should already be comfortable with the Pythagorean theorem, the volume and surface area of a rectangular solid, and basic algebra with square roots. This chapter builds on the surface area chapter. It adds one new formula and shows the situations where the GRE uses it.
Two kinds of diagonal
A rectangular solid has two kinds of diagonal.
- A face diagonal lies in one face. It connects two opposite corners of a rectangle.
- The space diagonal passes through the inside of the solid. It connects two corners that share no face, such as the bottom front-left corner and the top back-right corner.
A rectangular solid has four space diagonals. All four have the same length. The space diagonal is the longest straight segment that fits inside the solid. A straight rod, for example, fits in a box only if its length is at most the space diagonal.
Deriving the formula
Take a box with length l, width w and height h. Label the bottom face ABCD and put the corner A at the origin.
- Find the diagonal of the bottom face. The bottom face is a rectangle with sides l and w. By the Pythagorean theorem, its diagonal d satisfies d² = l² + w².
- Build a second right triangle. One leg is the bottom-face diagonal d. The other leg is a vertical edge of height h. The space diagonal D is the hypotenuse. The vertical edge is perpendicular to the floor, so it is perpendicular to every line in the floor, including d. That makes the triangle a right triangle.
- Apply the theorem again: D² = d² + h².
- Substitute d² = l² + w² to get D² = l² + w² + h².
So the space diagonal is
D = √(l² + w² + h²)
The result extends the two-dimensional rule. A rectangle with sides a and b has diagonal √(a² + b²). A box adds a third squared term under the root.
A worked example
A box measures 3 by 4 by 12.
- Squares: 3² = 9, 4² = 16, 12² = 144.
- Sum: 9 + 16 + 144 = 169.
- Root: √169 = 13.
The space diagonal is 13. You can check this in code.
import math
l, w, h = 3, 4, 12
diagonal = math.sqrt(l**2 + w**2 + h**2)
print(diagonal) # 13.0This box also has volume 144 and surface area 192, as the earlier chapters showed. The three quantities answer different questions. Volume measures the space inside the box. Surface area measures the material needed to cover it. The space diagonal measures the longest straight distance inside it.
Special case: the cube
A cube with edge s has l = w = h = s. The formula becomes
D = √(s² + s² + s²) = √(3s²) = s√3
The face diagonal of a cube is s√2, and the space diagonal is s√3. Memorize both. They are the same numbers you know from the 45-45-90 triangle (the ratio 1 : 1 : √2) and its three-dimensional counterpart.
| Edge s | Face diagonal s√2 | Space diagonal s√3 |
|---|---|---|
| 1 | √2 ≈ 1.41 | √3 ≈ 1.73 |
| 2 | 2√2 ≈ 2.83 | 2√3 ≈ 3.46 |
| 5 | 5√2 ≈ 7.07 | 5√3 ≈ 8.66 |
If a GRE problem gives the space diagonal of a cube, work backward. A cube with space diagonal 6√3 has edge 6. A cube with space diagonal 12 has edge 12/√3 = 4√3.
Pythagorean quadruples
The GRE prefers boxes whose space diagonal is a whole number. Sets of four whole numbers (l, w, h, D) with l² + w² + h² = D² are called Pythagorean quadruples. These are worth recognizing, because they let you skip the arithmetic.
| l | w | h | D |
|---|---|---|---|
| 1 | 2 | 2 | 3 |
| 2 | 3 | 6 | 7 |
| 2 | 4 | 4 | 6 |
| 3 | 4 | 12 | 13 |
| 4 | 4 | 7 | 9 |
| 2 | 10 | 11 | 15 |
Multiples work too. Doubling (1, 2, 2, 3) gives (2, 4, 4, 6). Tripling gives (3, 6, 6, 9).
Working backward from the diagonal
Some problems give the diagonal and one or two edges, then ask for the missing edge. Square both sides first.
A box has a square base with side 4 and a space diagonal of 9. Find its height.
- Write D² = l² + w² + h², so 81 = 16 + 16 + h².
- Then h² = 81 − 32 = 49.
- So h = 7.
This matches the quadruple (4, 4, 7, 9) in the table.
Another common form gives the face diagonal along with an edge. If the base diagonal is d, then D² = d² + h². You can skip the l² + w² step entirely, because d² already equals l² + w².
Face diagonals as a shortcut
Suppose a problem gives the three face diagonals of a box and asks for the space diagonal. Call the face diagonals a, b and c.
- a² = l² + w²
- b² = l² + h²
- c² = w² + h²
Adding the three equations gives a² + b² + c² = 2(l² + w² + h²). So
D² = (a² + b² + c²) / 2
You do not need to solve for l, w and h individually. For example, if the face diagonals are √13, √20 and √25, then D² = (13 + 20 + 25)/2 = 29, and D = √29.
Distances between other points
The same idea gives the distance between any two points in three-dimensional space, not just opposite corners. If two points differ by a in one direction, b in another and c in the third, the distance is √(a² + b² + c²). A point at the center of a box and a corner differ by half of each dimension, so that distance is half the space diagonal.
A fly walking from one corner to the opposite corner along the surface must travel farther than the space diagonal. The space diagonal is the shortest path through the interior, and the surface path is longer. The GRE rarely asks about surface paths, but be aware that the space diagonal is a straight line through the air inside the box.
Common errors
- Adding the dimensions before squaring. The formula is √(l² + w² + h²). It is not l + w + h, and it is not √(l + w + h)². Check with a 1 by 1 by 1 cube: the diagonal is √3 ≈ 1.73, not 3.
- Using only two dimensions. A learner who writes √(l² + w²) has found the base diagonal, not the space diagonal.
- Forgetting the root. If you stop at 169 in the example above, you have found D², not D.
- Splitting the root. √(9 + 16) is not √9 + √16. Add under the root first.
- Mixing units. If one edge is in feet and another is in inches, convert before squaring.
- Assuming a non-rectangular solid. The formula needs right angles at every corner. It does not apply to a slanted box (a parallelepiped).
Bounds you can use to estimate
Because the GRE often allows estimation, these bounds help.
- D is greater than the largest edge.
- D is less than l + w + h.
- D ≤ √3 × (largest edge), with equality only for a cube.
For a 3 by 4 by 12 box, D must be between 12 and 19. The answer 13 sits inside that range. If an answer choice says 20, you can discard it without computing.
How the formula appears on the GRE
The question rarely asks "find the space diagonal" directly. The diagonal tends to appear in these forms.
- A rod, pole or wire placed in a box. Question: what is the longest rod that fits? Answer: the space diagonal.
- A cube with a stated diagonal. Question: what is its volume or surface area? Find s from s√3, then cube or square it.
- A Quantitative Comparison. Quantity A is the space diagonal of a 2 by 3 by 6 box. Quantity B is 7. Since 4 + 9 + 36 = 49, the two quantities are equal.
- A rectangular solid with a given diagonal and a ratio of edges. For edges in the ratio 1 : 2 : 2 with diagonal 12, let the edges be k, 2k and 2k. Then k² + 4k² + 4k² = 144, so 9k² = 144 and k = 4. The edges are 4, 8 and 8.
In the last case, you can also reason by quadruples. The ratio 1 : 2 : 2 has diagonal 3 in the base case, and 12 = 4 × 3, so the scale factor is 4.
Putting it together
import math
def space_diagonal(l, w, h):
return math.sqrt(l**2 + w**2 + h**2)
def missing_edge(diagonal, a, b):
return math.sqrt(diagonal**2 - a**2 - b**2)
print(space_diagonal(3, 4, 12)) # 13.0
print(space_diagonal(1, 1, 1)) # 1.7320508075688772
print(missing_edge(9, 4, 4)) # 7.0Exercises
Exercise
A rectangular box has edges 2, 3 and 6. What is the length of its space diagonal?
Show answer
D² = 4 + 9 + 36 = 49, so D = 7.
Exercise
A cube has a space diagonal of 9√3. What is its surface area?
Show answer
The space diagonal of a cube is s√3, so s = 9. The surface area is 6s² = 6 × 81 = 486.
Exercise
A box has a square base with side 6 and a height h. Its space diagonal is 11. Find h.
Show answer
D² = 36 + 36 + h² = 121, so h² = 49 and h = 7.
Exercise
The three face diagonals of a rectangular box have lengths √10, √17 and √13. What is the space diagonal?
Show answer
D² = (10 + 17 + 13)/2 = 20, so D = √20 = 2√5.