Question: Physics diff with defined tensors

Hi, 


     I've been playing around with the Physics package, and I'm confused on evaluaing derivatives of explicit funcitons of the coordinates. This code below doesnt behave as I would think. I'm trying to define z as a function of X[mu]*X[mu], and take diff(z, X[mu]). You can see that each method d_, diff,  disagree and none are satisfactory ansers. (Maple 2015, Windows 8.1 64-bit, Intel i5 Haswell) 

# Declare coordinates for 2 dimensions, flat space

restart:
with(Physics):
Setup(mathematicalnotation = true, dimension = 2):
Coordinates(X):

# Method 1: Using Define and various differential operators
Define(z):
z :=sqrt(R^2-X[mu]*X[mu]);
d_[mu](z(X));
d_[1](z(X));
diff(z, x1);  #This one is correct
diff(z, X[mu]); # off by 2

# Method #2: Using functions
# Off by a factor of 2
z2 := mu -> sqrt(R^2-X[mu]*X[mu]);
diff(z2(mu), X[mu]); # off by 2

 PhysicsDiffBug.mw

Please Wait...