Understanding integration over Orthogonal Group Let $M$ be an $n \times n$ matrix, and $O_n$ be the orthogonal group of $n \times n$ matrix. Calculate $ m_1 = \int_{O_n}tr(M)dV$ and $m_2 = \int_{O_n} tr(M)^2dV$ where tr(M) is defined as the trace of M. 
I was given the answer key, but I don't quite understand it. The answer key made the following claims:
" Since the volume integral is invariant under translation in the
orthogonal group, it is invariant under permuting the coordinates, and under
multiplying a row or column by −1. We have 
$\int_{O_n} tr(M) dV =  \int_{O_n} \sum_i M_{ii}dV = n\int_{O_n}M_{11}dV = 0$
Also
$\int_{O_n}tr(M)^2dV = \int_{O_n} (nM^2_{11} + (n^2 -n) M_{11} M_{22}dV = \int_{O_n} n M^2_{11}dV = \int_{O_n} \sum_i M^2_{1i}dV = \int_{O_n} 1dV$"
I have very little understanding of this, specifically I don't understand the following:


*

*what it means by integrating over the orthogonal group

*Each step of $ \int_{O_n} \sum_i M_{ii}dV = n\int_{O_n}M_{11}dV = 0$
with these two, I think I can figure out the rest. I would really appreciate it if anyone can help me, thanks in advance. 

edit 1:
So from my understanding so far, $O_n$ can be seen  as a set of point where the real_valued function, tr(M) is being integrated over. $M_{11}$ is integrated over $O_n$ as a constant function.
I still don't quite understand the part about permuting the $i^{th}$ row and column of M to the first row and column is equal to $\int_{O_n} M_{11}dV$
If M is given by \begin{bmatrix} a & b \\c & d \end{bmatrix}
then $\int_{O_2} tr(M)dV = \int_{O_2} (a + d) dV = 2 \int_{O_2} a dV$?
If so, then $2 \int_{O_2} a dV = 2 \int_{O_2} d dV = 2d \int_{O_2} dV  = 2a \int_{O_2} dV$, then $a = d$ or $\int_{O_2} dV = 0$?
 A: Ok so for your first question what I think is meant is the following. A matrix $A \in M_{n \times n} (\mathbb{R})$ has $ n^2$ entries. So one can think of any matrix as a vector in $\mathbb{R}^{n^2}$. 
That is to say one can define a bijection $\phi : \{1, \ldots,n\} \times \{1, \ldots, n \} \rightarrow \{1, \ldots, n^2 \}$ which induces the following identification of matrices as vectors.
$$\alpha : M_{n \times n} (\mathbb{R}) \rightarrow \mathbb{R}^{n^2} \text{ where }M \rightarrow (M_{\phi(i,j)})$$ 
Using that we can therefore integrate over functions of the form 
$$ f: M_{n \times n} (\mathbb{R}) \rightarrow \mathbb{R}$$
as
$$\int_{A} f dV = \int_{\alpha(A)}f \circ \alpha^{-1}(x) d\mathcal{L} $$
where in your case $A$ is the orthogonal group.
Basically you are taking the matrices and flattening them until they're just vectors.
Obviously the question now is the wether or not our integral depends on our choice of alpha. Luckily for us it does not and this comes down to the integral being invariant under reordering of the coordinates.
A: 
what it means by integrating over the orthogonal group

The orthogonal group is a locally compact group (in fact it is compact), therefore it admits a Haar measure (which is both right and left invariant). Basically this is a measure $dV$ on the Borel subsets of $O(n)$ which is invariant under translation by elements in $O(n)$. This should explain the first equality.

Each step of  $\int_{O_n} \sum_i M_{ii}dV = n\int_{O_n}M_{11}dV = 0$

Well first we clearly have that $\int_{O_n} \sum_i M_ii dV = \sum_i \int_{O_n} M_{ii} dV$. Consider one of these summands
$$\int_{O_n} M_{ii} dV$$ The point now is that we integrate over all matrices, this term is intuitively zero because for every matrix $M$ there will be a matrix $N$ such that $N_{ii}=-M_{ii}$. Formally we can permute rows and columns of $M$ by multiplying by some elementary matrix so by replacing the $i$'th row with the first row and the $i$'th column with the first column this equals to $\int_{O_n} M_{11} dV$. This proves the first equality.
also by multiplying by the matrix which corresponds to multiplying the first row by $-1$ we have that $$\int_{O_n} M_{11} dV=\int_{O_n} -M_{11} dV$$ hence both the arguments are zero.
