Let's say I have a matrix, $A$:
\begin{pmatrix} a_{11} & a_{12} \\\ a_{21} & a_{22} \end{pmatrix}
vector $p$: \begin{pmatrix} p_{1} \\\ p_{2} \end{pmatrix}
and vector $q$: \begin{pmatrix} q_{1} \\\ q_{2} \end{pmatrix}
If I have some function, $f(....) = \sum_{1\leq i, j \leq n}a_{ij}p_{i}q_{j} $, how can I go about determining what $\frac{\partial{f}}{p_1}$ for instance?
If I do this by hand I get $a_{11}q_{1} + a_{12}q_{2} + 0 + 0$ but how do I do this without evaluating it manually?