Why is $\delta\mathbf{u}\cdot \mathrm{div}(\mathbf{\sigma}) = -\mathrm{grad}(\delta\mathbf{u}) \mathbf{:} \mathbf{\sigma}$

tensorsvector analysis

Context is from this deal.ii tutorial. Screenshot of the relevant part is below.

Context

I don't get the transformation from $\delta\mathbf{u}\cdot \mathrm{div}(\mathbf{\sigma})$ to $-\mathrm{grad}(\delta\mathbf{u}) \mathbf{:} \mathbf{\sigma}$, that seems to be happening as a part of the first line. $\mathbf{u}$ is the displacement field (vector field), $\sigma$ is the stress tensor (tensor field) and $\delta$ is the variational operator. When I try to break the problem down in index notation, I get

$$\delta\mathbf{u}\cdot \mathrm{div}(\mathbf{\sigma}) = \delta u_i\cdot\frac{\partial\sigma_{ij}}{\partial x_j}$$
and
$$-\mathrm{grad}(\delta\mathbf{u}) \mathbf{:} \mathbf{\sigma} = -\delta\left(\frac{\partial u_i}{\partial x_j}\right)\cdot \sigma_{ij}.$$
Which means that $$\delta u_i\cdot\frac{\partial\sigma_{ij}}{\partial x_j} = -\delta\left(\frac{\partial u_i}{\partial x_j}\right)\cdot \sigma_{ij}.$$

Can these two terms possibly be the same? There's a minus sign on one of them and not on the other, and in the left side the derivation is taken of $\sigma$ while on the right side it's taken of $u$. I can't see any transformations that would turn one into the other, and I also can't find a mistake in my chain of reasoning, what am I missing here?

Best Answer

This is pretty much just a Green Theorem of the form $$ \int_\Omega g_i \frac{\partial f_{ij}}{\partial x_j} dV= - \int_\Omega \frac{\partial g_i}{\partial x_j} f_{ij} dV+ \int_{\partial \Omega} g_i f_{ij} n_j dS $$ where $n$ is the normal to the surface, applied on the term $\int_\Omega \delta\mathbf{u}\cdot \mathrm{div}(\mathbf{\sigma}) d v $. The term $\sigma_{ij}n_j$ is then written out as $t$ which should be a force prescribed on the boundary.