I am struggling with this optimisation problem where I have my costfunction $J(\mathbf{x}):\mathbb{C}^n\rightarrow\mathbb{C}$ and analytical gradient $\nabla J(\mathbf{x})=J^\prime(\mathbf{x})$ for input vector $\mathbf{x}$, however the input needs to be normalised with $f(\mathbf{x}):\mathbb{C}^n\rightarrow\mathbb{C}^n$ so my new cost function is $J(f(\mathbf{x}))$ with $$ f(\mathbf{x})) = \frac{\mathbf{x}}{\sqrt{\mathbf{x}^H\mathbf{x}}} $$
My question is about the chain rule, $$ \nabla J(f(\mathbf{x})) \stackrel{?}{=} J^\prime(f(\mathbf{x})) f^\prime(\mathbf{x})) $$ is this valid, and what would my $f^\prime(\mathbf{x})) $ look like? Is it a matrix or a vector? $$ f(\mathbf{x})) = \frac{\sqrt{\mathbf{x}^H\mathbf{x}}-\frac{2\mathbf{x}\mathbf{x}^H}{2\sqrt{\mathbf{x}^H\mathbf{x}}}}{\mathbf{x}^H\mathbf{x}} $$
Note $\mathbf{x}^H$ is the Hermitian of $\mathbf{x}$, complex numbers are optional here, but will make my life easier later on.
Welcome to math.stackexchange.
First, for the chain rule it is better to use the Jacobi matrix instead of the gradient. We write this as $J'(x)$ or $f'(x)$. Then the gradient is the transpose of the Jacobi matrix, so we have to write $\nabla J(x)=J'(x)^H$.
Let us define $g(x)=J(f(x))$ and let $n$ be the length of the vector $x$. Then the chain rule says $$g'(x)=J'(f(x))f'(x),$$ where $x\in\mathbb C^n$, $f'(x)\in\mathbb C^{n\times n}$, and $J'(f(x))\in\mathbb C^{1\times n}$.
For the calculation of $f'(x)$ know that the result has to be a $n\times n$-matrix and that maybe the chain rule might be helpful again. Good luck.