TITLE: Gradient of objective function
QUESTION [0 upvotes]: I want to know how to calculate the gradient $\boldsymbol \nabla f\left ( \mathbf{x} \right )$ of these functions:

$f\left ( \mathbf{x} \right )=\left | \mathbf{a}^{H}\mathbf{x} \right |^{2}$, where $\mathbf{x}$ is $N\times 1$ complex vector
$f\left ( \mathbf{x} \right )=\left | \mathbf{a}^{H}e^{j\mathbf{x}} \right |^{2}$, where $\mathbf{x}$ is $N\times 1$ real vector

where $\mathbf{a}$ is $N\times 1$ complex vector, and $(\,\cdot\,)^{H}$ is the complex conjugate transpose operator.

REPLY [0 votes]: Using the chain rule, for question $1$
$$\frac{df(\mathbf{x})}{d\mathbf{x}}=2|\mathbf{a}^H\mathbf{x}|\mathbf{a}^*$$
where $N\times 1$ vector $\mathbf{a}^*$ is the complex conjugate of vector $\mathbf{a}$
As for question $2$, using the fact that $\frac{d}{dx}e^{jx}=je^{jx}$, we obtain 
$$\frac{df(\mathbf{x})}{d\mathbf{x}}=2|\mathbf{a}^He^{j\mathbf{x}}|\mathbf{v}$$
where for index $k\in\{1,2,..,N\}$, vector $\large\mathbf{v}$ has element $\large v_k=ja_k^*e^{jx_k}$
{"set_name": "stack_exchange", "score": 0, "question_id": 760166}