Why is $$x^TAx= \sum_{j}^{n}\sum_{i}^{n} a_{ij}x_ix_j $$
$x$ is n × 1, $A$ is n × n.
What I have tried?
If $y=Ax$, then $$y_j =\sum_{j}^na_{ij}x_{j}$$
Now, $$x^TAx= \sum_{i}^n x_iy_i $$
which becomes $$\sum_{i}^n x_i\sum_{j}^na_{ij}x_{j}=\sum_{i}^n \sum_{j}^na_{ij}x_{i}x_j$$
Now, the orders of i and j are reversed which is the problem, and confuses me.