Characterizing functions which satisfy de Moivre's theorem

Let $f$ and $g$ be two non-zero functions $\mathbb R \to \mathbb R$ which are continuous and differentiable everywhere. Furthermore, say that for all integer $n$:

$$(f(\theta) + i g(\theta))^n = f(n\theta) + ig(n\theta) \tag{de Moivre's Theorem}$$

Does it follow that $f(\theta) = e^{bx} \cos a\theta$ and $g(\theta) = e^{bx} \sin a\theta$ for some $a$ and $b$? If not, can we characterize all pairs of functions $f$ and $g$ satisfying this identity? (edit: changed conjectured forms for $f$ and $g$)

I have derived some facts about $f$ and $g$:

$$f(0) = 1 \text{ and } g(0) = 0$$ $$f(\theta)^2 + g(\theta)^2 = 1$$ $$f(n\theta) = f(\theta)f((n-1)\theta) - g(\theta)g((n-1)\theta)$$ $$g(n\theta) = g(\theta)f((n-1)\theta) + f(\theta)g((n-1)\theta)$$

• Hint: Let $f(\theta)+ig(\theta)=a(\theta)e^{i\phi(\theta)}$ then, since $f$ and $g$ are non-zero,$\frac{a(\theta)^n}{a(n\theta)}=e^{i[\phi(n\theta)-n\phi(\theta)]}\in \mathbb{R}\,\forall n$. – lemon Sep 1 '14 at 16:54

Let $q(x) = f(x) + i g(x)$. Now we have that:
$$q(x)^n = q(nx)$$
From which $q(x)$ is the exponential function:
$$q(x) = e^{cx} \text{ with } c\in \mathbb C$$