How can I solve this functional equation, where $x,y$ are any real numbers and $f:\mathbb{R}\to \mathbb R$ is a function such that : $$f(x+y)+f(x-y)=2f(x)\cos y$$
I tried substituting $x=0$ to get $f(y)+f(-y)=2f(0)\cos y$ . Taking $x=y$ gives $f(2x)+f(0)=2f(x)\cos x$. I similar get some more relations like that, but its not really helping me in finding anything useful. I also think the function must either be $\sin$ or $\cos$ looking at the product to sum formulae. Can anyone tell me how should I solve this?
If you could assume (or prove) that $f$ belongs to $\mathcal{C}^2(\mathbb{R})$, then you could do something like this:
Fix an arbitrary $x$, and apply $\frac{\mathrm{d}}{\mathrm{d}y}$ to both sides
\begin{align} f(x+y) + f(x-y) &= 2f(x)\cos(y)\\ f'(x+y) - f'(x-y) &= -2f(x)\sin(y)\\ f''(x+y) + f''(x-y) &= -2f(x)\cos(y) \end{align}
adding the first and last equality together yields
$$f''(x+y) + f''(x-y) + f(x+y) + f(x-y) = 0$$
for any $x \in \mathbb{R}$. Now substitute $y = 0$ to get $f''(x) + f(x) = 0$ with general solution $$f(x) = c_1 \sin(x) + c_2 \cos(x).$$
I hope this helps $\ddot\smile$