Gradient of complex-valued function with respect to real and imaginary components Let $J(\mathbf{z})$ be a complex-valued (scalar) function where $\mathbf{z}\in \mathbb{C}^n$, and write $\mathbf{z} = \mathbf{x} + i \mathbf{y}$ for real vectors $\mathbf{x}, \mathbf{y} \in \mathbb{R}^n$. In the book I'm reading, the gradient of $J$ with respect to $\mathbf{x},\mathbf{y}$ as
$$
\begin{align}\frac{\partial J}{\partial \mathbf{x}} &= \frac{\partial J}{\partial \mathbf{z}} + \frac{\partial J}{\partial \mathbf{z}^*}\\[1mm] \frac{\partial J}{\partial \mathbf{y}} &= i\frac{\partial J}{\partial \mathbf{z}} -i \frac{\partial J}{\partial \mathbf{z}^*}\end{align},
$$
where $\mathbf{z}^*$ is the conjugate of $\mathbf{z}$. (I simplified the notation because the one used in the text is quite ugly, e.g., $\mathbf{z}$ is written as $\mathbf{c} = \mathbf{c_c} + j\mathbf{c_s}$.)
My question is: how is this set of equations derived?
I understand that there is a one-to-one mapping between $(\mathbf{x},\mathbf{y})$ and $(\mathbf{z},\mathbf{z}^*)$, but I'm not sure how to deal with "chain rule" (if that's a proper term) for vector transformations.
 A: This follows from a formal computation by Chain Rule. First one works out the case $n=1$:
Case $n=1$.
Note that $$z=x+iy,z^*=x-iy$$ $$\Rightarrow \frac{\partial z}{\partial x}=1,\frac{\partial z}{\partial y}=i,\frac{\partial z^*}{\partial x}=1,\frac{\partial z^*}{\partial y}=-i.\qquad (1)$$
Now by Chain Rule (regarding $J$ as a function of $x,y$ and of $z,z^*$, respectively) one has $$\frac{\partial J}{\partial x}=\frac{\partial J}{\partial z}\cdot\frac{\partial z}{\partial x}+\frac{\partial J}{\partial z^*}\cdot\frac{\partial z^*}{\partial x}~{\rm and~}
$$ $$\frac{\partial J}{\partial y}=\frac{\partial J}{\partial z}\cdot\frac{\partial z}{\partial y}+\frac{\partial J}{\partial z^*}\cdot\frac{\partial z^*}{\partial y}.$$
Applying (1) to the above two equations, one has
$$\frac{\partial J}{\partial x}=\frac{\partial J}{\partial z}+\frac{\partial J}{\partial z^*}~{\rm and}$$
$$\frac{\partial J}{\partial y}=i\frac{\partial J}{\partial z}-i\frac{\partial J}{\partial z^*},$$ as required.
General Case: $n>1$.
Write $z=(z_1,\cdots,z_n), z_j=x_j+iy_j, j=1,\cdots, n,$ and $z=x+iy,$ where $x=(x_1,\cdots,x_n),y=(y_1,\cdots,y_n).$ Then one has $$\frac{\partial z_j}{\partial x_k}=\delta_{jk},\frac{\partial z_j}{\partial y_k}=i\delta_{jk},\frac{\partial z_j^*}{\partial x_k}=\delta_{jk},\frac{\partial z_j^*}{\partial y_k}=-i\delta_{jk},\qquad (2)$$ where $\delta_{jk}=1$ if $j=k$ and $\delta_{jk}=0$ if $j\neq k.$
Let $\frac{\partial J}{\partial x}=\left(\frac{\partial J}{\partial x_1},\cdots,\frac{\partial J}{\partial x_n}\right),$ etc. One needs to compute each component of $\frac{\partial J}{\partial x}.$ By Chain Rule and the relations (2), one has $$\frac{\partial J}{\partial x_j}=\sum_{k=1}^n\frac{\partial J}{\partial z_k}\frac{\partial z_k}{\partial x_j}+\sum_{k=1}^n\frac{\partial J}{\partial z_k^*}\frac{\partial z_k^*}{\partial x_j}$$
$$=\sum_{k=1}^n\frac{\partial J}{\partial z_k}\cdot \delta_{kj}+\sum_{k=1}^n\frac{\partial J}{\partial z_k^*}\cdot \delta_{kj}=\frac{\partial J}{\partial z_j}+\frac{\partial J}{\partial z_j^*}.$$
Similarly, $$\frac{\partial J}{\partial y_j}=\sum_{k=1}^n\frac{\partial J}{\partial z_k}\frac{\partial z_k}{\partial y_j}+\sum_{k=1}^n\frac{\partial J}{\partial z_k^*}\frac{\partial z_k^*}{\partial y_j}$$
$$=\sum_{k=1}^n\frac{\partial J}{\partial z_k}\cdot i\delta_{kj}+\sum_{k=1}^n\frac{\partial J}{\partial z_k^*}(-i\delta_{kj}) =i\frac{\partial J}{\partial z_j}-i\frac{\partial J}{\partial z_j^*}.$$
Putting everything together in vector forms, one has $$\frac{\partial J}{\partial x}=\left(\frac{\partial J}{\partial x_1},\cdots,\frac{\partial J}{\partial x_n}\right)=\left(\frac{\partial J}{\partial z_1}+\frac{\partial J}{\partial z_1^*},\cdots,\frac{\partial J}{\partial z_n}+\frac{\partial J}{\partial z_n^*}\right)$$
$$=\left(\frac{\partial J}{\partial z_1},\cdots,\frac{\partial J}{\partial z_n}\right)+\left(\frac{\partial J}{\partial z_1^*},\cdots,\frac{\partial J}{\partial z_n^*}\right)=\frac{\partial J}{\partial z}+\frac{\partial J}{\partial z^*}$$ and
$$\frac{\partial J}{\partial y}=\left(\frac{\partial J}{\partial y_1},\cdots,\frac{\partial J}{\partial y_n}\right)=\left(i\frac{\partial J}{\partial z_1}-i\frac{\partial J}{\partial z_1^*},\cdots,i\frac{\partial J}{\partial z_n}-i\frac{\partial J}{\partial z_n^*}\right)$$
$$=i\left(\frac{\partial J}{\partial z_1},\cdots,\frac{\partial J}{\partial z_n}\right)-i\left(\frac{\partial J}{\partial z_1^*},\cdots,\frac{\partial J}{\partial z_n^*}\right)=i\frac{\partial J}{\partial z}-i\frac{\partial J}{\partial z^*},$$ as required.
