The HORIZONTAL component of the initial velocity does not change (ignoring air friction or other outside forces).
The Horizontal component is given by
vo cos 40 where vo= original velocity
Wed are given that in FOUR seconds it travels 38.6 meters which is a horizotal component of 38.6/4 = 9.65 m/s
Now set these to quantities = to each other and solve for vo
vo cos 40 = 9.65
vo = 9.65 / (cos 40) = 12.597 m/s