I am trying to model a diffusion phenomenon with anisotropic and heterogeneous diffusion.
$$\nabla \cdot (D\nabla c)$$
where
$$D = \begin{bmatrix} D_{xx}(x,y)&D_{xy}(x,y)\\ D_{yx}(x,y)&D_{yy}(x,y) \end{bmatrix}$$
and $D_{xy} = D_{yx}$. From Wikipedia, I get
$$\nabla \cdot (D\nabla c) = \nabla \cdot[D(x,y)] \nabla c(x,y) + \mbox{tr} \left( D(x,y) \nabla \nabla ^T c(x,y) \right)$$
If I am correct, then
$$\mbox{tr} \left( D(x,y)\nabla \nabla ^Tc(x,y) \right) = D_{xx}\frac{\partial^2 c}{\partial x^2}+D_{yy}\frac{\partial^2 c}{\partial y^2}$$
but I am unsure how to expand the first term. Perhaps,
$$\left( \frac{\partial c}{\partial x} \hat i + \frac{\partial c}{\partial y} \hat j \right) (\nabla D_{xx}+2\nabla D_{xy}+\nabla D_{yy})$$
where $\nabla (\cdot) = \left(\frac{\partial (\cdot)}{\partial x} \hat i+\frac{\partial (\cdot)}{\partial y} \hat j \right)$ completely FOIL'd out?
Any help would be appreciated, as I am trying to use this for implementing a model. I also apologize for my notation.