When sparrow flies into the wind, its speed is (x-1) km/h.
When is flies in the direction of the wind, its speed is (x+1) km/h.
Therefore time taken to fly to the nest = Distance/speed = 12 /(x-1).
Also time taken to fly back = 12 / (x+1).
Total time taken = 5 hrs.
Therefore [12/(x-1)] + [12/(x+1)] = 5
On simplifying, this reduces to 5x² - 24x - 5 = 0
5x² - 25x + x - 5 = 0
5x(x-5) + (x - 5) = 0
(x - 5)(5x + 1) = 0
Hence speed of sparrow in still air = 5.