I am to find an equation for the time it takes when one falls through a planet to the other side and returns to the starting point. I have seven different sets of values - mass of object falling, mass of planet, radius of the planet, and time. I'm not including friction in the calculations.
I think this qualifies as a harmonic oscillator, and thus I work with the formula
$$T = 2\pi \sqrt{\frac{m}{k}}$$
To find the spring constant $k$ I need force $F$, and this is where I get uncertain. Should I work with the gravitational force between the object and the planet when the fall begins? In other words
$$F = G\times\frac{m \times M}{R^2}$$
When I try this I find that
$$F = kx \iff k = \frac{F}{x}$$
$$\iff k = \frac{G\times\frac{m \times M}{R^2}}{2R} = \frac{G \times m \times M}{2R^3}$$
$$\Rightarrow T = 2\pi \sqrt{\frac{m}{\frac{G \times m \times M}{2R^3}}} \iff T = 2\pi \sqrt{\frac{2R^3}{G \times M}}$$
Using this equation for the values I have, however, I get the wrong results - $T = 7148$ instead of $T = 5055$. What am I doing wrong?