When you make a Dot[a,(a+b+c)]
the output will be:
a.(a + b + c)
I want to make a function that expands the dot product, for the previous example would be:
a^2 + a.b + a.c
I don't have much knowledge about pure function. I start to create the function as following:
DotExpand[Dot[l_, r_]] := Map[Times[#, #] &, {l, r}]
In[36]:= DotExpand[(a + b + c).a]
Out[36]= {(a + b + c)^2, a^2}
As you see, is not working. What I have do modify to works?
TensorExpand
? $\endgroup$TensorExpand
, some like aDotExpand
? $\endgroup$Dot
:a (a + b + c)
$\endgroup$