# How to find an ODE with prescribed terminal values?

Let us consider an ODE $$\frac{dx_t^y}{dt}=g(x_t^y),$$ where y is the initial condition i.e. $x_0^y=y$.

Now, given a function $f$ (increasing and smooth) is it possible to find $g$ (i.e. an ODE) such that $$x_1^y = f(y).$$

The motivation comes from the study of particular flows on the bi-dimensional torus and their first return map. The specific question is quite long to explain in detail, but if you are interested I can try to state it better

Note added by B. Kloeckner: this is the improved version of the question, pasted from math.SE. I voted to reopen this version, as I think the question, while deserving this improvement by its authors, was unduly migrated, possibly because some of the voters did not realize that the ODE to be found is autonomous.

Aded in edit: as pointed out by Christian Remling, my answer assumes implicitly that $f'$ never vanish.
Assume $g$ exists as wanted, let $y$ be a point not fixed by $f$ (if $y$ is fixed then we set $g(y)=0$), and let $x$ be the solution of $x'=g(x)$ such that $x(0)=y$. Then by separating variables, we get $$\int_0^1 \frac{x'(t)}{g(x(t))} dt = 1$$ then by using the variable $u=x(t)$, we get $$\int_y^{f(y)} \frac{du}{g(u)} =1$$ Denoting by $G$ an antiderivative of $1/g$ (which must be well defined away from the fixed points of $f$), we are reduced to solve the functional equation $$G\circ f - G =1.$$ Now, given the structure of the line, it is not difficult to construct solutions of this equation by chosing them almost arbitrarily on a fundamental domain and then extend by the functional equation... but this works only on each interval between two fixed points of $f$. The issue of gluing these solutions at fixed points to get a decent $g$ seems not so easy to me (note that $G$ diverges at fixed points, which is pretty unsurprising given that $g$ should vanish there). However, in some cases (e.g. $f$ has no fixed point), it can certainly be done.
In this generality, the answer is no, for the simple reason that a flow always has a positive derivative, so no $f$ with $f'=0$ somewhere can be realized in this way. (Such an $f$ could be fixed point free, of course.)
To spell this out more explicitly, if $\phi_t(y)$ denotes the flow of $\dot{x}=g(x)$, then $u(t;y)=d\phi_t(y)/dy$ obeys$$\dot{u} = g'(u(t;y)) u , \quad\quad u(0)=1 .$$ This is solved by $u(t)=\exp(\int_0^t g'(u(s))\, ds)$; in particular, $u>0$ always, as claimed.