Functional equations and harmonic extensions