:

## Directional derivatives of complex functions

It can be interesting to consider a directional derivative of f(z) in the direction w:

`%ddiff(f(z), z, w) = %limit((f(z + w*h) - f(z))/(w*h), h = 0);`
```ddiff := proc (fz0, z, dir) local rule, fz, dfz, ans;
dfz := %ddiff(fz, z, dir)*dir;
rule :=
[abs(1, fz::anything) = (conjugate(fz)*dfz + fz*conjugate(dfz))/(2*abs(fz)*dfz),
signum(1, fz::anything) = (conjugate(fz)*dfz - fz*conjugate(dfz))/(2*abs(fz)*conjugate(fz)*dfz)];
ans := applyrule(rule, diff(fz0, z));
ans := value(ans);
ans := [ans, op(convert~(ans, [abs, argument, Re, Im, signum, conjugate]))];
op(1, sort(simplify(ans, size), length)) end proc;
```

For analytic functions the derivative is the same in any direction:

```ddiff(sqrt(Re(f(z))^2+Im(f(z))^2)*exp(I*argument(f(z))), z, w); # f(z) in disguise
d
--- f(z)
dz
```

For non-analytic functions that's no longer the case:

```ddiff(conjugate(z), z, w);
1
----------
2
signum(w)

ddiff(conjugate(f(z)), z, 1+I);
________
d
-I --- f(z)
dz

ddiff(abs(z), z, z);
1
---------
signum(z)

ddiff(ln(abs(z)), z, z);
1
-
z
```

Some of those derivates have simple geometric interpretations: the derivative of argument(z) in the direction z is zero, since argument(z) doesn't change when moving in the direction z from the point z; the derivative of abs(z) in the direction I*z is zero, since the direction is tangent to the circle abs(z)=constant; since signum(z) is a function of argument(z) only, its derivative in the direction z is zero as well.

Interestingly, the derivative taken twice in the direction z is zero for each of the six basic functions:

```map(fz -> ddiff(ddiff(fz, z, z), z, z), [abs, argument, Re, Im, signum, conjugate](z));
[0, 0, 0, 0, 0, 0]
```

Does that have some simple geometric interpretation as well?

﻿