0
$\begingroup$

I want to make a matrix in Mathematica that looks like this:

enter image description here

Any idea on how I can do this?

$\endgroup$
1
  • 1
    $\begingroup$ "looks like this" If you want those characters to be displayed, maybe you can use DisplayForm@ MatrixForm@{{FractionBox["\[PartialD]", "\[PartialD]x"], 0}, {0, FractionBox["\[PartialD]", "\[PartialD]y"]}, {FractionBox[ "\[PartialD]", "\[PartialD]y"], FractionBox["\[PartialD]", "\[PartialD]x"]}} $\endgroup$
    – LouisB
    Mar 22 '21 at 0:28
5
$\begingroup$

One 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]}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.