I have the following functional equation with me:
$f(x-y)=f(x)f(y)+g(x)g(y)$
$f(x)=\cos x $ and $g(x)=\sin x$ is an obvious solution but I have some trouble proving it. I have obtained the following simple results by simple substitutions
Firstly interchanging $x$ and $y$ tells me that the function is an even function.
Furthermore $x=y$ gives me
$f(0) = f(x)^2 + g(x)^2$.
Setting $y=0$ in the original equation gives me
$f(x) = f(x)f(0) + g(x)g(0)$.
Now from here I can clearly note that if $f(0)=0$ then both $f(x)$ and $g(x)$ are equal to zero. However I am unable to proceed from here. How do I proceed from here? My book just mentions that since $f(x)[1-f(0)]=g(x)g(0)$, $f(0) = 1$ and $g(0)=0$. How do I conclude this?
Assume that $g(0)$ is not zero. Then $g(x) = \dfrac{1 - f(0)}{g(0)}f(x) = Cf(x)$, so $f(x-y) = (1 + C) f(x)f(y)$.
Setting $x = 2y$ gives $$f(y) = (1 + C) f(2y) f(y)$$ that is $f(2y)$ would be a constant (as long as $f(y)$ is not $0$).
So to get an interesting solution we must assume that $g(0) = 0$. $f(0) = 1$ follows.