When can the trajectories of a vector field be realized as geodesics? Suppose we have a smooth manifold $M$ and a vector field $X$ on $M$. Then the trajectories of $X$ are pairwise non-intersecting, and further, each trajectory is either injective or periodic. I'm wondering under what conditions there exists a Riemannian metric $g$ on $M$ such that the trajectories of $X$ are all geodesics.
A related problem is solved in Can every curve on a Riemannian manifold be interpreted as a geodesic of a given metric?. Here it is shown that any injective or periodic smooth curve can be realized as a geodesic. This makes me think that this problem should have an affirmative answer for all smooth vector fields.
From the Euler-Lagrange equation, I believe we can reduce this problem as follows: if $\gamma$ is a geodesics of $(M, g)$ (for a hypothetical metric $g$ satisfying the above), then
$$\frac{d^2 \gamma^k}{dt^2} + \Gamma_{ij}^k \frac{d\gamma^i}{dt} \frac{d\gamma^j}{dt} = 0 \tag{EL}$$
where $\Gamma_{ij}^k$ denotes the Christoffel symbols. If $\gamma$ is a trajectory of $X$, then
$$\frac{d\gamma^\ell}{dt} = X^\ell$$
for all $\ell$ (this is all in local coordinates). Then (EL) becomes
$$\frac{dX^k}{dt} + \Gamma_{ij}^k X^i X^j = 0$$
which perhaps makes this easier to solve.
More generally, does there always exist a metric tensor with a given set of Christoffel symbols (assuming they vary smoothly)? Certainly the metric would not be unique, but does existence always hold?
 A: This is not true in general. Note that the linked answer is only local, and making a single curve a geodesic is much simpler than making all integral curves into geodesics simultaneously.
As a counterexample, consider $\mathbb{R}$ with a standard global coordinate $x$ and corresponding vector field $\partial_x$. Define the vector field $V$ by $V(x)=x\partial_x$. The integral curves of $V$ are of the form $t\mapsto Ce^t$ for $C\in\mathbb{R}$. Suppose $g$ is a matric making these curves geodesics. It follows that $g(V,V)$ is constant on $(0,\infty)$ and thus the component $g(\partial_x,\partial_x)$ diverges as $t\to 0^+$, so no such metric can be smoothly extended to all of $\mathbb{R}$.
There is a (limited) local version that works, though: given a point $x\in M$ with $V(x)\neq 0$, there is a neighborhood $U\ni x$ and a local metric $g$ on $U$ such that the integral curves of $V|_U$ are geodesics with respect to $g$. To see this, choose adapted coordinates around $x$ such that $V=\partial/\partial x^0$, and use the Euclidean metric induced by those coordintes.
A: In Kajelad's answer, she/he mentions that if $V(x)\neq 0$, then one can locally find a metric making the trajectories into geodesics.  I wanted to add another answer which indicates why that hypothesis is important.  It also provides another obstruction to finding a Riemannian metric having the vector field trajectories as geodesics.
Consider the vector field $V$ on $\mathbb{R}^2$ obtained by rotation around the origin.
The trajectories are all circles, except that the origin is a fixed point since $V(0) = 0$.
I claim that there is no Riemannian metric on any neighborhood of $0$ for which all the trajectories in the neighborhood are geodesics.
To see this, first recall that for any point $p$ in a Riemannian manifold, we can always find a totally normal neighborhood $U$ about $p$.  In such a neighborhood, given any two points $q_1,q_2\in U$, there is a unique geodesic connecting them which lies entirely in $U$.
As a consequence, a totally normal neighborhood cannot contain a closed geodesic.  For if $\gamma:[0,1]\rightarrow U$ is a closed geodesic which is injective except that $\gamma(0) = \gamma(1)$, then the points $\gamma(0)$ and $\gamma(1/2)$ have two minimizing geodesics between them, corresponding to following $\gamma$ in both directions.
Now, for the specific example of $V$ on $\mathbb{R}^2$, any neighborhood of $0$ clearly contains a closed trajectory.  Hence, no neighborhood of $0$ can be a totally normal neighborhood with respect to any Riemannian metric, so there must not be a Riemannian metric even locally defined which has all of $V$s trajectories as geodesics.
