The linalg package (which exports the jacobian
command) and lowercase matrix
are deprecated. Use LinearAlgebra and Matrix instead, and VectorCalculus:-Jacobian
.
Also, note the use of unapply
.
restart:
g := (x, y) -> x - y:
u := (x, y) -> x^2 + y^2:
J:=VectorCalculus:-Jacobian([g(x,y),u(x,y)],[x,y]);
[ 1 -1 ]
J := [ ]
[2 x 2 y]
Jf:=unapply(J,[x,y]):
Jf(1,1);
[1 -1]
[ ]
[2 2]
Jf(s,t);
[ 1 -1 ]
[ ]
[2 s 2 t]