# Finding an expression for x(t)

1. Mar 19, 2013

### crimpedupcan

Suppose I have a particle on a line, and I know some function a(x) and the initial x, v, and a. How could I work out x(t)?

2. Mar 19, 2013

### mikeph

integrate!

v(t) = integral of a(t)dt + v(t=0)
x(t) = integral of v(t)dt + x(t=0)

3. Mar 19, 2013

### crimpedupcan

From what I understand your solution requires me to know a(t), but what can I do if I only know a(x)?

4. Mar 19, 2013

### mikeph

Ah, then you have:

x''(t) = f(x(t))

This is a 2nd order autonomous differential equation with a general solution, although if f is tricky then you might need a numerical integrator to solve it. The trick is to multiply through by 2x'(t) then factor the left side into ((x'(t))^2)'. Then you can find x(t) by integrating, taking the square root, and integrating again.

5. Mar 19, 2013

### crimpedupcan

Thanks a lot!
I think I've seen that method applied before to simple harmonic motion, I wish I made the connection earlier.

6. Mar 19, 2013

### mikeph

No problem. It caught me a little off guard as well!

7. Mar 19, 2013

### phyzguy

If you only know a(x), you can use the following:
$$\frac{dv}{dt} = \frac{dv}{dx}\frac{dx}{dt} = v \frac{dv}{dx} = a(x)$$
Then:
$$\int v dv = \frac{v^2}{2}= \int a(x) dx$$
After integrating, this can be solved for v(x). Then:
$$\frac{dx}{dt} = v(x)$$
$$\int dt = t = \int \frac{dx}{v(x)}$$
After integrating, this gives t(x), which can then be inverted to give x(t). This procedure can be complicated and mathematically difficult, but it will work, at least numerically.

8. Mar 19, 2013

### crimpedupcan

Thank you, that's exactly what I was looking for

9. Mar 19, 2013

### stevendaryl

Staff Emeritus
[deleted]

I just repeated the same thing that phyzguy said.