# Gravity where acceleration is changing

1. Oct 15, 2008

### okkvlt

I have a question about gravity:

How do i formulate an equation that incorporates the change in distance between two objects- in other words, where the acceleration due to gravity is changing as the distance changes, instead of simply where the acceleration is held constant. Here's how far ive gotten:

y=-.5ax^2+sx+d
where y is location(distance) and x is time. s is initial velocity and d is initial location and a is acceleration due to gravity.
But just one simple change and things become much more complicated.
Suppose i want to include the change in acceleration.
I use a=gm/d^2 where a is the acceleration, g is the gravitational constant, m is the mass of the planet, and d is distance.
Which means d^2y/dx^2=gm/y^2, so y'' is a function of y and not a function of x. That's my problem. How do i integrate the derivative when the derivative is a function of the dependent variable? I need to know the function of x that equals y in order to integrate, but i need to integrate to find the function of x that equals y. So im kind of left going in circles trying to solve an impossible problem.

I cant figure out how to integrate this.
I could try integrating to find dx/dy, which would be the inverse of velocity(time/distance instead of distance/time), and manipulate that to get something meaningful, but im unsure whether thats even possible.
I dont think i can simply replace a with gm/y^2, but im not sure because this is really confusing me. when i differentiate implicitly to find velocity after replacing a with gm/y^2, i get dy/dx=f[x,y]. Now i have to differentiate velocity=dy/dx to find acceleration=d^2y/dx^2 and verify whether the second derivative equals gm/y^2. But how do i find the second derivative when the first derivative is a function of both variables? this seems to be related to the problem that y'' is a function of y, and y is a function of both x and y''. That's why i dont think i can simply replace a with gm/y^2. The problem is, whenever i would evaluate y at a moment in x after replacing a with gm/y^2, it will be as if the acceleration at that moment in time has been the acceleration at all previous times. But then again, im not sure.
I think whats happening here is the function itself actually changes into another function as the variables change. This is really confusing me.

The only way i figure i can solve this is by splitting space(splitting time would be simpler because i wouldnt have to solve a million quadratics, but i dont think incrementalizing time would be as accurate.) into increments. I would solve the first problem, then plug the variables and its derivatives at the end of that increment into the next problem, adjust for acceleration using gm/y^2, solve the next problem, and then keep repeating that over and over until i go insane from mindless calculations, knowing that i havent actually solved the dynamics of the problem. Theres no freaking way im going to attempt that.

2. Oct 15, 2008

### Hootenanny

Staff Emeritus
The equation

$$y^{\prime\prime}= \frac{gm}{y^2}$$

is a special case of a second order non-linear ode, which can be solved quite straight forwardly to determine y' (speed). However, one cannot solve this ode to obtain a closed form solution for y (distance) as a function of time. One can however, obtain a closed form solution for x (time) in terms of y (distance).

Let

$$\frac{dy}{dx} = v\left(y\right)$$

Then by the chain rule

$$\frac{d^2 y}{dx^2} = \frac{d}{dx}v = \frac{dv}{dy}\frac{dy}{dx} = \frac{dv}{dy}v$$

Hence the ode becomes,

$$\frac{dv}{dy}v = \frac{gm}{y^2}$$

Which is first order and separable. We can integrate to determine the velocity as a function of distance.

$$\Rightarrow v\left(y\right) = \frac{dy}{dx} = -\frac{gm}{y} + c$$

This first order ode is again separable,

$$\frac{dy}{dx}\frac{1}{\left(gm/y\right)+c} = -1$$

$$\frac{dy}{dx}\left(\frac{1}{c} - \frac{gm}{c\left(gm + cy\right)}\right) = -1$$

Integrating

$$\Rightarrow \frac{y}{c} - \frac{gm}{c^2}\ln\left|gm+cy\right| = c^\prime-x$$

Here you should be able to see that one cannot solve this equation to obtain y=y(x). However, we have determined time as a function of distance as promised.

I hope that this was helpful.

Last edited: Oct 16, 2008
3. Oct 16, 2008

### ibc

didn't you mean, $$\frac{v^2}{2}$$ on the left side?

4. Oct 16, 2008

### Hootenanny

Staff Emeritus
Whoops! Thanks for pointing that out, I'll correct my post above now.

5. Oct 16, 2008

### Hootenanny

Staff Emeritus
Correcting my post #2 above (I thought it looked a little too nice),

$$\Rightarrow v\left(y\right) = \frac{dy}{dx} = \sqrt{2c -\frac{2gm}{y}}$$

This first order ode is again separable,

$$\int\frac{dy}{ \sqrt{2c -\frac{2gm}{y}}} = \int dx$$

Which integrates (horrendously) to,

$$x = \frac{\sqrt{cy}\left(cy-gm\right) + gm\ln\left|2\left(\sqrt{cy} + \sqrt{cy-gm}\right)\right|\sqrt{-(gm) + cy}}{c^{3/2}\sqrt{2}\sqrt{cy - gm}}$$

Which definitely doesn't have a closed form solution for y=y(x).

My apologies again for the mistake.

Last edited: Oct 17, 2008
6. Oct 17, 2008