I am wondering how to handle the following situation: I do have vectors of known dimension that I would like to handle symbolically. I suppose I can do something like
avec = Array[a,2];
bvec = Array[b,2];
Now in my equations there are also scalars that represent the norms of these vectors, i.e.
A == Norm[avec]
So suppose I write an expression like
expr = A avec.(avec + bvec)
What I would like Mathematica to do is:
- Whenever
avec.avecis encountered, replace this by A^2 - Whenever
avec.bvecis encountered, leave this symbolic, don't expand into the elements of the vectors.
How can I achieve this?

avec . avecbyA^2rather than byA! – murray Aug 26 '12 at 20:17