As I understand it:
$\cos^2(t)$ is even because it is a product of two even functions $\cos(t)$.
The Fourier series and Fourier cosine series of an even function is the same link.
So in the fourier series expansion $\cos^2(t)={a_0 \over 2}+\sum_{n=1}^\infty(a_n\cos(n \omega t) + b_n \sin(n \omega t))$, I expect $a_n\neq 0$ and $b_n=0$.
I try to get the the coefficients with wolfram alpha like this:
$a_n$ with FourierCosCoefficient[$\cos(t)^2,t,n$] gives zero link
$b_n$ with FourierSinCoefficient[$\cos(t)^2,t,n$] gives non-zero link
Which of my assumptions are wrong?
(I also got $a_n=0$ when calculating by hand so the question is not primarily about wolfram alpha but about the relation between Fourier series, Fourier cosine series, and even functions)
It is clear that, for each $n\in\mathbb N$,$$\int_{-\pi}^\pi\cos^2(t)\sin(nt)\,\mathrm dt=0,$$since $t\mapsto\cos^2(t)\sin(nt)$ is an odd function.
On the other hand,$$a_0=\frac1\pi\int_{-\pi}^\pi\cos^2(t)\,\mathrm dt=1\neq0.$$It turns out that $a_1=0$, but $a_2=\frac12\neq0$.