kill(all)$
load(lrats)$
load(vect)$

appendix :vector : symbolic manipulations.
peter.vlasschaert@gmail.com,23/08/2018

see :rocket science : appendix dot product,cross product 'version 1.0'

 vector : symbolic manipulations.
============================

declare([A,B,C,D],nonscalar);

nonscalar : vector declare.

Two vectors :
===========

dot product ( = inner product )
----------------------------------------------

p1:A.B;

p1a:express(p1);

p2:B.A;

p2a:express(p2);

p3:A.A;

p3a:express(p3);

cross  product ( = outer product)
--------------------------------------------------

p4:A~B;

p4a:express(p4);

p5:-p4;

p5a:express(p5);

relations : between dot and cross product
====================================

? vectorsimp;

three vectors :
===========

(A~B)~C ?
---------------

p6:(A~B)~C;

p6a:ev(vectorsimp(p6),expandall);

p6b:express(p6a);

p6c:ratsimp(p6b);

p6d:fullratsimp(p6b);

p6e:ratexpand(p6d);

p6f:expand(p6d);

(A~B).C ?
---------------

p7:(A~B).C;

p7a:ev(vectorsimp(p7),expandall);

p7b:express(p7a);

p7c:fullratsimp(p7b);

p7d:expand(p7b);

four vectors :
===========

((A~B)~C).D) ?
--------------------

p8:(A~B)~C.D;

p8a:ev(vectorsimp(p8),expandcross);

p8b:ev(vectorsimp(p8),expanddot);

p8c:ev(vectorsimp(p8),expanddotplus);

p8d:ev(vectorsimp(p8),expandcrosscross);

p8e:ev(vectorsimp(p8),expandcrossplus);

How to understand , 'p8b','p8c'
-----------------------------

p8f:express(p8b);

p8f1:expand(p8f);

p8f2:[A[x]=1,A[y]=1,A[z]=1];
p8f3:subst(p8f2,p8f1);

p8g:B~C~D;

p8h:(B~(C~D));

p8i:(B~C)~D;

result : see 'p8g' same 'p8h'
              =================

p8j:express(p8h);

p8k:expand(p8j);

p8l1:p8k[1];
p8l2:p8k[2];
p8l3:p8k[3];

check : sum 'p8li' same as 'p8f3' , i=1,2,3
==================================

sum(p8k[i],i,1,3) - p8f3;

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------