# Vector and matrices operations

I have the following expression:

$$(\mathbf{x} - \mathbf{\Psi a})^{T}(\mathbf{x} - \mathbf{\Psi a})$$

I would like to develop the expression and gather the terms:

$$\mathbf{x}^{T}\mathbf{x} - \mathbf{x}^{T}\mathbf{\Psi a} - (\mathbf{\Psi a})^{T}\mathbf{x} + (\mathbf{\Psi a})^{T}\mathbf{\Psi a}$$

$$= \mathbf{x}^{T}\mathbf{x} -2\mathbf{x}^{T}\mathbf{\Psi a} + \mathbf{a^{T}\Psi^{T}\Psi a}$$

Why is the last expression is true?

• Is it in case that $\Psi$ is semi-positive definite? Commented Sep 10, 2020 at 18:17
• The transpose of a scalar is the same scalar. And $x^T \Psi a$ is a scalar and equal to $a^T \Psi^T x$. Commented Sep 10, 2020 at 18:18
• ok that was easy and make sense. Thanks for the help! Commented Sep 10, 2020 at 18:20
• You're welcome. I could post it as a solution. Commented Sep 10, 2020 at 18:20
• Go for it! I will accept it. Commented Sep 10, 2020 at 18:21

And note that $$x^T \Psi a$$ is indeed a scalar.
$$x^T\Psi a= (x^T\Psi a)^T=(\Psi a)^T x=a^T \Psi^T x$$