# Question:Divergence Tensor

## Question:Divergence Tensor

Maple

I am trying to calculate the divergence of a tensor field (in this specific case of a cauchy stress tensor (tensor of second order)). I am trying to use the DifferentialGeometry as well as the tensor package. I tried doing it somewhat similar to calculating the divergence of a tensor of first order, which worked fine with this code:

```>with(DifferentialGeometry): with(Tensor): with(Tools): >DGsetup([x,y,z],T); >v := DGzip([v__x(x,y,z,t),v__y(x,y,z,t),v__z(x,y,z,t)],[D_x,D_y,D_z],"plus"); >Divergence(v);```

However when I tried something similar with a tensor of second order it returened an error:

```>sigma := evalDG(sigma__11 * D_x &t D_x + sigma__12 * D_x &t D_y + sigma__13 * D_x &t D_z                  + sigma__21 * D_y &t D_x + sigma__22 * D_y &t D_y + sigma__23 * D_y &t D_z                   + sigma__31 * D_z &t D_x + sigma__32 * D_z &t D_y + sigma__33 * D_z &t D_z); >Divergence(sigma); Error, (in DifferentialGeometry:-Tools:-Divergence) expected argument to be a vector field. Received _DG([["tensor", T, [["con_bas", "con_bas"], []]], [`...`]])```

Is there a different command in order to compute the divergence of a tensor of second order compared to the command for a tensor of first order or am I making an enitrely different mistake?
Would really appreciate some help

﻿