Let's assume that a, b are complex variables, and A[t],B[u], C[t,u] are matrices.
In[1] TensorExpand[(a A[t].B[u] + b C[t, u]).C[t, u]]
Out[1] (b C[t, u]).C[t, u] + (a A[t].B[u]).C[t, u]
Now this is not quite what I want. Since a and b are complex, the parentheses are unnecessary. But wait, I can let Mathematica know, that they are not vectors or matrices:
In[1] $Assumptions = Element[{a, b}, Complexes]
TensorExpand[(a A[t].B[u] + b C[t, u]).C[t, u]]
Out[1] b C[t, u].C[t, u] + a A[t].B[u].C[t, u]
But I want to take this one step further, let's write a function that takes care of the job:
In[1] myExpand[expr_] := Module[{},
$Assumptions = Element[_Symbol, Complexes];
Return[TensorExpand[expr]];
]
Out[1] (b C[t, u]).C[t, u] + (a A[t].B[u]).C[t, u]
Well, that didn't work as I wanted. But I can still read all the symbolic variables:
In[1] symbolicQ[x_] := MatchQ[Head[x], Symbol];
myExpand[expr_] := Module[{},
$Assumptions = Element[DeleteDuplicates[Select[Level[expr, Infinity], symbolicQ]], Complexes];
Return[TensorExpand[expr]];
]
However, this feels clumsy. Is there a better way? What is the better way? If in doubt, choose the more performant way.