I do not understand why the equation below holds assuming $A$ and $P$ are both square matrices in $\Bbb{R}^{n*n}$ and $P$ is symmetric and positive definite (i.e. $ P = P^{T} $ and $ x^{T}Px > 0 $)
$$ 2 PA = A^{T}P + PA $$
I am trying to understand the LQR from the following slides (sheet 2). I can understand why $ \partial V(x)f(x) = 2x^{T}PAx $, but I do not understand why $ 2x^{T}PAx = x^{T}[A^{T}P+PA]x $. I think it has something to do with $ 2PA = A^{T}P + PA $, but I am not sure.
Because $x^T PA x$ is a scalar, its transpose is equal to itself, i.e. $x^T PA x = (x^T PA x)^T = x^T A^T P x$. But $PA \neq A^T P$ in general.