
Développons $f(x)$ :
\begin{align*}
f(x)&=\big(\cos x + \sin x\big)^2 + \big(\cos x - \sin x\big)^2\\
& = \cos^2x+\cancel{2\cos x\sin x}+\sin^2x + \cos^2x - \cancel{2\cos x\sin x} + \sin^2x\\
& = 2(\cos^2x+\sin^2x)\\
& = 2 \times 1\\
& = 2.
\end{align*}
