# D'alembert functional equation

The D'Alembert functional equation is $f(x+y)+f(x-y)=2f(x)f(y)$. Let $f:\mathbb{R}\rightarrow\mathbb{R}$ satisfy the functional equation for all $x,y\in\mathbb{R}$. It's well known that $f$ is of the form $f(x)=\frac{E(x)+E^∗(x)}{2}$, for some $E:\mathbb{R}\rightarrow\mathbb{C}$. How can I use this functional equation to solve the following problem?

Let $\lambda$ be a nonzero real constant. Find all functions $f,g:\mathbb{R}\rightarrow\mathbb{R}$ that satisfy the functional equation $f(x+y)+g(x-y)=\lambda f(x)g(y)$ for all $x,y\in\mathbb{R}$.

$$f(x)+g(x)=\lambda g(0)f(x)$$ $$\therefore g(x)=(\lambda g(0)-1)f(x)$$ $$\therefore f(x+y)+(\lambda g(0)-1)f(x-y)=(\lambda g(0)-1)f(x)f(y)\qquad{\bf(1)}$$ $$\therefore f(y+x)+(\lambda g(0)-1)f(y-x)=(\lambda g(0)-1)f(y)f(x)$$ Subtracting the last two equations and putting $y=0$: $$\therefore (\lambda g(0)-1)(f(x)-f(-x))=0$$ Now if $\lambda g(0)-1=0$ then $f$ and $g$ are both equal to the constant zero function. Else, $f$ must be an even function. In this case, substituting $-y$ for $y$ in (1): $$\therefore f(x-y)+(\lambda g(0)-1)f(x+y)=(\lambda g(0)-1)f(x)f(-y)\qquad{\bf(2)}$$ Adding (1) and (2) and using evenness of $f$ we get: $$\lambda g(0)(f(x+y)+f(x-y))=2(\lambda g(0)-1)f(x)f(y)$$ Now if $g(0)=0$ then by the last equation $(f(x))^2=0$ and so $f$ is equal to the constant zero function. Otherwise, we get: $$f(x+y)+f(x-y)=\mu f(x)f(y)$$ where $\mu=\frac{2(\lambda g(0)-1)}{\lambda g(0)}$. Now if we define the function $h$ by the equation $h(x)=\frac{\mu}{2}f(x)$ then $h$ satisfies D'Alembert functional equation.