# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Compute a partial derivative with respect to a complex variable or its conjugate

Contributed by:
Carl Woll

ResourceFunction["ComplexD"][ gives the partial derivative , where | |

ResourceFunction["ComplexD"][ gives the partial derivative with respect to the complex conjugate of | |

ResourceFunction["ComplexD"][ gives the multiple derivative. |

Only derivatives of univariate functions are supported.

Complex derivatives are also known as Wirtinger derivatives.

Complex derivatives are defined by the equations and , where is Conjugate[*z*]

Complex derivative of a function:

In[1]:= |

Out[1]= |

ComplexD works with Abs:

In[2]:= |

Out[2]= |

Compare ComplexD with its definition for a function:

In[3]:= |

Find the complex derivative using the definition in terms of derivatives with respect to the real and imaginary parts:

In[4]:= |

Out[4]= |

Use ComplexExpand on the output of ComplexD:

In[5]:= |

Out[5]= |

More complicated expressions can be differentiated by first complex expanding the expression into one that consists of Conjugate only:

In[6]:= |

Out[6]= |

Use ComplexD to find the real derivative (i.e. the derivative with respect to the real part only):

In[7]:= |

For example, here is the "real" derivative of Abs:

In[8]:= |

Out[8]= |

Compare to the usual definition of the real derivative (*h* is treated as real here):

In[9]:= |

Out[9]= |

The complex variable *z* and its conjugate are independent:

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

- 1.0.0 – 22 October 2019

This work is licensed under a Creative Commons Attribution 4.0 International License