Wirtinger Derivatives in Maple 2021
Generally speaking, there are two contexts for differentiating complex functions with respect to complex variables. In the first context, called the classical complex analysis, the derivatives of the complex components ( abs , argument , conjugate , Im , Re , signum ) with respect to complex variables do not exist (do not satisfy the Cauchy-Riemann conditions), with the exception of when they are holomorphic functions. All computer algebra systems implement the complex components in this context, and computationally represent all of as functions of z . Then, viewed as functions of z, none of them are analytic, so differentiability becomes an issue.
In the second context, first introduced by Poincare (also called Wirtinger calculus), in brief z and its conjugate are taken as independent variables, and all the six derivatives of the complex components become computable, also with respect to . Technically speaking, Wirtinger calculus permits extending complex differentiation to non-holomorphic functions provided that they are ℝ-differentiable (i.e. differentiable functions of real and imaginary parts, taking as a mapping ).
In simpler terms, this subject is relevant because, in mathematical-physics formulations using paper and pencil, we frequently use Wirtinger calculus automatically. We take z and its conjugate as independent variables, with that , , and we compute with the operators , as partial differential operators that behave as ordinary derivatives. With that, all of , become differentiable, since they are all expressible as functions of z and .
Wirtinger derivatives were implemented in Maple 18 , years ago, in the context of the Physics package. There is a setting, , that when set to true - an that is the default value when Physics is loaded - redefines the differentiation rules turning on Wirtinger calculus. The implementation, however, was incomplete, and the subject escaped through the cracks till recently mentioned in this Mapleprimes post.
Long intro. This post is to present the completion of Wirtinger calculus in Maple, distributed for everybody using Maple 2021 within the Maplesoft Physics Updates v.929 or newer. Load Physics and set the imaginary unit to be represented by 

The complex components are represented by the computer algebra functions

![[Im(z), Re(z), abs(z), argument(z), conjugate(z), signum(z)]](/view.aspx?sf=214369_post/89fdacd656f51398e8e329c86e39b004.gif)
|
(1) |
They can all be expressed in terms of and 
![map(proc (u) options operator, arrow; u = convert(u, conjugate) end proc, [Im(z), Re(z), abs(z), argument(z), conjugate(z), signum(z)])](/view.aspx?sf=214369_post/90866733d0e745d688184f7c920e1478.gif)
![[Im(z) = ((1/2)*I)*(-z+conjugate(z)), Re(z) = (1/2)*z+(1/2)*conjugate(z), abs(z) = (z*conjugate(z))^(1/2), argument(z) = -I*ln(z/(z*conjugate(z))^(1/2)), conjugate(z) = conjugate(z), signum(z) = z/(z*conjugate(z))^(1/2)]](/view.aspx?sf=214369_post/f9a7f7d08e8d4ec8f5a4729393bd5ec9.gif)
|
(2) |
The main differentiation rules in the context of Wirtinger derivatives, that is, taking and as independent variables, are
![map(%diff = diff, [Im(z), Re(z), abs(z), argument(z), conjugate(z), signum(z)], z)](/view.aspx?sf=214369_post/b70ea0752affe493d6e84f72f50c84bf.gif)
![[%diff(Im(z), z) = -(1/2)*I, %diff(Re(z), z) = 1/2, %diff(abs(z), z) = (1/2)*conjugate(z)/abs(z), %diff(argument(z), z) = -((1/2)*I)/z, %diff(conjugate(z), z) = 0, %diff(signum(z), z) = (1/2)/abs(z)]](/view.aspx?sf=214369_post/f1bfdba2288209b27ec0f855fc50c0f7.gif)
|
(3) |
Since in this context is taken as - say - a mathematically-atomic variable (the computational representation is still the function ) we can differentiate all the complex components also with respect to 
![map(%diff = diff, [Im(z), Re(z), abs(z), argument(z), conjugate(z), signum(z)], conjugate(z))](/view.aspx?sf=214369_post/cae7dd392e66ba7e1e722b8cda271c84.gif)
![[%diff(Im(z), conjugate(z)) = (1/2)*I, %diff(Re(z), conjugate(z)) = 1/2, %diff(abs(z), conjugate(z)) = (1/2)*z/abs(z), %diff(argument(z), conjugate(z)) = ((1/2)*I)*z/abs(z)^2, %diff(conjugate(z), conjugate(z)) = 1, %diff(signum(z), conjugate(z)) = -(1/2)*z^2/abs(z)^3]](/view.aspx?sf=214369_post/cfaddab9a68bdeeb526950709f490167.gif)
|
(4) |
For example, consider the following algebraic expression, starting with conjugate


|
(5) |
Differentiating this expression with respect to z and taking them as independent variables, is new, and in this example trivial


|
(6) |


|
(7) |
Switch to something less trivial, replace by the real part  


|
(8) |
To verify results further below, also express in terms of 


|
(9) |
New: differentiate with respect to and 


|
(10) |


|
(11) |
Note these results (10) and (11) are expressed in terms of , not . Let's compare with the derivative of where everything is expressed in terms of z and . Take for instance the derivative with respect to z


|
(12) |
To verify this result is mathematically equal to (10) expressed in terms of take the difference of the right-hand sides


|
(13) |
One quick way to verify the value of expressions like this one is to replace and simplify and are real
![`assuming`([eval(Re(z)^2+z*Re(z)-(1/4)*(2*z+conjugate(z))*(z+conjugate(z))-(1/4)*z^2-(1/4)*z*conjugate(z) = 0, z = a+I*b)], [a::real, b::real])](/view.aspx?sf=214369_post/27149f6706e6c89f7785a12ed899bf99.gif)

|
(14) |


|
(15) |
The equivalent differentiation, this time replacing in by ; construct also the equivalent expression in terms of and for verifying results


|
(16) |


|
(17) |
Since these two expressions are mathematically equal, their derivatives should be too, and the derivatives of can be verified by eye since and are taken as independent variables


|
(18) |


|
(19) |
Eq (18) is expressed in terms of while (19) is in terms of . Comparing as done in (14)


|
(20) |
![`assuming`([eval((1/2)*conjugate(z)/abs(z)-z*conjugate(z)+abs(z)^2-(1/2)*conjugate(z)/(z*conjugate(z))^(1/2) = 0, z = a+I*b)], [a::real, b::real])](/view.aspx?sf=214369_post/73ebe9370019e527ed0d2fd035cdfadd.gif)

|
(21) |


|
(22) |
To mention but one not so famliar case, consider the derivative of the sign of a complex number, represented in Maple by . So our testing expression is


|
(23) |
This expression can also be rewritten in terms of and


|
(24) |
This time differentiate with respect to ,


|
(25) |
Here again, the differentiation of , that is expressed entirely in terms of and , can be computed by eye


|
(26) |
Eq (25) is expressed in terms of while (26) is in terms of . Comparing as done in (14),


|
(27) |
![`assuming`([eval(-(1/2)*z^2/abs(z)^3-z^3*signum(z)/abs(z)^3+(1/2)*z^2/(z*conjugate(z))^(3/2)+z^2/conjugate(z)^2 = 0, z = a+I*b)], [a::real, b::real])](/view.aspx?sf=214369_post/2e7f2dc925cdab1f9e0cf260d3d7a603.gif)

|
(28) |


|
(29) |

|