I want to implement the following integration by parts

```
\nabla{#}::Derivative.
{A,B,C}::Depends(\nabla{#}).
tr{#}::Trace.
ex:=\int{\tr{A}\tr{B\nabla{C}}};
integrate_by_parts(_,$C$);
```

I have a try

`substitute(_,$\tr{A??}\tr{B?? \nabla{C??}}->-\tr{\nabla{A??}}\tr{B?? C??}-\tr{A??}\tr{\nabla{B??} C??}$);`

Is there is any simpler way to implement it?