Solution (source code)

= Solution

The smallest decay-rate <eigenvalue> is $\lambda_1=D\pi^2/L^2-\gamma$, so the threshold is
$$
\boxed{\gamma_c(D,L)=\frac{D\pi^2}{L^2}.}
$$
Because $0<x_0<L$, $a_1>0$. For every fixed interior point $0<x<L$, the first sine <eigenfunction> is positive and the remaining terms have strictly faster decay relative to it. Hence
$$
\rho(x,t)\sim\frac{2\rho_0}{L}\sin\frac{\pi x_0}{L}\sin\frac{\pi x}{L}\,e^{(\gamma-\gamma_c)t}.
$$
One can justify the relative-error limit directly: after factoring out the first exponential, the absolute remainder is bounded by $(2\rho_0/L)\sum_{n\geq2}e^{-D\pi^2(n^2-1)t/L^2}$, which tends to zero. Thus $\boxed{\rho\to0\text{ if }\gamma<\gamma_c}$, and $\boxed{\rho(x,t)\to+\infty\text{ for each interior }x\text{ if }\gamma>\gamma_c}$. The boundary values stay zero. At equality the first term is stationary and the density approaches its positive sine profile.