By definition, you have $\xi_1=\sum_{j=1}^p a_{1j}x_j$. This is the same as the dot product of the vector $a_1$ with the vector $x$, which can be written either $a_1^Tx$ or $x^Ta_1$; this gives the second (subtracted) term of (2). Using each of the last two expressions once, we have $\xi_1^2 = (a_1^Tx)(x^Ta_1)$, which gives the first (added) term of (2).
Step (3) comes from the linearity of expectation, since multiplication on the left by $a_1^T$ and multiplication on the right by $a_1$ are both linear maps.
By definition, you have $\xi_1=\sum_{j=1}^p a_{1j}x_j$. This is the same as the dot product of the vector $a_1$ with the vector $x$, which can be written either $a_1^Tx$ or $x^Ta_1$; this gives the second (subtracted) term of (2). Using each of the last two expressions once, we have $\xi_1^2 = (a_1^Tx)(x^Ta_1)$, which gives the first (added) term of (2).
Step (3) comes from the linearity of expectation, since multiplication on the left by $a_1^T$ and multiplication on the right by $a_1$ are both linear maps.