There is a planet with a straight tunnel through it which does not pass trough the center.
I want to solve how a mass will move in that tunnel.
This is what i have done
By Gauss' law, the gravity for some $r<R$ is $\mathbf g(r) = -k r\mathbf{\hat r} $, where $k$ is a constant.
By Newton's second law,
$\begin{align} m\ddot r &= mg\\ &=-mkr \\ \Rightarrow & \ddot r + kr=0 \end{align}$
Since the tunnel does not pass though the center, $r$ satisfies that $r\cos\phi=a$. Where $\phi$ is the angle measured from $x$-axis (the origin is in the center of the planet).
Using chain rule, $\ddot r$ can be written as \begin{align} \ddot r = \dfrac{d}{dt}\dfrac{dr}{dt}= \dfrac{d}{dt}\left( \dfrac{dr}{d\phi} \dfrac{d\phi}{dt}\right)= \dfrac{dr}{d\phi} \dfrac{d^2\phi}{dt^2}=r'\ddot\phi \end{align}
Then, taking the derivative of $r$ with respect to $\phi$ and substituting into the equation of motion gives,
\begin{align} r'\ddot\phi+kr&=a\ddot\phi \sec\phi \tan\phi + ka\sec\phi=0 \\ \Rightarrow & \ddot\phi\tan\phi+k=0 \\ \Rightarrow & \ddot\phi+k\cot\phi=0 \end{align}
My question
I ask for if my condition for $r$ ($r\cos\phi=a$) is correct, or there is something that i missing. Does not the differential equation for $\phi$ must lineal or similar to an harmonic oscillator eq?
In the case in which my equations are right. How to solve that kind of eqs.?
Any suggestion will be helpful.
