Solution (source code)

= Solution

In the <birth-death master equation>, The upward jump has rate $\lambda$ and the downward jump rate $\beta x$, so the first two jump moments per unit time are $A(x)=\lambda-\beta x$ and $B(x)=\lambda+\beta x$. The second-order <Kramers-Moyal expansion> gives the <diffusion approximation of a birth-death process>
$$
\boxed{\partial_tP=-\partial_x[(\lambda-\beta x)P]+\frac12\partial_x^2[(\lambda+\beta x)P].}
$$
For the associated <Fokker-Planck equation>, integrating by parts with vanishing moment boundary terms gives $d\langle f\rangle/dt=\langle Af'+\tfrac12Bf''\rangle$. Taking $f=x,x^2$ yields
$$
\boxed{\frac{d\langle x\rangle}{dt}=\lambda-\beta\langle x\rangle,\qquad
\frac{d\langle x^2\rangle}{dt}=-2\beta\langle x^2\rangle+(2\lambda+\beta)\langle x\rangle+\lambda.}
$$
For example, if $m_0=\langle x(0)\rangle$, then $m(t)=\lambda/\beta+(m_0-\lambda/\beta)e^{-\beta t}$, while the <variance> satisfies $v'=-2\beta v+\lambda+\beta m$. The two boxed <moment equations> also follow exactly from the discrete <Markov jump-process generator>, since quadratic functions have no higher jump terms. A reflecting diffusion confined to $x\geq0$ can have extra boundary contributions; the formal approximation near extinction is not an exact replacement for the discrete process.