# Derivative of a matrix with complex conjugates of multivariate functions [closed]

I have a matrix:

U = {{0, f[x, t]}, {Conjugate[f[x, t]], 0}}

And I want to take its t-derivative to get:

{{0, f^(0,1)[x,t]},{Conjugate[f^(0,1)[x,t]], 0}}

Instead with the code from this question I get:

{{0, f^(0,1)[x,t]},{Conjugate`[f[x,t]]f^(0,1)[x,t], 0}}

How do I get the correct output?

• You need to edit this question to show the code you used to get the incorrect result you show. We need this additional info to see how you applied liked answer to your problem. As it stands, your question does not ask a clear question. Jan 23, 2017 at 1:57

There are System options one can set to control the behavior of D. One of these is the "ExcludedFunctions" option:

excluded="ExcludedFunctions"/.
("DifferentiationOptions"/.SystemOptions["DifferentiationOptions"])

{Hold,HoldComplete,Less,LessEqual,Greater,GreaterEqual,Inequality,Unequal,Nand,Nor,Xor,Not,Element,Exists,ForAll,Implies,Positive,Negative,NonPositive,NonNegative,Replace,ReplaceAll,ReplaceRepeated}

These are functions that D will not differentiate. We can add Conjugate to this list by using:

SetSystemOptions["DifferentiationOptions"->
"ExcludedFunctions"->Union[excluded,{Conjugate}]]

Now, D will not try to differentiate Conjugate:

D[Conjugate[f[x]], x]//InputForm

Conjugate[Derivative[1][f][x]]

We are now free to give D rules for differentiating Conjugate:

Unprotect[Conjugate];
Conjugate /: D[Conjugate[f_], x__] := Conjugate[D[f, x]]
Protect[Conjugate];

Let's see what happens to the OP example now:

U = {{0, f[x, t]}, {Conjugate[f[x, t]], 0}};
D[U, t]

{{0,(f^(0,1))[x,t]},{Conjugate[(f^(0,1))[x,t]],0}}