I have been trying to solve an exercice I found on a book. It is about a geodesic on the surface of a cone. The answer is plainly provided at the end of the book without any hint or detail and my calculations lead nowhere near the answer, so help would be appreciated. I am interested in the development of this problem which should be done by calculus of variations.
I now cite the instructions and answer as found on the book.
Determine the equation of the curve giving the shortest distance between two points on the surface of a cone parameterized as:
$r^2=x^2+y^2$
$z=r\cot\alpha$
The answer provided at the end of the book states that:
$\theta = \alpha$
$r\sin\alpha = \frac{c_2}{\cos(\phi\sin\alpha+c_1)}$
My attempt to a solution
One can find the shortest path by minimizing the following integral :
\begin{equation} I = \int ds = \int\sqrt{dx^2+dy^2+dz^2} \end{equation}
With some development, and assuming (it is not provided by the book instructions) that $x=\cos\theta$ and $y=\sin\theta$ :
\begin{equation} ds = \sqrt{dr^2+rd\theta^2+dz^2} = \sqrt{dr^2(1+\cot^2\alpha) + r^2\dot\theta^2} = \sqrt{\csc^2\alpha + r^2\dot\theta^2}dr \end{equation}
where $\dot\theta=\frac{d\theta}{dr}$.
Now $I$ becomes
\begin{equation} I = \int\Phi(r,\dot\theta)dr \end{equation}
where $\Phi(r,\dot\theta)=\sqrt{\csc^2\alpha + r^2\dot\theta^2}$. So $I$ will be minimised if $\Phi(r,\dot\theta)$ fills the Euler-Lagrange condition
\begin{equation} \frac{d}{dr}\frac{\partial\Phi}{\partial\dot\theta} - \frac{\partial\Phi}{\partial\theta}=0 \end{equation}
where $\frac{\partial\Phi}{\partial\theta}=0$ because $\Phi(r,\dot\theta)$ does not explicitly depend on $\theta$. Also, since $\frac{d}{dr}\frac{\partial\Phi}{\partial\dot\theta} = 0$, this imposes that
\begin{equation} \frac{\partial\Phi}{\partial\dot\theta} = \frac{r^2\dot\theta}{\sqrt{\csc^2\alpha + r^2\dot\theta^2}} = k \end{equation}
where $k$ is a constant. This last equation leads to
\begin{equation} \dot\theta = \frac{k\csc\alpha}{r\sqrt{r^2-k^2}}. \end{equation}
A possible solution on $r$ for this differential equation can be $r=k\sec\varphi$. So we can come up with $dr=k\sec\varphi\tan\varphi d\varphi$ which can be uses for the integration of $\dot\theta$. Also, remembering that $\sec^2\varphi-1=\tan^2\varphi$, one can deduce that $\sqrt{r^2-k^2} = k\tan\varphi$, so that
\begin{equation} \int d\theta = \int\frac{k^2\csc\alpha \sec\varphi\tan\varphi}{k^2\sec\varphi \tan\varphi} = \int\csc\alpha d\varphi = \varphi\csc\alpha. \end{equation}
And by integrating the left hand side, we come up with
\begin{equation} \theta + c_1 = \varphi\csc\alpha \end{equation}
where $c_1$ is an arbitrary integration constant. Finally, remembering that we set $r=k\sec\varphi$, we end up with
\begin{equation} \cos(\csc\alpha)=\frac{r\cos(\theta+c_1)}{k} \end{equation}
which is clearly different from the solution provided by the book. What am I doing wrong and what should I be doing?