Trace Formula for the Frobenius Norm