Edited because the goal was changed in the comment:
This can be done by directly defining the outcome of Derivative
when applied to g
in the two combinations that you seem to be interested in:
Derivative[1][g][x_] := d[g[x]]
Derivative[1][Conjugate][g[x_]] := Conjugate[d[g[x]]]/d[g[x]];
Derivative[1][Conjugate][d[x_]] := Conjugate[d[d[x]]]/d[d[x]]
Derivative[1][d][x_] := d[d[x]]/d[x];
Derivative[1][d][x_Symbol] := d[d[x]]
On the second line, I used the fact that g
is a generic function whose derivative under a Conjugate
by default invokes the chain rule. All I do then is to reverse the chain rule by dividing by the factor d[g[x]]
that the chain rule will produce. This leaves only the factor I want, and I then replace that by the desired outcome d[Conjugate[g[x]]]
.
The analogous thing is done for d
to allow higher derivatives. The exception is when d[x]
is encountered where x
is the differentiation variable (which isn't in the question, but I expect may happen). Then there is no chain rule needed, and I therefore specify a separate rule for it with the pattern x_Symbol
.
Here is the test:
D[g[x], x]
(* ==> d[g[x]] *)
D[Conjugate[g[x]], x]
(* ==> d[Conjugate[g[x]]] *)
D[g[x], x, x]
(* ==> d[d[g[x]]] *)
D[d[g[x]], x]
(* ==> d[d[g[x]]] *)
D[d[x], x]
(* ==> d[d[x]] *)
D[Conjugate[g[x]], x]
(* ==> Conjugate[d[g[x]]] *)
D[Conjugate[g[x]], x, x]
(* ==> Conjugate[d[d[g[x]]]] *)
Now the remaining issue is to replace the repeated application of d
by formatting of the type d^2 g[x]
for d[d[g[x]]]
. I'll wait to see if this is really desired before doing it.