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