# How can I calculate the Jacobian for a set of functions?

I want to calculate the Jacobian of three functions. Following the mathematical way of calculating I do:

u[x_, y_, z_] := 9 x^2 y^2 + z E^x
v[x_, y_, z_] := x y + x^2 y^3 + 2*z
w[x_, y_, z_] := Cos[x]*Sin[z]*E^y
{
{D[u[x, y, z], x], D[u[x, y, z], y], D[u[x, y, z], z]},
{D[v[x, y, z], x], D[v[x, y, z], y], D[v[x, y, z], z]},
{D[w[x, y, z], x], D[w[x, y, z], y], D[w[x, y, z], z]}
}


Where E is the Euler number expressed in Mathematica.

And I get the Jacobian.

I have seen that there is a function named JacobianMatrix which I understand shall give the same result.

I try this without success:

JacobianMatrix[{u[x, y, z], v[x, y, z], w[x, y, z]}, {x, y, z}]

• Would that function be used to calculate the Jacobian?
• If so, what is wrong in the way I am invoking it?
• D[{u[x, y, z], v[x, y, z], w[x, y, z]}, {{x, y, z}, 1}] or Grad[{u[x, y, z], v[x, y, z], w[x, y, z]}, {x, y, z}]  Aug 20, 2022 at 10:21
• and Det@Grad is the Jacobian. Aug 20, 2022 at 10:28
• If you mean this then the syntax is ResourceFunction["JacobianMatrix"][{u[x,y,z],v[x,y,z],w[x,y,z]},{x,y,z}]. Anyhow, I am with @cvgmt. I think it would be good if typing "Jacobian" into the documentation center search bar would direct one to D and Grad, as first and second search result, not to some ResourceFunction. Aug 20, 2022 at 11:14
• @user293787 I guess since Jacobian is a system symbol and option to FindRoot, I'd expect FindRoot to be the top hit. For me, it's 4th and D is 5th. I don't get a resource function hit on the first page. Maybe it's a difference in how our systems are set up or versions or the online docs (I'm on V13.1/Mac). (My top 2 hits are optimization tutorials and the 3rd is CoordinateTransformData.) Aug 20, 2022 at 15:25
• @MichaelE2 I was here reference.wolfram.com/search/?q=Jacobian where 1st and 2nd place are resource functions. Locally I do not get resource functions, but the rest is in the same order with D in 5th place (Version 12.3/Linux). Aug 20, 2022 at 15:32

I think the shortest way to achieve what you are looking for is as follows:

u[x_, y_, z_] := 9 x^2 y^2 + z E^x;

v[x_, y_, z_] := x y + x^2 y^3 + 2 z;

w[x_, y_, z_] := Cos[x] Sin[z] E^y;

jacobian = D[{u[x, y, z], v[x, y, z], w[x, y, z]}, {{x, y, z}}] f[x1, x2, x3] = {9 x1^2 x2^2 + x3 E^x1, x1 x2 + x1^2 x2^3 + 2*x3, Cos[x1]*Sin[x3]*E^x2}

(J = Table[ Table[D[f[x1, x2, x3][[i]], xi], {xi, {x1, x2, x3}}], {i, 1, 3}]) // MatrixForm