For this problem, we use the derived equations for rectilinear motion at constant acceleration. The equations used for this problem are:
a = (v - v₀)/t
2ax = v² - v₀²
where
a is the acceleration
x is the distance
v is the final velocity
v₀ is the initial velocity
t is the time
The solution is as follows;
a = (60mph - 30 mph)/(3 s * 1 h/3600 s)
a = 36,000 mph²
2(36,000 mph²)(x) = 60² - 30²
Solving for x,
x = 0.0375 miles
X Represents the distance the spring is stretched or compressed away from its equilibrium or rest position.
We have the equation of motion
, where v i the final velocity, u is the initial velocity, a is the acceleration and s is the displacement
Here final velocity, v = 40m/s
Initial velocity, u = 0 m/s
Displacement s = 2 m
Substituting 
So the baseball pitcher accelerates at 400m/
to release a ball at 40 m/s.