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.

saltydog
Homework Helper
goulio said:
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.

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:
HallsofIvy
Homework Helper
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$$.

saltydog
Homework Helper
HallsofIvy said:
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$$.

Thanks Hall. That's very helpful. Physics Monkey
Homework Helper
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).$$

saltydog
Homework Helper
Physics Monkey said:
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).$$

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:
Physics Monkey
Homework Helper
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.

saltydog
$$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.