Solution (source code)

= Solution

For <separation of variables>, take $n=T(t)X(x)Y(y)Z(z)$ and divide the <reaction-diffusion equation> by this product wherever it is nonzero:
$$
\frac{T'}{\mu T}-\frac\gamma\mu=\frac{X''}{X}+\frac{Y''}{Y}+\frac{Z''}{Z}.
$$
Each spatial term depends on a different variable and must be constant. Write $X''=-k_x^2X$ and similarly for the other two factors. The <Dirichlet boundary conditions> give $X(0)=X(L)=0$. A zero separation constant permits only a linear function and hence the zero solution; a positive value of $X''/X$ likewise permits no nonzero function vanishing at both endpoints. The nontrivial choices are therefore
$$
\boxed{X_p(x)=\sin\frac{p\pi x}{L},\quad Y_q(y)=\sin\frac{q\pi y}{L},\quad Z_r(z)=\sin\frac{r\pi z}{L},\qquad p,q,r=1,2,\ldots.}
$$
The temporal <ordinary differential equation> is
$$
T'_{p,q,r}=\left[\gamma-\frac{\mu\pi^2}{L^2}(p^2+q^2+r^2)\right]T_{p,q,r},
$$
so, absorbing its constant multiplier into $a_{p,q,r}$,
$$
\boxed{T_{p,q,r}(t)=\exp\left\{\left[\gamma-\frac{\mu\pi^2}{L^2}(p^2+q^2+r^2)\right]t\right\}.}
$$
The <superposition principle> and completeness of the <Fourier sine series> give the stated threefold expansion with these factors. For an initial density $n_0$, <orthogonality> also determines the constants:
$$
a_{p,q,r}=\frac8{L^3}\int_0^L\int_0^L\int_0^L n_0(x,y,z)\sin\frac{p\pi x}{L}\sin\frac{q\pi y}{L}\sin\frac{r\pi z}{L}\,dx\,dy\,dz.
$$