I want to make a matrix in Mathematica that looks like this:
Any idea on how I can do this?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityOne possiblity is to define the function d as:
d = {{D[#, x], 0}, {0, D[#, y]}, {D[#, x], D[#, y]}} &
To apply this operator to a particular function:
f[x_, y_] := x^2 + Sin[y]
Then:
d[f[x, y]]
{{2 x, 0}, {0, Cos[y]}, {2 x, Cos[y]}}
DisplayForm@ MatrixForm@{{FractionBox["\[PartialD]", "\[PartialD]x"], 0}, {0, FractionBox["\[PartialD]", "\[PartialD]y"]}, {FractionBox[ "\[PartialD]", "\[PartialD]y"], FractionBox["\[PartialD]", "\[PartialD]x"]}}
$\endgroup$