10-30-2013, 11:23 AM

Hello

Start to program a library of vector calculus, in different coordinates (spherical, cylindrical and Cartesian) for the current commands grad fromHP-CAS only work on Cartesian Coordinates =(.

First command or function (test) gradient of a function in (x, y, z)

f2(x,y,z):=x^3+y²+z; [ENTER]

[*d*(f2(x,y,z),x),*d*(f2(x,y,z),y),*d*(f2(x,y,z),z)] ; [ENTER] => [3*x²,2*y,1] // ok

// definition as function

gradient(f(x,y,z)):=[*d*(f(x,y,z),x),*d*(f(x,y,z),y),*d*(f(x,y,z),z)]; [ENTER] Done

gradient(x^3+y²+z); [ENTER] [0,0,0] ?? What mistake I'm making?

gradient CAS mathematica

http://www.wolframalpha.com/input/?i=gradient%28x%5E3%2By%C2%B2%2Bz%29

*Edited: 30 Oct 2013, 11:32 p.m. after one or more responses were posted*