If we have $2$ vectors $p_1, p_2$ and a symmetric matrix $A$, is the following formula true in general, in some cases only or never? $$p^T_1 A p_2 = p^T_2 A p_1 $$
I made a test in a general case where $p_1 = \begin{bmatrix}r_1 \hspace{0.5cm} r_2\end{bmatrix}, p_2 = \begin{bmatrix}r_3 \hspace{0.5cm} r_4\end{bmatrix}$ and $$A = \begin{bmatrix} a&b \\b&c \end{bmatrix}$$ and the result is the same, but this isn't sufficient proof. Any insight would be really helpful, thanks.
This statement will hold whenever $A$ is symmetric. In particular, note that $p_1^TAp_2$ is a scalar (or a $1 \times 1$ matrix if you prefer), and any scalar is equal to its own transpose. Thus, $$ p_1^TAp_2 = (p_1^TAp_2)^T = p_2^TA^Tp_1 = p_2^TAp_1 $$