I'm not familiar with derivations of equations involving vectors and matrices. Given
$$f(x)=c^Tx + y^TAx$$
with $y \in \mathbb{R}^d, A \in \mathbb{R}^{d\times n}, x \in \mathbb{R}^n, c \in \mathbb{R}^n$.
What is the derivative of $f(x)$? Somehow $c^T + y^TA$ can not be right since the second term yields a matrix and no scalar as in $f(x)$.