Given the bilinear form $f(A,B)=\operatorname{tr} (A^t M B)$ where $A,B$ are two $n\times n$ matrices I have to find a necessary and sufficient condition (on $M$) for $f$ to be symmetric.
I found out that if $M$ is symmetric then $f$ is symmetric too. And I'm very certain that $M$ being symmetric is also a necessary condition. However I can't prove it. Any suggestions?
Note that $\operatorname{tr} = \operatorname{tr} A^T$.
Hence $$f(A,B)-f(B,A)=\operatorname{tr} (A^TMB-B^TMA) = \operatorname{tr} (A^TMB-A^TM^TB) = \operatorname{tr} (A^T(M-M^T)B)$$
Now let $U \Sigma V^T$ be the SVD of $M-M^T$, and let $B=V, A=U$, then we have $\operatorname{tr} \Sigma = 0$, and so $M=M^T$.
Alternative:
Let $A=u e_1^T$ (with $e_1 = (1,0,0,...)^T$), $B=ve_1^T$, we have $\operatorname{tr} (e_1 u^T(M-M^T)v e_1^T) = u^T(M-M^T)v \operatorname{tr} (e_1 e_1^T) =u^T(M-M^T)v $.
If $u^T(M-M^T)v = 0$ for all $u,v$, then $M-M^T = 0$.