# Converting a function for “velocity vs. position”, $v(x)$, to “position vs. time”, $p(t)$

Provided some initial point $x(0)$, how do I convert the function for velocity vs. position, $v(x)$, into a function for position vs. time, $x(t)$, with time derivative $v(x(t))$? Constant acceleration is not guaranteed. Surely this must always be possible?

• Short answer: integration / solving a differential equation. Long answer is first a bunch of questions: Is your "position" x or p(t) just a real number — that is, do you have a particle moving along a line? Also, is $v(x)$ guaranteed to correspond to some actual motion? Do you know the position $p(t)$ for at least one time $t$? – ShreevatsaR Jul 30 '11 at 12:47
• @ShreevatsaR, the particle is moving along a line, so the position should be a real number. Also we know the initial position of the particle, p(0). And it is safe to assume that v(x) is a smooth function. – B.M. Jul 30 '11 at 12:53
• @ShreevatsaR, actually, I would also be interested in the case where the particle is moving in more than one dimension and we are provided a velocity vector. – B.M. Jul 30 '11 at 12:55
• I'm worried that you're using both $x$ and $p$ to mean position. I'd phrase the question this way (at least in one dimension): there's an unknown function $x(t)$, whose time-derivative is called $v(t)$, and we know $v(x)$; how do we recover $x(t)$? – Gerry Myerson Jul 30 '11 at 13:27
• @Gerry, thanks, I rewrote the question! – B.M. Jul 30 '11 at 13:41

## 4 Answers

In one dimension and assuming that the velocity is never zero, the velocity at time $t$ is $v(x(t))$ and also $\displaystyle\frac{\mathrm{d}}{\mathrm{d}t}x(t)$, hence $\mathrm{d}t=\displaystyle\frac{\mathrm{d}x}{v(x)}$, which is solved by $$t=\int_{x(0)}^{x(t)}\frac{\mathrm{d}z}{v(z)}.$$ This can be rewritten as follows: for every $q$, let $$U(q)=\int_{0}^{q}\frac{\mathrm{d}z}{v(z)},$$ then, for every nonnegative $t$, $t=U(x(t))-u_0$ with $u_0=U(x(0))$, hence $$x(t)=U^{-1}(t+u_0).$$ Example If $v(x)=\mathrm{e}^{−x}$, then $U(q)=\mathrm{e}^{q}−1$ hence $U^{−1}(s)=\log(1+s)$ and $u_0=\mathrm{e}^{x(0)}−1$, which gives $x(t)=\log(\mathrm{e}^{x(0)}+t)$ for every nonnegative $t$.

• If p(t) is part of the definite integral for the function U(q), how are we able to ultimately find p(t)? – B.M. Jul 30 '11 at 14:04
• As I wrote: by inverting the function $U$. For example, if $v(x)=e^{-x}$, then $U(q)=e^q-1$ hence $U^{-1}(s)=\log(1+s)$ and $u_0=e^{p(0)}-1$, which gives $p(t)=\log(e^{p(0)}+t)$. (By the way, $p(t)$ is not part of the definition of $U$.) – Did Jul 30 '11 at 14:36
• Note that the two comments above refer to a previous version of the notations in the question, where roughly speaking, one used p for x. – Did Jul 30 '11 at 15:12
• very clear now, thank you! – B.M. Jul 30 '11 at 15:33

This is an attempt to solve the 2-D case. Let $p = (x,y)$ be a general position. Then we are given constraints of the form: $$\begin{eqnarray*} \frac{\mathrm{d}x}{\mathrm{d}t}=f(x,y) \\ \frac{\mathrm{d}y}{\mathrm{d}t}=g(x,y) \end{eqnarray*}$$ Then applying the chain rule to eliminate the variable $t$, $$\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{g(x,y)}{f(x,y)}.$$ This is a quite general differential equation and I think there is no neat way to write out the solution. But assuming we could solve this, we get $y$ as a function of $x$. Now, plugging this in the first constraint $\frac{\mathrm{d}x}{\mathrm{d}t} = f(x, y(x))$, we get the 1-D version of OP's problem. Now, we can use the solution of @Did to write down $x(t)$. The general solution is then $p = (x(t), y(x(t)))$.

The above explanation was very handwavy and I do not know what details are needed to make this rigorous. (E.g.:, should I worry about the existence of solutions to the differential equation? Could there be multiple solutions? and so on).

$[x+a]/e=[x+b]/f=[z+c]/g=[w+d]/h$; $\{x,y,z,w\}=$ space-time or space-velocity?

• What do these variables mean and how do these formulas relate to the question? – robjohn Dec 26 '12 at 13:43

This is a question that bothered me as a student. Here is a numerical way of thinking about it.

We know the definition of $\vec{v} = \frac{d}{dt} \vec{x}$. This means that if we know $\vec{v}(t_0)$ we can use it time find $x$ at some later time. In particular we can write the following provided that $\Delta t$ is small enough, $$\vec{x}(t_0 + \Delta t) = \vec{x}(t_0) + \vec{v}(t_0) \Delta t.$$

The velocity as a function of position tells you how fast you should be going when you are at a particular location. This means that provided with an initial position $\vec{x}_0$ you can tell which direction you should travel in and how fast you should do it. In particular notice that the statement "how fast" relates the scale for your time values to the scale of your position values.

Since we know $\vec{v}(x)$ we can remove the time dependence from our first equation and rewrite it as.

$$\vec{x}_n = \vec{x}_{n-1} + \vec{v}(\vec{x}_{n-1}) \Delta t, \qquad \vec{x}_n=\vec{x}(t_0+n\Delta t).$$

From this you can see that time is coming into the equation labeling the various values for $x$. If you start out with an initial position $\vec{x}_0$ and a function $\vec{v}(\vec{x})$ you can use this numerical scheme to produce a table of values for $\vec{x}$ as a function of the time.

An important way to think of $\frac{d\vec{x}}{dt}=\vec{v}(\vec{x})$ is as a vector field which defines the flow of the trajectories. You hear these flow lines called the "integral curves of the vector field $\vec{v}(\vec{x})$". There are some special situations in which this can be solved analytically, but the numerical approach in much more general and contains all of the conceptual content.

If you are interested in more analytical treatment then you should check out the second chapter of the book "Introduction to Partial Differential Equations with Applications" by E.C Zachmanoglou and Dale W. Thoe this is a Dover publication so its pretty cheap. This deals with methods of finding the integral curves and surfaces of vector fields.