Solution (source code)

= Solution

The <geodesics of the product-weighted diagonal plane metric> follow from the <geodesic Lagrangian> $L=(y^2\dot x^2+x^2\dot y^2)/2$. With dots denoting an <affine parameter> <derivative>, its <Euler-Lagrange equations> give
$$
\boxed{\begin{aligned}
y^2\ddot x+2y\dot y\dot x-x\dot y^2&=0,\\
x^2\ddot y+2x\dot x\dot y-y\dot x^2&=0.
\end{aligned}}
$$
Substituting $y=mx$ with constant nonzero $m$ reduces both equations to $x\ddot x+\dot x^2=0$. Thus $x\dot x$ is constant, and a suitable affine parametrization exists; explicitly, $x^2=C_1\lambda+C_2$ on a segment of fixed sign.

\b[These straight rays are <geodesics> only in the regular domain $xy\ne0$.] The <metric tensor> <determinant> is $x^2y^2$. On the axes, including the origin, this is a <degenerate metric tensor>: the calculation does not establish a regular <geodesic> continuing through the origin. The slope-zero ray is outside the regular domain. Geometrically, on each quadrant the change $\rho=|xy|/\sqrt2$, $\vartheta=\log|y/x|$ gives $ds^2=d\rho^2+\rho^2d\vartheta^2$. A fixed slope has constant $\vartheta$ and is therefore locally a radial <geodesic> of a flat <metric tensor>.