Given: the point B(-1, 4) (the barn), the point H(5, 2) (the house). we need to find on the x-axis a point P(p, 0) such that sum of distances BP + PH will be the shortest.
Let reflect the point B across the x-axis. it will be the point B1(-1, -4). For any point P on the x-axis BP = B1P.
So if BP + PH will be the shortest, then B1P + PH will be the shortest too.
Points B1 and H are on different size of the x-axis. What is the shortest path from B1 to H? Of course, a straight line segment!
So, to find the point P, you should connect points B1(-1, -4) and H(5, 2) by the straight line and find the x-intercept of this line.
Hope, you can finish the rest yourself.