The derivative of absolute value of complex function $f(x,z)$ where $x \in \mathbb{R}$ and $z \in \mathbb{C}$ Let $f: \mathbb{R} \to \mathbb{R}$ be a real function and let $z \in \mathbb{C}$ be a complex number such that
$$
f(x)=|x \cdot z|
$$
Let's calculate the derivative of $f$
if we applicate the derivation rules:
$$
f'(x)=\dfrac{x \cdot z}{|x \cdot z|}
\cdot
z
$$
but it's wrong indeed
$$
f(x)=|x \cdot z| = |x| \cdot |z|
$$
and now
$$
f'(x)=\dfrac{x}{|x|}
\cdot
|z|
$$
so what's the derivative of $f$?
In general what's the derivative of absolute value of a function $|f(x,z)|$ respect the real variable $x$ and $z \in \mathbb{C}$?
Thanks.

$f(x)=|x\cdot z|$ is a real function, for any $z\in\mathbb{C}$
Let $z= a+bi;\;a,b\in\mathbb{R}$
then $$f(x)=|x\,z|=|ax+bxi|=\sqrt{a^2x^2+b^2x^2}$$
and $$f'(x)=\frac{a^2 x+ b^2 x}{ \sqrt{a^2 x^2+b^2 x^2}}=|z|\cdot \dfrac{x}{|x|}$$
