1. Nov 20, 2005

### goulio

I have the following equation to solve
$$\frac{df}{dx} = -a\frac{f(x)}{x^2}\left (\int_R^r u f(u) du - b \right )$$
with the boundary condition $f(\infty)=0$.

Any help greatly appreciated.

2. Nov 21, 2005

### saltydog

You know Goulio, I shall propose to you that you solve this equation by not solving it. Does that sound odd? Unless someone proposes a direct approach, I would recommend we consider simpler ones first:

$$f^{'}=-f(x)\int_0^1 uf(u)du;\quad f(0)=0$$

$$f^{'}=-f(x)\int_0^x uf(u)du;\quad f(0)=0$$

$$f^{'}=-xf(x)\int_0^x uf(u)du;\quad f(0)=0$$

$$f^{'}=-\frac{f(x)}{x}\int_0^x uf(u)du;\quad f(1)=0$$

. . . and so on until you gradually build up to the one you seek.

And I'm not proud: I would resort to numerical methods in a heartbeat. You know that some IDEs are handled nicely by a modified version of Runge-Kutta right? Just keep a running tally of the developing integral and add it to the results at every step.

Last edited: Nov 21, 2005
3. Nov 21, 2005

### HallsofIvy

Since $$\int_R^r uf(u)du$$ is a definite integral, it is a constant.

Start by letting $$A= \int_R^r uf(u)du- b$$
and solving the equation $$\frac{df}{dx}= -\frac{aA}{x^2}f$$.

4. Nov 21, 2005

### saltydog

5. Nov 21, 2005

### Physics Monkey

This is a continuation of a conversation goulio and I were having yesterday and unfortunately he has just copied the equation wrong. What he really wants to solve (even if he doesn't know it ) is the integro-differential equation
$$\frac{d f}{dx} = - a \frac{f}{x^2} \left( 4\pi \int^x_R du\,u^2 f(u) + M \right).$$

6. Nov 21, 2005

### saltydog

That's even more interesting. What are the bounds for the constants a, R, and M?

Also, from the form of the equation, I suppose you're looking for a solution for:

$$x\ge R$$

and I would imagine some initial condition:

$$f(R)=?$$

is known. If that's the case, then I would think a modified Runge-Kutta method can be set up to evaluate f(x) if an analytical solution can not be obtained.

Last edited: Nov 21, 2005
7. Nov 21, 2005

### Physics Monkey

The equation arises in trying to describe the density distribution of the atmosphere of a planet. The constant a is given by
$$a = \frac{G m}{k T},$$
where G is Newton's gravitational constant, $$m$$ is the gas particle's mass, $$k$$ is Boltzmann's constant, and $$T$$ is temperature. $$R$$ is the radius of the planet and $$M$$ is the planet's mass. So all the constants are manifestly positive and you want to know $$f(x)$$ (the gas density) for $$x > R$$. goulio has assumed that $$T$$ is independent of position, which is kind of a bad approximation but introduces a lot of extra complexity otherwise.

8. Nov 21, 2005

### saltydog

One more thing: What is the gas density at the surface? That is, f(R)? Surely that needs to be known or guessed at in order to solve the problem or can we just scale it to f(R)=1?