Let $G$ be a finite group of exponent $n$ and let $d\mid n$. Consider the class function 
$$
f(g) = 
\begin{cases}
1 & g^d =1\\0&\textrm{otherwise}.
\end{cases}
$$
As a class function $f$ can be written as $f= \sum\_{\chi} c\_{\chi} \chi$, with 
$$
c\_{\chi} =\left<f,\chi \right> = \frac{1}{|G|} \sum\_{g^d=1} \chi(g)
$$ 
and where $\chi$ runs over the irreducible characters of $G$. 



> 
> **Q.** Is there an explicit formula for $c\_{\chi}$?
> 
> 
> 


The question is motivated by the fact that when $G$ is cyclic there is a nice formula: Write $n=dk$, then $f = \sum\_{\chi^k=1} \chi$. 



How to explicitly expand a class function in terms of irreducible characters?
This is a partial answer. Frobenius investigated such Fourier coefficients to prove that the number of solutions to $x^d=1$ is divides the order of the group. He showed your class function is a virtual character, if I understood correctly, so all your Fourier coefficients are integers. The paper of Frobenius is in German so I can't read it. The paper <http://u.cs.biu.ac.il/~vishne/publications/S0219498811004690.pdf>, and its references,
should give you some of what you want.


