text: In one dimension the spatial gradient operator is simply:
  so the equation to solve becomes the single-variable second order equation:
  Which can be integrated one time in the space variable x to give:
  Where D is not zero, this is an inhomogeneous first-order linear differential equation with variable coefficients in the variable c(x):
  where the coefficients are:
  and:
  This equation has in fact a relatively simple analytical solution (see the link above to first-order linear differential equation with variable coefficients).
  On the other hand, in the positions x where D=0, the first-order diffusion term disappears and the solution becomes simply the ratio: