Question: How to use d_[] ?

What exactly is the difference between the differential operator d_[] from the physics package and diff() ? Why is it not possible for me to differentiate a scalar function g or a coordinate r with the help of the operator? d_[1] should correspond to d/dx (X = (x, y, z, t)) or not? 

restart

with(Physics)

with(Vectors)NULL

Setup(coordinates = cartesian)

[coordinatesystems = {X}]

(1)

r = sqrt(x^2+y^2+z^2)

r = (x^2+y^2+z^2)^(1/2)

(2)

d_[1](g(r))

0

(3)

diff(g(r), x)

(D(g))((x^2+y^2+z^2)^(1/2))*x/(x^2+y^2+z^2)^(1/2)

(4)

d_[1](r)

0

(5)

diff(r, x)

x/(x^2+y^2+z^2)^(1/2)

(6)

d_[1](x)

1

(7)

diff(x, x)

1

(8)

NULL

Download example_d_[].mw

Please Wait...