You can put this solution on YOUR website! Let O be the stating point and OP be the distance travelled north and PQ be the distance travelled east and SQ be the distance south. Let R be the point on SQ such that OPQR forms a square of side 5 mi.
SQ = 17 and RQ = OP = PQ = RO = 5mi therefore SR = SQ - RQ = 17-5 = 12
Then
X = 13
He is 13 mi far from his house.