Linear Discriminant Analysis- Derivation of Discriminant Function Given that, we want to maximize the posterior probability, for the expression (1) for k, I wan't to know how the expression (2) is obtained:

My understanding (may be wrong) is that the expansion should be like this:

How (3) and (4) are equal?
The article that i'm reading is from https://web.stanford.edu/class/stats202/notes/Classification/LDA.html.
Thanks in advance!

$x^T\Sigma^{-1}\mu = (x^T\Sigma^{-1}\mu)^T=\mu^T\Sigma^{-1}x$ because it is a scalar and transposing it has no effect. Note that, since $\Sigma$ is symmetric, so as $\Sigma^{-1}$.
Therefore, the last term (4) reduces to $x^T\Sigma^{-1}\mu_k$.
