Suppose $\mathbf{a}_{N\times1}$ is a complex-valued vector.
$B_{K\times N}$ is a complex-valued matrix.
$C_{K\times K}$ is a real-valued diagonal matrix.
Here is a function $f: \mathbb{C}^N \to \mathbb{R}$, $f = \frac{\mathbf{a}^H B^H C B \mathbf{a}}{\mathbf{a}^H B^H B \mathbf{a}}$, and whose numerator and denominator both are real-valued scalars (this can be verified). Here the operator $H$ means conjugate transpose.
Now I want to take the derivative of function $f$, but I only have the formula for real vectors like $\frac{\partial (\mathbf{x}^T B \mathbf{x})}{\partial \mathbf{x}} = (B+B^T)\mathbf{x}$, which seems not applicable in this case. How can I do this? And further, if I let the derivative of this function $f$ equal to zero, can I get the max or min value of the function $f$?
Thank you!
HINT (well, it's nearly complete)
Some definitions with differentials.
$D := B^H B$ and $N := B^H C B$
$\alpha := a^H N a = \operatorname{Tr}(a^H N a) := a^* : Na,$ where notation $:$ corresponds to Frobenius product and the operator $(\cdot)^*$ is complex conjugate.
Differential of $\alpha$ is $\ d \alpha = Na : da^*$
Similarly, $\beta := a^H D a$ $\Rightarrow d\beta = Da : da^*$
$\gamma:= \beta^{-1}$ $\Rightarrow d\gamma = -\beta^{-2} \ d\beta$
Now, you can describe your function as $$f := \gamma \alpha \ .$$
Take the differential and then we obtain the gradient, i.e., \begin{align} df &= d\gamma \ \alpha + \gamma \ d \alpha\\ &= \left( -\beta^{-2} \ d\beta \right) \ \alpha + \gamma \ \left( Na : da^* \right)\\ &= -\beta^{-2} \alpha \ \left( Da : da^* \right) + \gamma \ \left( Na : da^* \right)\\ &= \left( -\beta^{-2} \alpha \ Da + \gamma Na \right): da^* \ . \end{align}
The gradient is \begin{align} \frac{\partial f}{\partial a^*} &= \left( -\beta^{-2} \alpha \ D + \gamma N \right)a \ . \end{align}