# Derivatives with respect to the independent variables $z\in\mathbb C$ and $\bar z$ [duplicate]

I want to be able to treat $z$ and its complex conjugate as independent variables, so that for instance $\partial (z\bar\,z)/\partial z = \bar z$. When I try to do this by evaluating

D[z Conjugate[z], z]


it returns

Conjugate[z] + z Derivative[1][Conjugate][z]


because it treats $\bar z$ as if it is a function of $z$ (which of course it is).

Is there a clever way to tell Mathematical that $z$ and $\bar z$ should be treated as independent variables when evaluating derivatives? Or would the best option be just to use two explicitly independent variables $z$ and $w$ and later substitute $w=\bar z$?

• Offhand I think the best way to go is as you state, making two independent variables. An alternative might be to switch z->x+I*y with a corresponding change for zbar, take derivatives with respect to {x,y}, manipulate to obtain d/dz, translate back... This seems too tedious though. – Daniel Lichtblau Feb 1 '18 at 23:39

Block[{Conjugate}, Conjugate'[z]:=0; D[z Conjugate[z], z]]