THE DERIVATION OF THE NABLA OPERATOR AND THE SPATIAL DERIVATIVES OF THE UNIT VECTORS FOR SPHERICAL COORDINATES

Work done by Scott Covan

We will now derive the nabla operator and the spatial derivatives for spherical coordinates. These calculations follow almost identically the calculations made for cylindrical coordinates -- spherical coordinates are simply more difficult to work with because z is not defined in both the rectangular and spherical coordinate systems.

We will begin with calculation of nabla. We need the coordinate definitions, eqns A.6-(19-24),

x = rsin(theta)cos(phi) r=sqrt(x^2 + y^2 + z^2)

y = rsin(theta)sin(phi) theta = arctan(sqrt(x^2 + y^2)/z)

z = rcos(theta) phi = arctan(y/x)

We use the same definition for d/dx that we used before, only with different variables,

d/dx = dr/dx*d/dr + dtheta/dx*d/dtheta + dphi/dx*d/dphi

Also, because there will be so many terms with so many variables, we will define the three main terms of d/dx as a vector. Otherwise, Maple will want to combine terms during simplification, when all three terms can be completely simplified alone.

> restart;

> ddx:=[ddr*diff(sqrt(x^2+y^2+z^2),x),ddtheta*diff(arctan(sqrt(x^2+y^2)/z),x),ddphi*diff(arctan(y/x),x)];

[Maple Math]

We now substitute our definitions of x,y, and z in terms of r, theta, and phi.

> ddx:=subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta),ddx);

[Maple Math]
[Maple Math]

Just like cylindrical coordinates, Maple won't simplify correctly unless we tell it to use trig simplification procedures.

> ddx:=simplify(ddx,trig);

[Maple Math]

We now tell Maple to simplify the power terms.

> ddx:=simplify(ddx,power,symbolic);

[Maple Math]

These terms are simplified completely. We can now combine them as a sum as they should be.

> ddx:=ddx[1]+ddx[2]+ddx[3];

[Maple Math]

We will now go through the identical procedures to obtain d/dy and d/dz. Unlike cylindrical coordinate calculations, d/dz is now an issue because of the addition of the variable phi.

> ddy:=[ddr*diff(sqrt(x^2+y^2+z^2),y),ddtheta*diff(arctan(sqrt(x^2+y^2)/z),y),ddphi*diff(arctan(y/x),y)];

[Maple Math]

> ddy:=subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta),ddy);

[Maple Math]
[Maple Math]

> ddy:=simplify(ddy,trig,power,symbolic);

[Maple Math]

> ddy:=ddy[1]+ddy[2]+ddy[3];

[Maple Math]

> ddz:=[ddr*diff(sqrt(x^2+y^2+z^2),z),ddtheta*diff(arctan(sqrt(x^2+y^2)/z),z),ddphi*diff(arctan(y/x),z)];

[Maple Math]

> ddz:=subs(x=r*sin(theta)*cos(phi),y=r*sin(theta)*sin(phi),z=r*cos(theta),ddz);

[Maple Math]

> ddz:=simplify(ddz,trig,power,symbolic);

[Maple Math]

> ddz:=ddz[1]+ddz[2]+ddz[3];

[Maple Math]

These derived d/dx, d/dy, and d/dz's are all identical to A.6-(25-27). We now use simple geometrical arguments, based on the spherical coordinate system definition, to arrive at the definitions for the spherical unit vectors in terms of delx, dely, and delz, eqn A.6-(28-30):

delr = sin(theta)soc(phi)delx + sin(theta)sin(phi)dely + cos(theta)delz

deltheta = cos(theta)cos(phi)delx + cos(theta)sin(phi)dely - sin(theta)delz

delphi = -sin(phi)delx + cos(phi)dely

We now use Maple to solve for delx, dely, and delz.

> eqn1:=delr=cos(phi)*sin(theta)*delx+sin(theta)*sin(phi)*dely+cos(theta)*delz;eqn2:=deltheta=cos(theta)*cos(phi)*delx+cos(theta)*sin(phi)*dely-sin(theta)*delz;eqn3:=delphi=-sin(phi)*delx+cos(phi)*dely;

[Maple Math]

[Maple Math]

[Maple Math]

> e:=solve({eqn1,eqn2,eqn3},{delx,dely,delz});

[Maple Math]
[Maple Math]

We use subs so we can use these results in calculations.

> delx:=subs(e,delx);dely:=subs(e,dely);delz:=subs(e,delz);

[Maple Math]

[Maple Math]

[Maple Math]

We can now plug our results into the definition of nabla to obtain our spherical coordinate nabla.

nabla = delx*d/dx + dely*d/dy + delz*d/dz

> nabla:=ddx*delx+ddy*dely+ddz*delz;

[Maple Math]
[Maple Math]
[Maple Math]

> nabla:=simplify(nabla);

[Maple Math]

> nabla:=expand(nabla);

[Maple Math]

This is our desired answer, eqn A.7-9. Now, we'll restart again to avoid recursive definitions, and restate our delr, deltheta, and delphi.

> restart;delr:=sin(theta)*cos(phi)*delx+sin(theta)*sin(phi)*dely+cos(theta)*delz;deltheta:=cos(theta)*cos(phi)*delx+cos(theta)*sin(phi)*dely-sin(theta)*delz;delphi:=-sin(phi)*delx+cos(phi)*dely;

[Maple Math]

[Maple Math]

[Maple Math]

> diff(delr,r);diff(delr,theta);diff(delr,phi);

[Maple Math]

[Maple Math]

[Maple Math]

These are the spatial derivatives of delr. Notice that d/dtheta(delr) is equivalent to deltheta and that d/dphi(delr) is equivalent to delphi*sin(theta).

> diff(deltheta,r);diff(deltheta,theta);diff(deltheta,phi);

[Maple Math]

[Maple Math]

[Maple Math]

The spatial derivatives of deltheta. Notice that d/dtheta(deltheta) is equivalent to -delr and that d/dphi(deltheta) is equal to delphi*cos(theta).

> diff(delphi,r);diff(delphi,theta);diff(delphi,phi);

[Maple Math]

[Maple Math]

[Maple Math]

The spatial derivatives of delphi. The d/dphi(delphi) looks simplified, but we need it in terms of delr, deltheta, and delphi. To do this, we manually plug in the delx and dely's that we found before.

> -(cos(phi)*(sin(theta)*cos(phi)*dellr+cos(theta)*cos(phi)*delltheta-sin(phi)*dellphi)+sin(phi)*(sin(theta)*sin(phi)*dellr+cos(theta)*sin(phi)*delltheta+cos(phi)*dellphi));

[Maple Math]
[Maple Math]

> simplify(%,trig);

[Maple Math]

This is the form for d/dphi(delphi) that we need. Now, armed with the spherical nabla operator and the spatial derivatives for spherical coordinates, we can do the vector calculations needed to derive the equation of energy in terms of sherical coordinates.