# A question about $\sum_{i=1}^n x_i x_i^T = X^TX$

For a set of column vectors $x_1,\dots,x_n$, the identity shows that $\sum_{i=1}^n x_i x_i^T = X^TX$. I can show this by seeing the $(p,q)$ entry of the resulting matrix is $\sum_{i=1}^n (X^T)_{pi}X_{iq} = \sum_{i=1}^n x_{ip} x_{iq}$. Is there a quicker way of seeing this? and, does $xx^T$ have a special name?

-

What you have written is true in general. If $A = \begin{pmatrix} a_1 & a_2 & \cdots &a_n\end{pmatrix}$ and $B = \begin{pmatrix} b_1 & b_2 & \cdots & b_n \end{pmatrix}$, then $$AB^T = \sum_{k=1}^{n} a_k b_k^T$$