If the speed of the wind is w mph, the overall speed with the wind is 10+w and against it is 10-w.
The time taken to ride 4 miles in each direction is 4/(10+w)+4/(10-w)=1 because time=distance/speed.
Multiply through by (10-w)(10+w): 4(10-w)+4(10+w)=100-w².
So 40+40=100-w², w²=20, w=√20=2√5=4.472 mph.