Differential difference equation $y'(t)+y(t-\frac{1}{2}\pi)-y(t-\pi)=\cos t$
is the equation I am trying to solve. I want to find all solutions with period $2\pi$. Now I have tried with assuming that $y(t)\sim \sum c_ne^{int}=\frac{a_0}{2}+\sum (a_n\cos nt +b_n\sin nt)$ and then differentiating and putting it back into the equation, but I do not know how to handle the second term $y(t-\frac{1}{2}\pi)$.
Let me show you: $y(t-\frac{1}{2}\pi)\sim \sum c_ne^{int-in\frac{\pi}{2}}=\sum c_ne^{int}e^{-in\frac{\pi}{2}}$ ... from here I don't know how to convert the $e^{-in\frac{\pi}{2}}$ into something "nicer", for example $e^{-in\pi}=(-1)^n$. Is there an analog for this term?
I hope I made myself clear. If someone would show a complete solution that would help, too! Best regards //
 A: To the complex numbers question: $e^{-i\frac\pi2}=-i$ so $e^{-in\frac\pi2}=(-i)^n=i^{-n}$.

Consider first $y_k(t)=y(t-k\frac\pi2)$ as independent $2\pi$ periodic functions. At the end, the integration constant will have to be adapted so that they all are the same function again, if at all possible.
Then these $4$ functions satisfy the first order system
$$
\pmatrix{y_0'\\y_1'\\y_2'\\y_3'}
+
\pmatrix{0&1&-1&0\\0&0&1&-1\\-1&0&0&1\\1&-1&0&0}
\pmatrix{y_0\\y_1\\y_2\\y_3}
=
\pmatrix{\cos(t)\\\sin(t)\\-\cos(t)\\-\sin(t)}
$$
The circulant matrix can be written as $A=Q-Q^2$ where $Q^4=I$, so $A$ has eigenvalues $\lambda_k=q^k-(q^k)^2=0$, $1+i$, $-2$, $1-i$ for the eigenvalues $q^k=i^k$ and eigenvectors $v^k_j=i^{jk}$, $j=0,1,2,3$, $k=0,1,2,3$, of $Q$. Of these components of the homogeneous solution, only the first one as a constant is again $2\pi$ periodic, the others have exponentially increasing or decreasing factors.
So the qualitative conclusion is that a periodic solution for $y$ can only have the components $$y(t)=A+B\cos(t)+C\sin(t).$$ Inserting this gives
$$
(-B\sin t+C\cos t)+(A+B\sin t-C\cos t)-(A-B\cos t-C\sin t)=\cos t
\\
\implies\left\{\begin{aligned}
B&=1\\C&=0
\end{aligned}\\\right.
$$

One could also do the first part slightly different by considering linear combinations of the shifted functions,
$$u_k(t)=\sum_{k=0}^3i^ky(t-k\frac\pi2),~~k=0,1,2,3, ~~~~ (i^4=1, ~~ y(t-2\pi)=y(t)). $$ Then
\begin{align}
u_k'(t)+\sum_{m=0}^3i^{km}y(t-(m+1)\frac\pi2)-\sum_{m=0}^3i^{km}y(t-(m+2)\frac\pi2)
&=\sum_{k=0}^3i^{km}\cos(t-m\frac\pi2)
\\~\\
u_k'(t)+(i^k-(-1)^k)u(t)&=(1-(-1)^k)\cos(t)+i^k(1-(-1)^k)\sin(t)
\end{align}
This is a linear ODE with constant coefficients for each of the 4 values of $k$, and the solution can be reconstructed from them by solving the corresponding linear system or a là the inverse Fourier transform.
