Problem 5 (~Exercise 1.8.10 in A-W)

  Vectors A and B have only the x component that is nonzero and is a function of thr ...  = (B  ∇) A + (A  ∇) B + B (∇A) + A (∇B)

<<Calculus`VectorAnalysis`

SetCoordinates[Cartesian[x, y, z]]

Cartesian(x, y, z)

Loading the vector analysis package is necessary if one wants to use  functions like gradient. Notice that a comon problem is caused by loading the package after trying to use one of its functions.  Since your initial use of this function created a definition for the name,  Mathematica will not load the corresponding function from the package.  Therefore you have to Remove["name"] your function before the load.  The second input line can be omitted as the Cartesian coordinates are the default,  however,  without the Set you have to use the default names Xx, Yy, and Zz.

Del[f_] := Grad[f]

Yes,  it has to be uppercase D in Del here but lowercase in [ESC]del[ESC] to write the symbol.  Alternatively: ∇f_: =Grad[f]

∇Sin[x y z]

{y z cos(x y z), x z cos(x y z), x y cos(x y z)}

Couple of you tried and failed to use the ∇ symbol in this problem.  Indeed,  this is poorly described in the Mathematica Book making the impression that ∇ is just like Grad.  In reality it is an undefined function,  see p. 451,  and therefore it has to be defined as in line 3.  However.  the usefulness of ∇ does not extend far.  It seems to be impossible to define operations such as ∇×A or ∇.A.  To enter ∇ use [ESC]del[ESC] or use Palette-> Complete Characters-> Operators-> General.  You also might have noticed the nice form of the output.  To get it use Cell-> Default Output Form-> Traditional.

a = {ax[x, y, z], 0, 0} b = {bx[x, y, z], 0, 0}

{ax(x, y, z), 0, 0}

{bx(x, y, z), 0, 0}

lhs = ∇ (a . b)

{bx(x, y, z) ax^(1, 0, 0)(x, y, z) + ax(x, y, z) bx^(1, 0, 0)(x, y, z), bx(x, y, z) ax^(0, 1,  ... , z) bx^(0, 1, 0)(x, y, z), bx(x, y, z) ax^(0, 0, 1)(x, y, z) + ax(x, y, z) bx^(0, 0, 1)(x, y, z)}

rhs = ∇a . b + ∇b . a + bCurl[a] + aCurl[b]

{bx(x, y, z) ax^(1, 0, 0)(x, y, z) + ax(x, y, z) bx^(1, 0, 0)(x, y, z), bx(x, y, z) ax^(0, 1,  ... , z) bx^(0, 1, 0)(x, y, z), bx(x, y, z) ax^(0, 0, 1)(x, y, z) + ax(x, y, z) bx^(0, 0, 1)(x, y, z)}

lhs == rhs

True

Notice that ∇ can act not only on a scalar but also on a vector.  In the latter case it creates a matrix  ∇V= {a_ij = ∂V_i /∂ x_j }.   This matrix form is also the reason for having to put ∇V at the first position in the dot product since we want to multiply a matrix by a vector.  Therefore,  what is written in the standard mathematical notation as (W.∇)V,  in Mathematica becomes ∇V.W.


Created by Mathematica  (September 23, 2003)