I want to solve
$$y''+\omega^2y=f(t)\,,\,y(0)=y'(0)=0$$
where $f(t)=\sum_{k=0}^{\infty} (-1)^ku_k(t)$ is the square wave, $u_k(t)$ the unit step function jumping at $t=k$. I am not sure how to find the Laplace transform of the infinite sum. Taking Laplace transforms of both sides I get $$Y(s)=\frac{1}{s(s^2+\omega^2)}(\sum_{k=0}^{\infty} (-1)^ke^{-ks}).$$ The inverse of $\frac{1}{s(s^2+\omega^2)}$ I worked out ut to be $\frac{1}{\omega^2}u_0(t)-\frac{1}{\omega^2}\cos(\omega t)$. According to Wolfram Alpha $\sum_{k=0}^{\infty} (-1)^ke^{-ks}=\frac{e^s}{1+e^s}$ (?), but I cannot see what the inverse of that could be.
If $f(t)$ be a periodic function with period $T>0$ and in $[0,T]$ has Laplace transform, then for $s>0$ $${\cal L}(f)=\frac{\int_0^T e^{-st}f(t)dt}{1-e^{-sT}}$$ since the variable take from $[nT,(n+1)T]$ and with substitution $x=t-nT$ we have: \begin{eqnarray*} {\cal L}(f) &=& \int_{0}^{\infty}e^{-st}f(t)dt \\ &=& \int_{0}^{T}e^{-st}f(t)dt+\int_{T}^{2T}e^{-st}f(t)dt+\int_{2T}^{3T}e^{-st}f(t)dt+\cdots \\ &=& (1+e^{-sT}+e^{-2sT}+e^{-3sT}+\cdots)\int_{0}^{T}e^{-st}f(t)dt \\ &=& \frac{1}{1-e^{-sT}}\int_{0}^{T}e^{-st}f(t)dt \end{eqnarray*}