I am afraid Mathematica is not designed to handle that kind of symbolic differentiation, at the moment. I doubt that it could be done using the same D function without breaking important functionality. There may be external packages for symbolic vector calculus, somebody else may know about them.
Yes, symbolic tensor calculations is more what I had in mind. In my case, I only go to order 2, so all could be nicely written in terms of vectors, matrices, and inner and outer (for the vectors) products, and cross products. Since the expressions are long, it would be a nightmare - and error-prone - to reconstruct them from the components. I also don’t need to worry about covariant or contravariant indices. Such vector/matrix expressions seem to me very common in the literature.
Again, thanks for trying to help, much appreciated.
There is the Grad, that does what you want, but returns an output open to interpretation.
Grad[ (3 u). v,u]
3 1.v
Grad is defined to work on explicit lists with some obvoius rules of linearity.
So you can simply unprotect Dot and define
Dot[ x_?NumericQ, v_ ] := x v
Dot[ v_, x_?NumericQ ] := x v
Generally, multi-linear functions like Dot should be augmented by rules for Simplify in the case of inert, empty and numerical arguments. Physicists have no problem to interpret 1 and 0 as diagonal nxn matrices, for the dimension n, that the Dot product can insert at the current position without changing the result.
Here the number 1 is the abstract unit matrix of the dimension of v , as the unit matrices and their multiples are isomorphic to the field of scalars by actionon vectors and matrices.
In the Wikipedia page on matrix calculus there is a long list of identities, including the one you need. I suppose they can be implemented in the Wolfram Language with some attention.