I am following some notes on applying derivatives to vectors/matrices, I found the following:
$$f(x)=x^{T}Ax=\sum_{i=1}^{n}\sum_{j=1}^{n}A_{ij}x_{i}x_{j}$$.
I don't understand why this is true, can someone explain how this is derived? (Supposed multiplication is well defined)
It is just matrix multiplication, where the result is a $1\times 1$ matrix, and this is regarded as a scalar,
Take $n=2$, so $\mathbf x=\begin{bmatrix}x_1\\x_2\end{bmatrix}$ and $\mathbf A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}$
Then $$\begin{align}\mathbf x^\top \mathbf A\mathbf x &=\begin{bmatrix}x_1&x_2\end{bmatrix}\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}\begin{bmatrix}x_1\\x_2\end{bmatrix}\\ &= \begin{bmatrix}x_1 & x_2\end{bmatrix}\begin{bmatrix} A_{11}x_1+A_{12}x_2\\A_{21}x_1+A_{22}x_2\end{bmatrix}\\&=\begin{matrix}x_1A_{11}x_1+x_1A_{12}x_2+x_2A_{21}x_1+x_2A_{22}x_2\end{matrix}\\&= \sum_{i=1}^2\sum_{j=1}^2 x_iA_{ij}x_j\end{align}$$