Write $\cos^2(x)$ as linear combination of $x \mapsto \sin(x)$ and $x \mapsto \cos(x)$

The function $f(x):=\cos^2 x$ has $f(x+\pi)\equiv f(x)$, but any linear combination $g$ of $\cos$ and $\sin$ has $g(x+\pi)\equiv -g(x)$.


Say we can do that, then

$$\cos^2x-b\cos x = a\sin x$$ Let $t= \cos x$ and square this equation. We get $$ t^4-2bt^3+b^2t^2 = a^2-a^2t^2$$ which should be valid for all $t\in[-1,1]$ and there for for all $t$. So the polynomials must be equal for all $t$, so by comparing the coeficients we get $1=0$. A contradiction.

So you can not express $\cos ^2x$ as linear combination of $\cos x$ and $\sin x$.