Function Repository Resource:

# ComplexD

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

Contributed by: Carl Woll
 ResourceFunction["ComplexD"][f,z] gives the partial derivative , where z is complex. ResourceFunction["ComplexD"][f,Conjugate[z]] gives the partial derivative with respect to the complex conjugate of z. ResourceFunction["ComplexD"][f,{z,n}] gives the multiple derivative.

## Details and Options

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]

## Examples

### Basic Examples (1)

Complex derivative of a function:

 In[1]:=
 Out[1]=

### Scope (3)

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]=

### Applications (3)

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]=

### Properties and Relations (1)

The complex variable z and its conjugate are independent:

 In[10]:=
 Out[10]=
 In[11]:=
 Out[11]=

Carl Woll

## Version History

• 1.0.0 – 22 October 2019

## Author Notes

Support for multivariate functions could be added. Support for multiple derivatives could also be added (e.g., ComplexD[f, z, Conjugate[z]]).