2. Show that \( \text{tr}(AB) = \text{tr}(BA) \) for any \( n \)-square matrices \( A \) and \( B \), where \( \text{tr}(AB) \) and \( \text{tr}(BA) \) denote the trace of \( AB \) and \( BA \), respectively.
(7%)