# Derivative of conjugate multivariate function

I have a problem with Mathematica, taking the derivative of the conjugate of some function. I know that a similar question has been posed before here, but the solution did not work for multivariate function.

Problem is: I try to evaluate

D[Conjugate[f[x, y, z]], x]


And get the result

Conjugate'[f[x, y, z]] f^(1, 0, 0)[x, y, z]


But would like

Conjugate[f^(1, 0, 0)[x, y, z]]


where ^ is supposed to be superscript. Can anyone help me resolve this?

• MapAt[D[#, x] &, Conjugate[f[x, y, z]], 1] or Map[D[#, x] &, Conjugate[f[x, y, z]]] or D[#, x] & /@ Conjugate[f[x, y, z]]. – march Aug 11 '15 at 15:51

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


D[Conjugate[f[x]], 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:

D[Conjugate[f[x, y, z]], x]


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

I think what you want is something like this:

Conjugate[f[x_, y_, z_]] ^:= cf[x, y, z]

Derivative[d__][cf][x__] := Conjugate[Derivative[d][f][x]]

D[Conjugate[f[x, y, z]], x]


Conjugate[Derivative[1, 0, 0][f][x, y, z]]

All I did here is to define the derivative of the function f to be another function cf which then can be given the property you want.

• Is the ^ before the := a typo? – AccidentalFourierTransform May 23 '18 at 15:39
• @AccidentalFourierTransform No, it's UpSetDelayed. – Jens May 23 '18 at 17:05
• Oh, that's a new one for me, cool. Thanks! – AccidentalFourierTransform May 23 '18 at 17:14
• Just a last question, as this is going to be very helpful for me. If we take cf[x,y,z] =-E^(-2 I x) + 2 E^(-I y - I z) + 2 E^(-3 I z - I x) + 12 E^(-2 I y - 2 I x). It doesn't work. I'm sure I'm missing something ? – Shamina Oct 3 '18 at 21:40
• @Shamina cf is supposed to remain purely symbolic. I don't understand what you're trying to do with the = assignment. Even if you change that to cf[x_,y_,z_] := ... it wouldn't correspond to what this question was originally about. You may have to ask a new question. – Jens Oct 4 '18 at 4:51