Visualize the distance traveled as the two side lengths of a right triangle, for this we can use the pythagorean theorem to solve for the hypotenuse (which is the shortest distance from his house to his office).
a²+b²=c²
6²+4²=c²
36+16=c²
52=c²
7.21=c
Answer=7.21km