Some calculus in the orthogonal group $O(n)$ How  can one compute each of the following  matrices, explicitly:
$$\int_{O(n)} e^{g}dg$$ or
$$\int_{O(n)} g^{n}dg \;\;\;\;n\in \mathbb{N} \;\;n>1$$
What is the  explicite entries of the resulting matrices, for $n=2$?
Moreover, for $n,m\in \mathbb{Z}$ define the linear operator $T_{n,m}$ on $M_{n}(\mathbb{R})$ as follow:
$$T_{n,m}(A)=\int_{O(n)}g^{n}Ag^{m}$$
Under what suficcient and  necessary condition, $T_{n,m}$ is  conjugate to $T_{n',m'}$? Is there an explicit formulation for $T_{n,m}$?
The integration is based on the Haar measear  defined on orthogonal group $O(n)$.
 A: let me work out the comments a bit further, starting from the identity (equation 8.2 from Diaconis and Evans, correcting an earlier paper by Diaconis and Shahshahani)
$$\int_{{\rm O}(n)}{\rm tr}\,g^p\,dg=\begin{cases}
0&{\rm if}\;\;p\;\;\text{is an odd integer}\\
1&{\rm if}\;\;p\;\;\text{is an even integer}
\end{cases}
$$
so the second integral of the OP evaluates to
$$\int_{{\rm O}(n)}g^p\,dg=\begin{cases}
0&{\rm if}\;\;p\;\;\text{is an odd integer}\\
n^{-1}\mathbb{1}&{\rm if}\;\;p\;\;\text{is an even integer}
\end{cases}
$$
Taylor expansion of the exponent in the first integral of the OP and term-by-term integration gives
$$
\int_{{\rm O}(n)}e^g\,dg=n^{-1}\mathbb{1}\sum_{p=0}^\infty \frac{1}{(2p)!}=\frac{\cosh 1}{n}\mathbb{1}
$$
now for the third integral of the OP, we need the fourth-order tensor
$$\int_{{\rm O}(n)}(g^p)_{ij}(g^q)_{kl}\,dg=a_{pq}(n)\delta_{ij}\delta_{kl}+b_{pq}(n)\delta_{ik}\delta_{jl}+c_{pq}(n)\delta_{il}\delta_{jk}$$
so that the required integral takes the form
$$\int_{{\rm O}(n)}g^p Ag^q\,dg=a_{pq}(n)A+b_{pq}(n)A^{\rm t}+c_{pq}(n)\mathbb{1}\,{\rm tr}\,A
$$
by taking traces I find, using again equation 8.2 from Diaconis and Evans, that
$$na_{pq}(n)+nb_{pq}(n)+n^2 c_{pq}(n)=\int_{{\rm O}(n)}{\rm tr}\,g^{p+q}\,dg=\begin{cases}
0&{\rm if}\;\;p+q\;\;\text{is an odd integer}\\
1&{\rm if}\;\;p+q\;\;\text{is an even integer}
\end{cases}
$$
$$n^2a_{pq}(n)+nb_{pq}(n)+nc_{pq}(n)=\int_{{\rm O}(n)}({\rm tr}\,g^p)({\rm tr}\,g^q)\,dg=\begin{cases}
{\rm min}\,(p,2n)&{\rm if}\;\;p=q\;\;{\rm odd}\\
{\rm min}\,(p,2n)+1&{\rm if}\;\;p=q\;\;{\rm even}\\
1&{\rm if}\;\;p\neq q\;\;\text{both even}\\
0&{\rm otherwise}
\end{cases}
$$
$$na_{pq}(n)+n^2 b_{pq}(n)+nc_{pq}(n)=\int_{{\rm O}(n)}{\rm tr}\,g^{|p-q|}\,dg=\begin{cases}
0&{\rm if}\;\;p+q\;\;\text{is an odd integer}\\
1&{\rm if}\;\;p+q\;\;\text{is an even integer}
\end{cases}
$$
Three equations with three unknowns solves the third integral.
