I'm following some lecture notes regarding the quadratic form of matrices: $$ x^{\prime} A x=\left[x_{1} x_{2} \cdots x_{n}\right]\left[\begin{array}{cccc}a_{11} & a_{12} & \cdots & a_{1 n} \\ a_{21} & a_{22} & \cdots & a_{2 n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n 1} & a_{n 2} & \cdots & a_{n n}\end{array}\right]\left[\begin{array}{c}x_{1} \\ x_{2} \\ \vdots \\ x_{n}\end{array}\right]=\sum_{i=1}^{n} \sum_{j=1}^{n} x_{i} a_{i j} x_{j} $$
When doing this $x^{\prime} A x$ matrix multiplication, I had to actually multiply the matrices out to see at the very end that it is indeed the same as $\sum_{i=1}^{n} \sum_{j=1}^{n} x_{i} a_{i j} x_{j}$.
I know the general entry by entry rule, but is there a way of seeing that immediately? Or is there a rule that nicely specifies a summation formula like this for any matrix multiplication?
The problem goes on to take the partial derivative as follows: $\frac{\partial f}{\partial x_{k}}=2 x_{k} a_{k k}+\sum_{j=1, j \neq k}^{n} a_{k j} x_{j}+\sum_{i=1, i \neq k}^{n} x_{i} a_{i k}=2 x_{k} a_{k k}+2 \sum_{j=1, j \neq k}^{n} a_{k j} x_{j}$
Same question here. I had to explicitly specify the long version of the equation, then take the partial derivative to see the that the summation simplification works. How might I take a derivative of the double summation here without having to explicitly use the long expression?