How to find the space diagonal of a rectangular prism

The longest diagonal of a rectangular box runs through the inside from one corner to the opposite corner. We can find its length by starting with the diagonal across the base, then including the height.

Use the Pythagorean theorem twice

Let the length, width, and height be l, w, and h. The base is a rectangle, so its diagonal b is the hypotenuse of a right triangle with legs l and w. The base diagonal and the vertical height make another right triangle, whose hypotenuse is the space diagonal d.

b2=l2+w2d2=b2+h2=l2+w2+h2d=l2+w2+h2

Find the diagonal when the dimensions use different units

The box has a base measuring 12 cm by 7 cm and a height of 60 mm. Because 10 mm=1 cm, the height is 6 cm. Now we can use centimeters for all three measurements.

The base and space diagonals of a rectangular prismThe prism is twelve centimeters wide, seven centimeters deep and sixty millimeters tall. The dashed line b crosses the base. The plum line connects the opposite corners through the prism.db12 cm60 mm7 cm
The dashed base diagonal and a vertical edge form a right triangle with the plum space diagonal.
d=122+72+62cm=229cm

The exact length is 229 cm, or about 15.13 cm.

Find a missing width when the diagonal is given

Now the length is 5, the height is 3, and the diagonal is 72. Use the squared version of the formula so we can isolate w2.

A prism with an unknown widthThe prism has height three, depth five, unknown width, and an interior diagonal of seven square roots of two. The dashed line b crosses the base. The plum line connects the opposite corners through the prism.7√2bw35
The dashed base diagonal and a vertical edge form a right triangle with the plum space diagonal.
(72)2=52+w2+3298=34+w2w2=64

A width is a positive length, so w=8.