Let $x$ be a vector and $\omega$ a matrix S.T. $\hat y=w^Tx$ is a solution to a regression problem trying to predict $y$. Let $y=az$ where $a$ is a scalar and $z,y,\hat y$ have the same dimension. I want to calculate the squared error $E[(\hat y-y)^2]$ hence:
$$E[(\hat y-y)^2]=E[(\omega^Tx-az)^2]=E[(w^Tx)^2-2az\omega^Tx+a^2z^2]$$
How do I expand upon $(\omega^Tx)^2$? I have seen someone write $(\omega^Tx)^2=\omega^Txx^T\omega$ why is that correct?