To determine how many miles Theden needs to hike on the third day to finish the trail, we can subtract the distance he hiked on the first two days from the total trail distance:
Total trail distance = 40 miles
Distance hiked on first day = 12.8 miles
Distance hiked on second day = 16.9 miles
Total distance hiked on first two days = 12.8 + 16.9 = 29.7 miles
Distance left to hike on the third day = 40 - 29.7 = 10.3 miles
Therefore, Theden needs to hike 10.3 miles on the third day to finish the trail.