  Making use of nonabelian harmonic analysis and representation theory, we
solve the functional equation
$$f_1(xy)+f_2(yx)+f_3(xy^{-1})+f_4(y^{-1}x)=f_5(x)f_6(y)$$ on arbitrary compact
groups. The structure of its general solution is completely described.
Consequently, several special cases of the above equation, in particular, the
Wilson equation and the d'Alembert long equation, are solved on compact groups.
