Is it possible to simplify this expression? Recently I've been stuck in an expression:
$$\sum_{m=1}^{N}{{\lambda}_m {\textbf x_m}^T}\cdot \sum_{m=1}^{N}{{\lambda}_m {\textbf x_m}}$$ where $\textbf x_m\in {\mathbb R}^n$ is a column vector. Could I further simplify this expression to more compact form?
 A: Unless you have some orthogonality conditions on the vectors, not really.
$$
\sum(\ldots) \cdot \sum(\ldots ) =  \sum_{i = 1}^N \sum_{j = 1}^N \lambda_i \lambda_j (x_i \cdot x_j)
$$
Where I've used the dot product instead of multiplying by the transpose. Note that everything commutes, so this is really
$$
\sum_{k = 1}^N \lambda_k^2 \|x_k\|^2 + 2\sum_{i < j}^N \lambda_i \lambda_j (x_i \cdot x_j)
$$
i.e. one copy of every square of things, and two copies of each `non-square' product.
A: The sum of the transposes is the transpose of the sum:
$$\sum \lambda_m \mathbf{x}_m^T=\left(\sum \lambda_m \mathbf{x}_m\right)^T$$
So this expression is the squared length of the vector sum:
$$\left(\sum \lambda_m \mathbf{x}_m\right)^T \sum \lambda_m \mathbf{x}_m =
\left\|\sum \lambda_m \mathbf{x}_m\right\|^2$$
Unless the vectors $\mathbf x_m$ have some additional structure (like, they are orthogonal or something), you can't get much more than that.
You can also try to write it as a matrix product. Since $\mathbf x_m$ are column vectors, write $X=\left[\begin{array}{cccc} \mathbf x_1 & \mathbf x_2 \cdots \mathbf x_N \end{array}\right]$ and $$\mathbf \lambda = \left[\begin{array}{c} \lambda_1 \\ \lambda_2 \\ \vdots \\ \lambda_N \end{array} \right]$$ and then you have $$\sum \lambda_m \mathbf{x}_m = X\mathbf\lambda$$ so that your expression is $$(X\lambda)^T X\lambda = \lambda^T X^T X\lambda$$
