Maths WorkshopMaths problems with full solutions
Exercise 100Calculus › Single-variable calculus › Continuity › Functional equationsOlympiadAdded 4 Nov 2026

f(x + y) + f(x − y) = 2f(x)f(y)

#d'Alembert#cosine#differential equation#differentiability

Statement

Let f:R→Rf:\mathbb{R}\to\mathbb{R} be twice differentiable, not identically zero, with
f(x+y)+f(x−y)=2f(x)f(y)for all x,y.f(x+y)+f(x-y)=2f(x)f(y)\quad\text{for all }x,y.
Find ff.

Hint

Show f(0)=1f(0)=1 and that ff is even. Differentiate twice with respect to yy and set y=0y=0: you get a differential equation f′′=kff''=kf.

Show solutionHide solution

Solution

f(0)=1f(0)=1. For x=y=0x=y=0, we have 2f(0)=2f(0)22f(0)=2f(0)^2, so f(0)∈{0,1}f(0)\in\{0,1\}. If f(0)=0f(0)=0, then y=0y=0 gives 2f(x)=02f(x)=0 for all xx, excluded. So f(0)=1f(0)=1.

Evenness. x=0x=0: f(y)+f(−y)=2f(y)f(y)+f(-y)=2f(y), i.e. f(−y)=f(y)f(-y)=f(y) and ff is even. Observe also that
f'(0) = \lim_{y \rightarrow 0} \frac{f(y) - f(-y)}{2y} =0$. **Differential equation.** Fix $x$ and differentiate twice with respect to $y$:f''(x+y)+f''(x-y)=2f(x)f''(y).Put $y=0$: $2f''(x)=2f(x)f''(0)$, i.e.f''(x)=kf(x),\qquad k=f''(0),$$
with f(0)=1f(0)=1, f′(0)=0f'(0)=0. By uniqueness of solutions of linear ODEs:
- k=0k=0: f(x)=1f(x)=1;
- k=ω2>0k=\omega^2>0: f(x)=cosh⁡(ωx)f(x)=\cosh(\omega x);
- k=−ω2<0k=-\omega^2<0: f(x)=cos⁡(ωx)f(x)=\cos(\omega x).

Verification. cos⁡(x+y)+cos⁡(x−y)=2cos⁡xcos⁡y\cos(x+y)+\cos(x-y)=2\cos x\cos y and cosh⁡(x+y)+cosh⁡(x−y)=2cosh⁡xcosh⁡y\cosh(x+y)+\cosh(x-y)=2\cosh x\cosh y; constant 11 gives 2=22=2 ✓.

Remark. This is d'Alembert's equation; the name "cosine functional equation" comes from the trigonometric identity. Continuity alone (without differentiability) is already enough, but needs a more delicate argument (integrate against a bump function to get smoothness).

Lesson. When a functional equation has a smoothness hypothesis, differentiating in one variable and plugging a special value often produces an ODE.