with(linalg):
Rphi:=a*vector([cos(phi)*cos(theta),cos(phi)*sin(theta),-sin(phi)]);
Rphi := a [cos(phi) cos(theta), cos(phi) sin(theta), -sin(phi)]
Rtheta:=a*vector([-sin(phi)*sin(theta),sin(phi)*cos(theta),0]);
Rtheta := a [-sin(phi) sin(theta), sin(phi) cos(theta), 0]
dSvec:=crossprod(Rphi,Rtheta);
[ 2 2 2 2 dSvec := [a sin(phi) cos(theta), a sin(phi) sin(theta), 2 2 a cos(phi) cos(theta) sin(phi) 2 2 ] + a cos(phi) sin(theta) sin(phi)]The first two components are the same as those of eq. (4.30). Let us simplify the third component:
simplify(dSvec[3]);
2 a cos(phi) sin(phi)The third component now agrees with that of eq. (4.30), confirming the equation.
simplify(dSvec[1]^2+dSvec[2]^2+dSvec[3]^2);
4 4 2 a - a cos(phi)Noting that noting that 1 - cos^2 = sin^2, this is the same as eq. (4.31), thereby confirming the equation.