# Integral related to particle diffusion

In the context of particle diffusion, I am trying to understand the equations that describe Brownian motion as a macroscopic process.

Assume $N(x,t)$ is a number concentration and $D$ is a diffusion constant, then we can write:

$$\frac{\partial N(x,t)}{\partial t} = D \frac{\partial^2}{\partial x^2} N(x,t)$$

next, we can multiply by the mean square displacement $x^2$ and integrate over $x$ from $-\infty$ to $\infty$:

$$\int x^2 \frac{\partial N(x,t)}{\partial t} dx = \int x^2 D \frac{\partial^2}{\partial x^2} N(x,t) dx$$

Now the script that I'm reading writes that the left-hand side can be written as:

$$\int x^2 \frac{\partial N(x,t)}{\partial t} dx = N_0 \frac{\partial \langle x^2 \rangle}{\partial t}$$

where I assume that $N_0$ is the initial number concentration of particles and $\langle \rangle$ is the mean square displacement.

I do not understand the last equation. Could somebody explain why I can express the integral as the partial derivative wrt to time of the mean square displacement (multiplied by $N_0$).

EDIT: $\langle x^2 \rangle$ is the mean square displacement (contrarily to what I have written earlier)

-
I found an alternative approach to the problem, which is given in the Wikipedia entry on mean square displacement. While it does not explain the approach mentioned in my question above, it shows an alternative way to getting to the end-result of the computation, which is $\langle x^2 \rangle = 2 D t$. –  lomppi Jun 19 '13 at 12:31
Pull the derivative out of the integral. You can do so if nothing else besides $N(x,t)$ in the integrand depends on $t$. So the domain of integration has to be constant in time. Supposing it is you can take out the derivative and just use the definition of $\langle x^2 \rangle$. And it is a total derivative on the right hand side: $\langle x^2 \rangle$ only depends on $t$. –  Michael Brown Jun 19 '13 at 13:14
@MichaelBrown, so this is basically the answer I was looking for. I totally missed what you have pointed out. If you'd put that into an answer, I'd mark it as the accepted answer. –  lomppi Jun 20 '13 at 11:33

Since the comment answered your question I'll just go ahead and set out a more generalised version. It's straightforward to simplify things back down to your case. Consider the following continuity equation:

$$\dot{N}(x,t) = -\nabla\cdot\vec{\Gamma}(x,t) + S(x,t),$$

where $\vec{\Gamma}(x,t)$ is the flux (in your case $\vec{\Gamma}(x,t)= -D\nabla N(x,t)$, you can easily extend this) and $S(x,t)$ is a source term representing net creation/destruction of particles (in your case $S=0$). Multiplying by $x^n$ and integrating:

$$\int \mathrm{d}x\ x^n\dot{N}(x,t) = -\int \mathrm{d}x\ x^n\nabla\cdot\vec{\Gamma}(x,t) + \int \mathrm{d}x\ x^nS(x,t).$$

If the domain of integration is constant:

$$\int \mathrm{d}x\ x^n\dot{N}(x,t) = \frac{\mathrm{d}}{\mathrm{d}t} (N(t)\langle x^n \rangle),$$

where $N(t)$ is the total number of particles in the domain of integration. Taking the domain of integration as all space we find:

$$\begin{array}{lrcl} n=0: & \frac{\mathrm{d}}{\mathrm{d}t} N(t) &=& S(t), \\ n=1: & \frac{\mathrm{d}}{\mathrm{d}t} (N(t)\langle x \rangle) &=& -\int \mathrm{d}x\ x\nabla\cdot\vec{\Gamma}(x,t) + \int \mathrm{d}x\ x S(x,t) = \int \mathrm{d}x\ x S(x,t), \end{array}$$

etc. The first equation gives conservation of particles. The second can be rearrange using the first to give

$$\frac{\mathrm{d}\langle x \rangle }{\mathrm{d}t} = \frac{1}{N(t)} \left(\int \mathrm{d}x\ x S(x,t) - S(t) \langle x \rangle \right) = \langle\frac{x S(x,t)}{N(x,t)}\rangle - \frac{S(t) \langle x \rangle }{N(t)},$$

which is the centre of mass velocity, which is not zero, or even conserved in general, if there is a source.

You can see you get a tower of moment equations, essentially converting a partial differential equation into a sequence of ordinary differential equations. In your case this doesn't really gain you anything, but in more complicated situations (where you have to use, e.g. the Boltzmann equation) this technique is essential for extracting useful information about a system.

-