TITLE: functions satisfying $f(x - y) = f(x) f(y) - f(a - x) f(a + y)$ and $f(0)=1$
QUESTION [6 upvotes]: A real valued function $f$ satisfies the functional equation
$$f(x - y) = f(x) f(y) - f(a - x) f(a + y) \tag 1 \label 1$$
Where $a$ is a given constant and $f(0) = 1$. Prove that $f(2a - x) = -f(x)$, and find all functions which satisfy the given functional equation.
My Try:
Put $x=y=0$ in equation \eqref{1}.
$\implies f(0)=f(0)^2-f(a)\cdot f(a)\implies f(a)^2=0\implies f(a)=0$.
Now Put $x=a$ and $y=x-a$.
$\implies f(2a-x)=f(a)\cdot f(x-a)-f(0)\cdot f(x) = -f(x)$.
My question is how can I find all function which satisfy the given functional equation.
Help me.
Thanks.

REPLY [4 votes]: It seems that if $a \ne 0$, then $f(x) = \cos\frac{\pi }{2a}x$, and if $a = 0$, there is no solution!
Sketch of proof: The case $a=0$ is obvious. So let that $a\ne0$. With a change of variable the equation can be change to
$$
f(x+y) = f(x)f(y)-f(\pi/2-x)f(\pi/2-y).
$$
Let $g(x)=f(x)+i f(\pi/2 -x)$. Then one can easily see that $g(x+y)=g(x)g(y)$. From this and $g(0)=1 $ one can see that $g(x) = e^x$ and the rest is straightforward.