Optimization problem: The curve with the minimum time to get through a pile of quicksand - Calculus of Variations Suppose we have a function for the velocity given by $v(r,\theta)=r$, or in Cartesian form $v(x,y)=\sqrt{x^2+y^2}$. As we can see below, as we get closer to the origin $(0,0)$, the velocity decreases. I've found it easy to visualize the field as being some form of quicksand where it is harder to move through as you approach the origin.
This is demonstrated below by a plot I've made using Wolfram Mathematica:

What I am trying to do: Find the two functions for $y(x)$ which would minimize the time taken to get from point $A(-1,0)$ and $B(1,0)$.

I deduced that the fastest path cannot be the straight line directly from $A$ to $B$, since it would require an infinite time to get through the origin. A guess for the two curves is shown by the $\color{#0050B0}{\text{dark blue}}$ and the $\color{#00AAAA}{\text{light blue}}$ curves I've made. I'm almost certain they would be symmetrical. I've first guessed that the optimized curve would be similar to an ellipse, however I hesitated after I've plotted this.
I've done some research on the problem and figured it may be similar to the derivation of the Brachistochrone curve, using the Euler-Lagrange equations.
I am new to the Calculus of Variations, so here is the working I've done so far.
We have:
$$dt=\frac{ds}{v} \Rightarrow dt=\frac{\sqrt{dx^2+dy^2}}{\sqrt{x^2+y^2}} \Rightarrow dt=\frac{\sqrt{r^2+\left(\frac{dr}{d\theta}\right)^2}}{r}~d\theta$$
On the third step I converted it to polar coordinates. Adding integration signs:
$$\int_{0}^{T}~dt=\int_{\theta_1}^{\theta_2}\frac{\sqrt{r^2+\left(\frac{dr}{d\theta}\right)^2}}{r}~d\theta$$
$$T=\int_{\theta_1}^{\theta_2} \sqrt{1+\frac{(r')^2}{r^2}}~d\theta$$
Where $T$ is the total time taken to get from $A$ to $B$. I thought of using the following Euler-Lagrange Equation:
$$\frac{d}{d\theta}\left(\frac{\partial L}{\partial r'}\right)=\frac{\partial L}{\partial r} \tag{1}$$
For the functional:
$$L(\theta,r,r')=\sqrt{1+\frac{(r')^2}{r^2}}$$
Evaluating partial derivatives:
$$\frac{dL}{dr}=-\frac{(r')^2}{r^3\sqrt{\frac{(r')^2}{r^2}+1}}=-\frac{(r')^2}{r^2\sqrt{(r')^2+r^2}}$$
$$\frac{dL}{dr'}=\frac{r'}{r^2\sqrt{\frac{(r')^2}{r^2}+1}}=\frac{r'}{r\sqrt{(r')^2+r^2}}$$
Substituting into $(1)$:
$$\frac{d}{d\theta}\left(\frac{r'}{r\sqrt{(r')^2+r^2}}\right)=-\frac{(r')^2}{r^2\sqrt{(r')^2+r^2}}$$
I integrated both sides with respect to $\theta$ and obtained:
$$\frac{r'}{r\sqrt{(r')^2+r^2}}=-\frac{(r')^2\theta}{r^2\sqrt{(r')^2+r^2}}+C \tag{2}$$
Now, I realize I must solve this differential equation. I've tried simplifying it to obtain:
$$r\frac{dr}{d\theta}=-\left(\frac{dr}{d\theta}\right)^2\theta+Cr^2\sqrt{\left(\frac{dr}{d\theta}\right)^2+r^2} \tag{3}$$
However, I think I've hit a dead end. I'm not certain that it is solvable in terms of elementary functions. Both Mathematica and Wolfram|Alpha have not given me a solution to this differential equation.

To conclude, I would like some guidance on how to continue solving the differential equation, assuming I have done the calculation and methodology correctly so far. If I have not done the correct methodology, I would appreciate some guidance on how to proceed with the problem.
 A: I think we can do without variational calculus. 
Write the curve going from $B$ to $A$ in the form
$$\gamma:\quad\theta\mapsto{\bf z}(\theta):=e^{u(\theta)}(\cos\theta,\sin\theta)\qquad(0\leq\theta\leq\pi)\ .$$Then
$$ds=\sqrt{r^2+r'^2}\>d\theta=\sqrt{1+u'^2(\theta)}\>e^{u(\theta)}\>d\theta\ ,$$
hence
$$dt={ds\over v\bigl({\bf z}(\theta)\bigr)}=\sqrt{1+u'^2(\theta)}\>d\theta\ .$$
It follows that we should minimize
$$T=\int_0^\pi\sqrt{1+u'^2(\theta)}\>d\theta$$
under the condition $u(0)=u(\pi)=0$. It is obvious that $u(\theta)\equiv0$ does the job. 
For general boundary data $A$, $B$ the pullback $\hat \gamma$ in the $(\theta,u)$-plane has to be a straight line, hence $\gamma$ will be an arc of a logarithmic spiral. 
A: Just to show that this can be done using the calculus of variations:  start with your functional
$$
L(\theta,r,r')=\sqrt{1+\frac{(r')^2}{r^2}}
$$
Now, we have that $\partial L/\partial \theta = 0$, which implies (via the Beltrami identity) that the quantity
$$
L - r' \frac{\partial L}{\partial r'} = C
$$
where $C$ is a constant with respect to $\theta$.  In your case, this implies that
$$
C = \sqrt{1+\frac{(r')^2}{r^2}} - r' \frac{r'/r^2}{\sqrt{1+\frac{(r')^2}{r^2}}} = \frac{1}{\sqrt{1+\frac{(r')^2}{r^2}}}
$$
Re-arranging, we find that
$$
\frac{r'}{r} = \sqrt{\frac{1}{C^2} - 1}
$$
which itself is another constant $D$;  thus, we have $r' = D r$, or $r = e^{D\theta}$ for some constant $D$.
