Calculus/physics question: vertical trajectory derivation

THIS IS NOT HOMEWORK, I am almost far too old to be doing that! :wink:

I was (for some reaosn) playing with the gravitational attraction equation, trying to integrate it over time to get to a closed form equation for vertical distance.

Lets say we are on the moon (no atmosphere) and fire a gun vertically.

assume: F = G.m1.m2/r^2 (Newtonian physics)
acceleration = force/mass, so from the bullets perspective:
a = G.m1/r^2 (a = acceleration)

I want ‘a’ as a function of ‘t’ = time, remembering that r changes over time so
a(t) = G.m/r(t)^2

In this analysis r increases as you go up, and the direction of a is down. Next I want to get to an equation for speed (s) as a function of t, I get:
s(t) = -(G.m/r(t)^2)t + si (si = initial speed)

I’m pretty sure the above step is wrong. I think I need to be taking into consideration the chain rule and/or product rule, but I will continue, to demonstrate my problem.

Next I want distance/radius (r) as a function of t, I get:
r(t) = -(G.m/2.r(t)^2)t^2 + si.t + ri (rs = initial distance).
Clearly I cant have an equation for r that contains itself as an input.
How is this supposed to be done?

Yup, this is an error. In particular, if a(t) isn’t constant with respect to time, then it’s not true that s(t) = a(t) * t; rather, it’s

s(t) = Integral( a(t’) dt’)

where the integral runs from 0 to t. But unfortunately, it’s not so simple, since (as you noted) you don’t know a(t) directly; the unknown function r(t) enters into the equation.

Really you have a differential equation here, of the form

r’'(t) = G m / r(t)[sup]2[/sup]

and you’re looking for a function r(t) that satisfies this equation. The standard method to solve equations of this form goes as follows: multiply both sides of the original equation by r’(t). Then we have

r’(t) r’‘(t) = G m r’(t) / r(t)[sup]2[/sup]

which implies that

d/dt ( r’(t)[sup]2[/sup] / 2) = d/dt ( - G m / r(t) )

(use the chain rule to see why this is so.) Since these two functions of time have the same derivative, they differ by at most a constant:

r’(t)[sup]2[/sup] / 2 = - G m / r(t) + C[sub]1[/sub]

where C[sub]1[/sub] is determined by requiring that this equation be true when t = 0. Then you will have

dr/dt = sqrt( 2 C[sub]1[/sub] - G m / r )

This equation can be integrated again — it’s what’s called a separable equation — to get a general relation between r and t.

I followed you all the way there, got stuck on your last line.

if r’(t)[sup]2[/sup] / 2 = - G m / r(t) + C[sub]1[/sub] then
r’(t)[sup]2[/sup] = - 2 G m / r(t) + 2C[sub]1[/sub]
r’(t) = sqrt(- 2 G m / r(t) + 2C[sub]1[/sub]) correct? (assuming dr/dt = r’(t))

Also, in your final line r(t) changed to r. Is this a typo?
Finally, it seems we don’t yet have dr/dt in terms of t and some constants (which I imagine is a milestone towards getting r as a function of t and some constants.) as we still have a function (r(t)) as an element of r’(t).

I hope I’m making sense:confused:

This is correct; I forgot the factor of 2 on the G m/r term in my last equation. Sorry about that.

More a change of notation. r will always be a function of t, but I just got tired of typing it out.

The link I posted explains this fairly tersely, but here’s an expanded version of it. If we have a differential equation dy/dx = f(y), we can rearrange it [checks to see if any mathematicians are around] to read

dx = dy / f(y)

and then integrate it to yield

(x - x[sub]0[/sub]) = Integral[sub]y(0)[/sub][sup]y[/sup] ( 1/f(y’) ) dy’

This gives us x as a function of y, rather than y as a function of x. But if we’re lucky, we can invert the function x(y) to get y(x). In your case, you have t in the role of x and r(t) in the role of y(x); so you can integrate the equation in terms of r’(t) and r(t) using this method to get t(r), and then invert the equation.

I think your understanding is correct. Unfortunately, the final resulting differential equation is non-linear, so there probably isn’t a closed form solution. :frowning:

I should also note that your original equation is actually the wrong one to be thinking about: you have the force on the bullet directed away from the Moon (i.e., in the positive r-direction). You should flip the sign of G if you want your bullet to fall back to the Moon.

Well, it’s a separable equation, so we can at least get t(r). However, the forms of resulting integrals (assuming that the bullet is falling — see above) depend on the value of C[sub]1[/sub] you end up picking to enforce the initial conditions. I don’t believe that the resulting integrals for t(r) are invertible unless C[sub]1[/sub] = 0.

By the way, C[sub]1[/sub] is very closely related to the total energy (kinetic plus potential) of the bullet; it’s actually equal to E divided by the mass of the bullet. C[sub]1[/sub] < 0 then means the bullet doesn’t have sufficient energy to escape the Moon’s gravity; C[sub]1[/sub] ≥ 0 means that the bullet is fired with sufficient kinetic energy to escape the Moon’s gravity.

Just pointing out that a physicist or engineer would ask how far you’re expecting the bullet to get; if it’s not too far (compared to the radius of the moon) then you can write r(t) = r0+h(t) (where r0 is the radius of the surface of the moon).

Now rewrite a = -G.m /(r0+h)^2 = G.m /(r0^2 + 2r0 h + h^2). If h is significantly less than r0, then you can drop h^2 as insignificant compared to r0^2 and get an easier equation.

And of course if h is very much less than r0, then you can drop the 2r0h part as well, and get the ridiculously easy constant acceleration equation
h’’(t) = -G m /r0^2

Btw, this bullet is fired vertically, so it either lands back on the guy with the guy or goes off into space.

I find this difficult to accept.

I will try to apply this again (I did scratch my brain for a while last night) but I don’t rate my chances very highly.

One of the important things to remember in dealing with separable equations is that in principle, if we have r(t) then that tells us t® as well. There are some exceptions (we’ll see one below)

Here’s the full solution. I’ve enclosed it in a couple spoiler boxes if you want to reveal only part of it at a time. The first spoiler box deals with setting up the integrals; the other three deal with applying the initial conditions to get t®.

[spoiler]
First, let’s redefine our constants: let A = 2 C[sub]1[/sub] and B = 2 G M. Our differential equation is then

dr/dt = √( 2 C[sub]1[/sub] + 2 G m/r ),

which means that

dr/√( 2 C[sub]1[/sub] + 2 G m/r ) = dt

and so

∫ dr’/√( 2 C[sub]1[/sub] + 2 G m/r’ ) = t®

where the limits of the integration on the left-hand side are from r[sub]0[/sub] (the radius at t = 0) to r. Evaluating this integral then gives us t®, and we cross our fingers that we can invert it to get r(t). However, this integral has different forms depending on the sign of C[sub]1[/sub], which we’ll treat separately below. Note, however, that C[sub]1[/sub] is completely determined by r’[sub]0[/sub] (the bullet’s speed at t = 0) and r[sub]0[/sub], as shown in Post #2.[/spoiler]C[sub]1[/sub] = 0:

[spoiler]If C[sub]1[/sub] = 0, things are simple: our integral becomes

∫ √(r’ / 2 G m) dr’ = t®

and so

√2(r[sup]3/2[/sup] - r[sub]0[/sub][sup]3/2[/sup])/ (3√(G m)) = t.

This equation can be inverted to get r(t):

r(t) = (3 √(G m/2) t + r[sub]0[/sub][sup]3/2[/sup])[sup]2/3[/sup].

This case corresponds to the bullet being fired with a speed exactly equal to the escape velocity of the body the astronaut is standing on.
[/spoiler]C[sub]1[/sub] > 0: [spoiler]
For C[sub]1[/sub] > 0, the integral is

∫ 1/√( 2 C[sub]1[/sub] + 2 G m/r’ ) dr’ = t®

This integral is ugly, but can be shown to be

t® = [√(2 C[sub]1[/sub] r (2 C[sub]1[/sub] r + 2 G m)) - √(2 C[sub]1[/sub] r[sub]0[/sub] (2 C[sub]1[/sub] r[sub]0[/sub] + 2 G m)) - 2 G m sinh[sup]-1[/sup](√( C[sub]1[/sub] r/ G m)) + 2 G m sinh[sup]-1[/sup](√( C[sub]1[/sub] r[sub]0[/sub]/ G m))] /(2 C[sub]1[/sub])[sup]3/2[/sup].

“sinh[sup]-1[/sup]” here is the inverse of the hyperbolic sine function; it can also be written out in terms of logarithms. If you can invert this equation to get r(t), you’re a better mathematician than I am. This case corresponds to the bullet being fired with an initial speed greater than escape velocity.[/spoiler]C[sub]1[/sub] < 0:[spoiler]Here, we have to be careful: in this case, the integrand

∫ 1/√( 2 C[sub]1[/sub] + 2 G m/r’ ) dr’

is divergent at a particular value of r’. This particular r’ value corresponds to the highest point of the bullet’s trajectory: we’re looking in this case at a bullet fired with less than escape velocity, meaning that it’ll eventually get turned around and fall back onto the astronaut if he doesn’t get out of the way. However, if we take r to be below the apex of the bullet’s trajectory, we find that

t® = [-√(-2 C[sub]1[/sub] r (2 C[sub]1[/sub] r + 2 G m)) + √(-2 C[sub]1[/sub] r[sub]0[/sub] (2 C[sub]1[/sub] r[sub]0[/sub] + 2 G m)) + 2 G m sin[sup]-1[/sup](√( -C[sub]1[/sub] r/ G m)) - 2 G m sin[sup]-1[/sup](√( - C[sub]1[/sub] r[sub]0[/sub]/ G m))] /(2 C[sub]1[/sub])[sup]3/2[/sup].

Again, if you can invert this one, you’re a better mathematician than I am.[/spoiler]

If you want a more mathematician-palatable way to achieve this. Try writing it instead as:

1/f(y(x)) * dy/dx = 1

Then integrate both sides with respect to x.

∫[1/f(y(x)) * dy/dx]dx = x + C

And then apply the change of variable theorem to the left integral to get.

∫[1/f(y)]dy = x + C

Which is the same result, just without living in constant fear of your first-year calculus TA rising from the grave to dock you marks for treating dy/dx as if it was a fraction.

Wouldn’t it be great if you did invert it and it simplified into something much shorter… wishful thinking!

If one were to enter this into Mathematica/Matlab, can one of those programs to the inverting automatically? I seem to recall that they can do many symbolic transformations such as differentiation, integration, factorisation for you.

I just gave Mathematica a whirl. No dice. However, you can use the ParametricPlot function in Mathematica (there’s probably an equivalent function in Matlab) to make a plot of r(t), for whatever that’s worth.