A pirate is on a hill looking at a building. The building is 400 feet tall. The angle of elevation from the pirate to the building is 4° and the angle of depression from the pirate to the bottom of the building is 2°. What is the shortest distance the pirate will need to travel to reach the building?

If the pirate is at horizontal distance x from the building, at the hill has height h, then

(400-h)/x = tan 4°
h/x = tan 2°
Eliminate h and you have

400 - x tan4° = x tan2°

Now you can find x. Assuming the pirate can fly horizontally, that is the shortest distance. Along the ground, no idea.

To find the shortest distance the pirate needs to travel to reach the building, we can use trigonometry. Specifically, we can use the tangent function.

First, let's draw a diagram to visualize the problem:

B
/|
/ |
400 / |
/ | x
/ |
/θ |
/____|
A

In this diagram, A represents the pirate, B represents the base of the building, and θ represents the angle of elevation from the pirate to the top of the building.

We know the height of the building (400 feet) and the angle of elevation (4°). Therefore, we can use the tangent function to find the distance AB.

The tangent of an angle is equal to the ratio of the opposite side to the adjacent side. In this case, the opposite side is 400 feet (the height of the building) and the adjacent side is AB (the shortest distance the pirate needs to travel).

Tangent(θ) = opposite / adjacent
Tangent(4°) = 400 / AB

To find AB, we rearrange the equation:
AB = 400 / Tangent(4°)

Now, we can calculate AB using a scientific calculator or an online trigonometric calculator. The tangent of 4° is approximately 0.0698.

AB = 400 / 0.0698
AB ≈ 5731 feet

Therefore, the shortest distance the pirate will need to travel to reach the building is approximately 5731 feet.