Let w be the wind speed and p the plane's speed in still air.
Flying against the wind, the plane has velocity
p - w = 390 mi/h
and flying with it, it has
p + w = 470 mi/h
Add the two equations together to eliminate w and solve for p :
(p - w) + (p + w) = 390 mi/h + 470 mi/h
2p = 860 mi/h
p = 430 mi/h
Subtract them to eliminate p and solve for w :
(p - w) - (p + w) = 390 mi/h - 470 mi/h
-2w = -80 mi/h
w = 40 mi/h