Solving a One-Dimensional Heat Equation Q: Consider the following 1-D problem that describes some organism dispersing with constant diffusion $D$ and a mortality proportional to the population $n$:
$$\frac{\partial n}{\partial t}=D\frac{\partial^2n}{\partial x^2}-\mu n$$
where $D>0$, $\mu>0$, $n$ is the population. Find the population distribution at any $x$ and $t$ arising from $N_0$ organisms being released at $x = 0$ at $t = 0$, that is, $n(x,0)=N_0\delta(x)$.
Now I know if the second term $-\mu n$ on the right was not there, then the solution would be the fundamental solution to diffusion equation which we know to be
$$n(x, t)=\frac{N_0}{2(\pi D t)^{1 / 2}} e^{-x^{2} /(4 D t)}, \quad t>0$$
How do I get a solution like this that accounts also for that second term in the pde?
 A: Let $n(x,t)=X(x)T(t),$ hence $$\frac{\partial{n}}{\partial{t}}(x,t)=X(x)T'(t)$$ and $$\frac{\partial^2{n}}{\partial{x}^2}(x,t)=X''(x)T(t).$$ Therefore, $$X(x)T'(t)=DX''(x)T(t)-\mu{X(x)}T(t).$$ Hence $$\frac{T'(t)}{T(t)}=\frac{DX''(x)-\mu{X(x)}}{X(x)},$$ and so $$\ln\left[\frac{T(t)}{N_0}\right]=\frac{DX''(x)-\mu{X(x)}}{X(x)}t,$$ hence $$T(t)=N_0\exp\left[\frac{DX''(x)-\mu{X(x)}}{X(x)}t\right].$$ Since $$\frac{\partial{T}}{\partial{x}}(t)=0,$$ it means $$\frac{DX''(x)-\mu{X(x)}}{X(x)}=\lambda,$$ hence $$X''(x)=\frac{\mu+\lambda}{D}X(x),$$ meaning $$X(x)=C_0\exp\left(-\sqrt{\frac{\mu+\lambda}{D}}x\right)+C_1\exp\left(\sqrt{\frac{\mu+\lambda}{D}}x\right).$$ $C_0$ and $C_1$ are in principle arbitrary complex numbers, but they could be fixed by boundary conditions, though you said none were given. Therefore, $$n(x,t)=N_0C_0\exp\left(\lambda{t}-\sqrt{\frac{\mu+\lambda}{D}}x\right)+N_0C_1\exp\left(\lambda{t}+\sqrt{\frac{\mu+\lambda}{D}}x\right).$$ Again, the constants may need fixing, depending on what exactly the context of your problem is, and you also need to carefully analyze the cases when $\mu+\lambda\lt0,$ $\mu+\lambda=0,$ and $\mu+\lambda\gt0.$
A: Have you tried doing separation of variables here? What I mean is that you suppose $n(x,t) = X(x)T(t)$ and then do the derivatives. You should get to:
$$ \frac{T'}{T} = D \frac{X''}{X} - \mu $$
Since X is only a function of x (and not T) you can solve the two functions independently. That is:
$$ \frac{T'}{T} = -(\lambda+\mu)$$
$$ D\frac{X''}{X} = -\lambda $$
Both this equations are solvable. The minus sign in $\lambda$ is for convention, but you should be careful whether the cases $\lambda=0$ and $\lambda<0$ are rightfully discarded.
Although I think that you're missing the boundary conditions (you only have an initial condition) you could impose that the solution must be finite when $x\rightarrow \pm \infty$. This way you should be able to obtain a solution probably as a Fourier Series. Haven't actually done the whole math in detail, but I think this should work.
