If there is a tunnel along the diameter of Earth, and then a ball is thrown in to it, it goes through the tunnel.
The ball gets accelerated continuously. The acceleration due to gravity decreases as the ball reaches the center of Earth. g is proportional to the distance between the ball and the center of Earth.
So when the ball reaches the center of Earth, it has the maximum speed. Then when the ball passes to the other side of the center, the acceleration due to gravity acts in the opposite direction to the velocity. So the ball slows down. The ball reaches the other end of the tunnel. Then it stops there.
Now again the ball is attracted by the gravity, so it falls in to the tunnel. Thus the ball executes a SHM through the tunnel between the ends of the tunnel.
M = 4 π R³ /3 = mass of Earth
M' = mass of Earth enclosed by a radius x = M x³ / R³
F = m a = - m d² x / d t²
F = G M' m / x² = (G M m / R³) x
=> d² x / d t² = - (G M / R³) x
This equation shows that the ball executes a SHM with an angular frequency ω .
ω = √ [G M / R³]
Time period = 2 π / ω = 2 π √R³ / √ [GM ]
= 2 π * √6371000³ / √(6.67 * 10⁻¹¹ * 6 *10²⁴)
= 5050.71 seconds
= 1 hour 24 minutes 10.7 seconds
So the ball goes to the other end of the diameter of Earth and returns back in the above timer period.
simpler way of calculating the time period or angular frequency:
d² x / d t² = acceleration = - (G M /R³) x = - (g / R) x
=> ω = √[g/R ]
T = 2 π √[R/g]
= 2 π √[6,400,000/10] sec
= 1600 π sec
= 5026 seconds... nearly same as the above value..