# How to get $(\vec{A} \cdot \nabla) \vec{b})$ to evaluate in Wolfram language [duplicate]

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.

• (𝐴⃗ ⋅∇) is really an abuse of notation and mathematical convenience. You can't dot a vector with an operator / function. Also you need to clean up your expression at the top. You have a $V$ where I think you meant $\nabla$, and what do you mean by $Ax$ and $Bx$ ? Commented Jun 13, 2023 at 9:37
• Hi thanks for the catch, I updated $$V \rightarrow \nabla$$ As for $$(\vec{A} \cdot \nabla)$$ being an abuse of notation, i should interpret as $$\vec{A} \cdot \nabla \vec{B}$$ Commented Jun 13, 2023 at 9:42
• ... in which case, this identity doesn't seem to be true if I'm interpreting $x$ as Cross as you've done in your code. Simply choose a = {-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}]] Commented Jun 13, 2023 at 9:51
• hmm this expression is definitely True... I will go try and edit my code thanks for the help! Commented Jun 13, 2023 at 9:59
• @flinty You can't dot a vector with an operator / function. Says who? Physicists do it routinely, and I’m fairly sure mathematicians do as well. $\hat n\cdot\nabla$ is just a directional derivative. Commented Jun 14, 2023 at 0:21