Problem involving Newtonian Gravity and a tunnel through the Earth

Homework Statement

The problem is: Consider a tunnel that connects any two points A and B on the spherical Earth (assuming constant density). The tunnel is a vacuum, and the train traveling through the tunnel is travelling on a frictionless track with no engine (i.e. it is just falling through the tunnel). Show that the transit time is independent of the positions (e.g. San Fran to LA, or NYC to Sydney). How long is the ride?

Homework Equations

g=-G*integral(dv*rho(r)/r^2[direction vector])
volume integral
a=dv/dt

The Attempt at a Solution

The only thing that I can think of is integrating the function that determines the g value to get the velocity and somehow showing that has a constant time not dependent on the distance that the "train" travels. Could anyone give me some insight? Thanks in advance.

Dick
Homework Helper
The magnitude of g at a radius r is linearly proportional to r since the mass contained is proportional to r^3. Now draw a chord passing through the earth and use trig to find the component of g parallel to the chord as a function of distance from the center of the chord. You will find that it is a linear function of the distance and the constant of proportionality is the same for all chords. They are all harmonic oscillators with the same spring constant.

The magnitude of g at a radius r is linearly proportional to r since the mass contained is proportional to r^3. Now draw a chord passing through the earth and use trig to find the component of g parallel to the chord as a function of distance from the center of the chord. You will find that it is a linear function of the distance and the constant of proportionality is the same for all chords. They are all harmonic oscillators with the same spring constant.

Can you please show the calculation. I tried the question, but I'm not getting the component as directly proportional to distance from mean position. Please reply as soon as possible.

Dick