I am quite new to Wolfram language, and I am trying to use it to prove the equality $$ \nabla (A \cdot B) = A \times (\nabla \times B) + B \times (\nabla \times A) + (A \cdot \nabla)B + (B \cdot \nabla)A$$
Here are the variables I defined:
a = {Ax[x, y, z], Ay[x, y, z], Az[x, y, z]};
b = {Bx[x, y, z], By[x, y, z], Bz[x, y, z]};
del = Grad[#, {x, y, z}] &;
lhs = Grad[Dot[a, b], {x, y, z}];
rhs1 = Cross[a, Curl[b, {x, y, z}]];
rhs2 = Cross[b, Curl[a, {x, y, z}]];
rhs3 = Dot[a, del] b ;
rhs4 = Dot[b, del] a;
rhsfinal = rhs1 + rhs2 + rhs3 + rhs4;
The problem I have is that I cannot get Dot[a,del]b to expand fully as in
$$(\vec A \cdot \nabla)\vec B =((\vec A \cdot \nabla)B_x,(\vec A \cdot \nabla)B_y,(\vec A\cdot \nabla)B_z)$$
In[404]:= rhs3
Out[404]= {Bx[x, y,
z] {Ax[x, y, z], Ay[x, y, z],
Az[x, y, z]} . (Grad[#1,{x, y, z}] &),
By[x, y,
z] {Ax[x, y, z], Ay[x, y, z],
Az[x, y, z]} . (Grad[#1,{x, y, z}] &),
Bz[x, y,
z] {Ax[x, y, z], Ay[x, y, z],
Az[x, y, z]} . (Grad[#1,{x, y, z}] &)}
Hence I cannot prove equality of the expression.
Crossas you've done in your code. Simply choosea = {-y,x,0}; b={1,0,0};and it fails:FullSimplify[(Cross[a, Curl[b, {x, y, z}]] + Cross[b, Curl[a, {x, y, z}]] + a . Grad[b, {x, y, z}] + b . Grad[a, {x, y, z}]) == Grad[a . b, {x, y, z}]]– flinty Jun 13 '23 at 09:51ResourceFunction["DirectionalDerivative"]andResourceFunction["DirectionalD"]and it would be easy to define your own if you didn't want to use aResourceFunction. – flinty Jun 14 '23 at 09:37