I'm having huge trouble with figuring out fourier series as soon as I'm not dealing with a really simple function.
I found a solution to my problem (fourier series for $|cos(x)|$, I'm troubled by the result in line (4) here if anyone has the time to check it out; Fourier Series for $|\cos(x)|$), but there's a part I simply can't understand.
I see that $cos(\pi*n)$ is represented as $(-1)^n$, which is pretty clear.
How about $sin(\pi/2+n*\pi/2$)? I thought it was exactly the same as $-cos(n*\pi/2)$ which would then be... $(-1)^{2n+1}$ ? I thought it was correct but my end result isn't correct.
Could anyone please explain what all of this means? When do I use n and when do I use 2n+1?
Using the addition angle formula $\sin(x+y)=\sin(x)\cos(y)+\cos(x)\sin(y)$ reveals
$$\begin{align} \sin(\pi/2-n\pi/2)&=\underbrace{\sin(\pi/2)}_{=1}\,\cos(n\pi/2)-\underbrace{\cos(\pi/2)}_{=0}\sin(n\pi/2)\\\\ &=\cos(n\pi/2)\\\\ &=\begin{cases} 0&,n\,\text{odd}\\\\ 1&,n=4m\\\\ -1&,n=2(2m-1) \end{cases} \end{align}$$