I would like to compute the gradient of the following function \begin{align} f(x) := \frac{1}{2}\left\| X (a+b) \right\|_2^2 + \mu \operatorname{Re}\left\{a^H X b\right\} \end{align} where $X:= \operatorname{Diag}(x)$, $x \in \mathbb{R}^{n \times 1}$, and $a,b \in \mathbb{C}^{n \times 1}$.
The gradient that I compute is the following: \begin{align} \frac{\partial f}{\partial x} = x \odot (a+b) \odot (a+b) + \mu\operatorname{Re}\left\{ a^* \odot b\right\} \ . \end{align}
Question: Is my above gradient not correct?