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?

  • 1
    $\begingroup$ 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]]. $\endgroup$ – 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:



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



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:

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

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

D[Conjugate[f[x, y, z]], 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.

  • $\begingroup$ Is the ^ before the := a typo? $\endgroup$ – AccidentalFourierTransform May 23 '18 at 15:39
  • $\begingroup$ @AccidentalFourierTransform No, it's UpSetDelayed. $\endgroup$ – Jens May 23 '18 at 17:05
  • $\begingroup$ Oh, that's a new one for me, cool. Thanks! $\endgroup$ – AccidentalFourierTransform May 23 '18 at 17:14
  • $\begingroup$ 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 ? $\endgroup$ – Shamina Oct 3 '18 at 21:40
  • $\begingroup$ @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. $\endgroup$ – Jens Oct 4 '18 at 4:51

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.