2
$\begingroup$

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.

  • 0
    Just write the details. (And one the sum must be over $j$)2017-01-31
  • 0
    It follows from the formula $[AB]_{ij} = \sum_k [A]_{ik}[B]_{kj}$.2017-01-31
  • 0
    @nicomezi please check now.2017-01-31
  • 0
    The sums are finite, hence they commute. The order of summation does not matter here.2017-01-31

1 Answers 1

1

$$\large{x=\begin{bmatrix} \\\end{bmatrix}_{n\times1}\to \\ x^TAx=\begin{bmatrix} \\\end{bmatrix}_{1\times n}\begin{bmatrix} \\\end{bmatrix}_{n\times n}\begin{bmatrix} \\\end{bmatrix}_{n\times1}=\begin{bmatrix} \\\end{bmatrix}_{1\times1}\to \\ \begin{bmatrix}x_1 & x_2 & ...&x_n \\\end{bmatrix}_{n\times1} \begin{bmatrix}a_{11} & a_{12} & ...&a_{1n}\\a_{21} &a_{22} &...&a_{2n}\\...\\a_{n1} &a_{n2}&...&a{nn} \\\end{bmatrix}_{n\times1} \begin{bmatrix}x_1 \\ x_2 \\ .\\.\\.\\x_n \\\end{bmatrix}_{n\times1}}$$ $$\begin{bmatrix}x_1a_{11}+x_2a_{21}+...+x_na_{n1} & x_1a_{12}+x_2a_{22}+...+x_na_{n2}& ...& x_1a_{1n}+x_2a_{2n}+...+x_na_{nn} \\\end{bmatrix}_{n\times1}\begin{bmatrix}x_1 \\ x_2 \\ .\\.\\.\\x_n \\\end{bmatrix}_{n\times1}=\\$$ $$=(x_1a_{11}+x_2a_{21}+...+x_na_{n1})x_1\\+(x_1a_{12}+x_2a_{22}+...+x_na_{n2})x_2\\+...\\+ (x_1a_{1n}+x_2a_{2n}+...+x_na_{nn})x_n\\=(\sum_{i=1}^nx_ia_{i1})x_1+(\sum_{i=1}^nx_ia_{i2})x_2+...+(\sum_{i=1}^nx_ia_{in})x_n=\\ \sum_{j=1}^n\sum_{i=1}^nx_ia_{ij}x_j $$

  • 0
    Typo in answer: The first vector is 1xn instead of nx1.2017-01-31
  • 0
    In the last statement, one of the summation is over j?2017-01-31
  • 0
    Yes,thank you @AbhishekBhatia .I'll correct it . Was clear demonstration?2017-01-31
  • 0
    Why did you put the summation of $i$ first instead of $j$? And is it is the other way around, why does it no matter?2017-01-31
  • 0
    I made a typo ,i'll correct it .but does not matter because of symmetry .2017-01-31
  • 0
    Can you please explain on the symmetry. Why is there symmetry?2017-01-31
  • 0
    $$\sum_{i=1}^{4}\sum_{j=1}^{4}f(i,j)=\sum_{i=1}^{4}(f(i,1)+f(i,2)+f(i,3)+f(i,4))=\\(\sum_{i=1}^{4}f(i,1))+(\sum_{i=1}^{4}f(i,2))+(\sum_{i=1}^{4}f(i,3))+(\sum_{i=1}^{4}f(i,4))=\\f(1,1)+f(2,1)+f(3,1)+f(4,1)+\\f(1,2)+f(2,2)+f(3,2)+f(4,2)+\\f(1,3)+f(2,3)+f(3,3)+f(4,3)+\\f(1,4)+f(2,4)+f(3,4)+f(4,4)=\\\downarrow +\downarrow +\downarrow +\downarrow=\\ \sum_{j=1}^{4}f(1,j)+\sum_{j=1}^{4}f(2,j)+\sum_{j=1}^{4}f(3,j)+\sum_{j=1}^{4}f(4,j)=\\\sum_{j=1}^{4}\sum_{i=1}^{4}f(i,j)$$ symmetry because $i=j=1,2,3...,n \to n\times n$2017-01-31