Let:
$$A=\hat{r}+e^{j\theta}$$
Where $\hat{r}, e^{j\theta} \in \mathbb{C}^n$, and j = (-1)^(.5). Set $L \in \mathbb{R}^{n \ x \ n}$, define $S$:
$$S=A^TLA$$
The gradient of $S$ is given by (general formula):
$$\nabla S = \frac{\partial S}{\partial r}\hat{R}+ \frac{\partial S}{\partial \theta}\hat{\theta}$$
I need to find a expression of $\nabla S$ in terms of the other variables.
My idea is:
$$\nabla S = LA \frac{\partial A}{\partial r}+LA \frac{\partial A}{\partial \theta}$$ $$= L(\hat{r}+e^{j\theta})1+L(\hat{r}+e^{j\theta})je^{j\theta} $$
However, the dimension of the second term seems wrong?
How to solve this gradient problem?
First $S$ is a scalar for sake of the exercise (because the notation is very blurry) I'm not going to expand the expression for $A$.
As you said:
$$\nabla S=\frac{\partial S}{\partial r}\hat{r}+\frac{\partial S}{\partial \theta}\hat{\theta}$$ $$\nabla S=\frac{\partial A^T L A}{\partial r}\hat{r}+\frac{\partial A^T L A}{\partial \theta}\hat{\theta}$$
You can note that $A^T L A$ is the next: $$A^T L A =\sum_{i=1}^n \sum_{j=1}^n l_{ij}a_i a_j$$ Where $a_i$ is the component $i$ of the vector $A$ and $l_ij$ is the component $i,j$ of $L$. So the derivative with respect to $r$ is: $$\frac{\partial A^T L A}{\partial r}=\sum_{i=1}^n \sum_{j=1}^n l_{ij}\left(\frac{\partial a_i}{\partial r} a_j +a_i\frac{\partial a_j}{\partial r} \right)$$ $$=\sum_{i=1}^n \sum_{j=1}^n l_{ij}\left(\frac{\partial a_i}{\partial r} a_j \right)+\sum_{i=1}^n \sum_{j=1}^n l_{ij} \left(a_i\frac{\partial a_j}{\partial r} \right)$$ $$=\frac{\partial A^T}{\partial r}LA+AL\frac{\partial A}{\partial r}=2AL\frac{\partial A}{\partial r}$$ The last equality is due the symmetry of the first summand with the second: $$\left(\frac{\partial A^T}{\partial r}LA\right)^T=A^T L^T \left(\frac{\partial A^T}{\partial r}\right)^T=A^T L \frac{\partial A}{\partial r}$$ Analogous is: $$\frac{\partial A^T L A}{\partial \theta}=\frac{\partial A^T}{\partial \theta}LA+AL\frac{\partial A}{\partial \theta}=2AL\frac{\partial A}{\partial \theta}$$
In both cases as you will probably noted $\frac{\partial A}{\partial r}$ and $\frac{\partial A}{\partial \theta}$ denote the derivative of the vector at each component with respect to $r$ and $\theta$ respectively.
Finally the gradient is:
$$\nabla S=2A^TL\frac{\partial A}{\partial r}\hat{r}+2A^T L\frac{\partial A}{\partial \theta}\hat{\theta}$$
Now keeping in mind what is $A$ for you is a matter of replacement.