# Finding the inverse Laplace transform of this function

Find the inverse Laplace transform of this function (related to my question earlier):

$$f(t)=\mathcal{L}_s^{-1}\left[\frac{s}{s+\frac{1}{\tau}}\cdot\frac{A}{s}\left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2\sum_{n=0}^{\infty}\mathrm e^{-nTs}\right]_{(s)}$$

I'm not sure how to go.

For $t>0$ we can find that:

$$f(t)=\mathcal{L}_s^{-1}\left[\frac{s}{s+\frac{1}{\tau}}\cdot\frac{A\tanh\left(\frac{Ts}{4}\right)}{s}\right]_{(s)}=A\left(e^{-\frac{t}{\tau}}-2\tau\mathcal{L}_s^{-1}\left[\frac{1}{\left(1+e^{\frac{Ts}{2}}\right)\left(1+\tau s\right)}\right]_{(s)}\right)$$

From your related question we have $F(s)=H(s)\cdot G(s)=\frac{s}{s+\frac{1}{\tau}}\cdot\frac{A}{s}\tanh\left(\frac{sT}{4}\right)$ and then \begin{align} \color{blue}{F(s)}&=\frac{A}{s+\frac{1}{\tau}}\cdot\tanh\left(\frac{sT}{4}\right) =\frac{A}{s+\frac{1}{\tau}}\cdot\frac{\mathrm e^{\frac{Ts}{4}}-\mathrm e^{-\frac{Ts}{4}}}{\mathrm e^{\frac{Ts}{4}}+\mathrm e^{-\frac{Ts}{4}}}=\frac{A}{s+\frac{1}{\tau}}\cdot\frac{1-\mathrm e^{-\frac{Ts}{2}}}{1+\mathrm e^{-\frac{Ts}{2}}}\\ &\color{blue}{=\frac{A}{s+\frac{1}{\tau}}\cdot\left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2\cdot\frac{1}{1-\mathrm e^{-sT}}}\\ &=\frac{A}{s+\frac{1}{\tau}}\cdot\left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2\cdot\sum_{n=0}^{\infty} \mathrm e^{-nTs}\\ &=\frac{A}{s+\frac{1}{\tau}}\sum_{n=0}^{\infty} \left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2\mathrm e^{-nTs}\\ &=\frac{A}{s+\frac{1}{\tau}}\sum_{n=0}^{\infty} \left[\mathrm e^{-nTs}-2\mathrm e^{-\frac{2n+1}{2}Ts}+\mathrm e^{-(n+1)Ts}\right]\\ &=A\sum_{n=0}^{\infty} \frac{1}{s+\frac{1}{\tau}}\left[\mathrm e^{-nTs}-2\mathrm e^{-\frac{2n+1}{2}Ts}+\mathrm e^{-(n+1)Ts}\right]\\ \end{align} Observing that $$\mathcal L^{-1}\left\{\frac{1}{s+a}\mathrm e^{-bs}\right\}=\mathrm e^{-a(t-b)}u(t-b)\tag{\star}$$ we have \begin{align} \mathcal L^{-1}\left\{F(s)\right\}=f(t)&=A\sum_{n=0}^{\infty}\left[\mathrm e^{-\frac{1}{\tau}\left(t-nT\right)} u\left(t-nT\right)- 2\mathrm e^{-\frac{1}{\tau}\left(t-\frac{2n+1}{2}T\right)} u\left(t-\tfrac{2n+1}{2}T\right)+\right.\\ &\qquad\quad\left.+\mathrm e^{-\frac{1}{\tau}\left(t-(n+1)T\right)} u\left(t-(n+1)T\right) \right] \end{align}
Another way is the following. Observe that if $$f(t)=\sum_{n=0}^{\infty}f_0(t-nT)$$ we have $$\mathcal L\{f(t)\}=\sum_{n=0}^{\infty}\mathcal L\{f_0(t-nT)\}=\sum_{n=0}^{\infty}F_0(s)\mathrm e^{-nTs}=F_0(s)\sum_{n=0}^{\infty}\mathrm e^{-nTs}=\frac{F_0(s)}{1-\mathrm e^{-Ts}}$$ So for your function we have $$F(s)=\underbrace{\frac{A}{s+\frac{1}{\tau}}\cdot\left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2}_{F_0(s)}\cdot\frac{1}{1-\mathrm e^{-sT}}$$ that is $$F_0(s)=\frac{A}{s+\frac{1}{\tau}}\cdot\left(1-2\mathrm e^{-\frac{Ts}{2}}+\mathrm e^{-{Ts}}\right)$$ and then using $(\star)$ we have $$f_0(t)=A\left[\mathrm e^{-\frac{t}{\tau}} u\left(t\right)- 2\mathrm e^{-\frac{1}{\tau}\left(t-\frac{T}{2}\right)} u\left(t-\tfrac{T}{2}\right)+\mathrm e^{-\frac{1}{\tau}\left(t-T\right)} u\left(t-T\right) \right]$$ and finally \begin{align} f(t)&=\sum_{n=0}^{\infty}f_0(t-nT)\\ &=A\sum_{n=0}^{\infty}\left[\mathrm e^{-\frac{1}{\tau}\left(t-nT\right)} u\left(t-nT\right)- 2\mathrm e^{-\frac{1}{\tau}\left(t-\frac{2n+1}{2}T\right)} u\left(t-\tfrac{2n+1}{2}T\right)+\right.\\ &\qquad\quad\left.+\mathrm e^{-\frac{1}{\tau}\left(t-(n+1)T\right)} u\left(t-(n+1)T\right) \right] \end{align}
A third way starting with your work $$f(t)=\mathcal{L}^{-1}\left\{k\left(\frac{1}{s+\frac{1}{\tau}}\right)\left(1-\frac{2}{\mathrm e^{\frac{T}{2}s}+1}\right)\right\} = A\,\mathrm e^{-\frac{t}{\tau}} - 2A\tau \, \mathcal{L}^{-1}\left\{\frac{1}{\left(1+\mathrm e^{\frac{T}{2}s}\right)\left(1+\tau s\right)}\right\}$$ then, observing that $$\frac{1}{1+\mathrm e^{\frac{T}{2}s}}=\sum_{n=0}^{\infty} (-1)^{n}\mathrm e^{-\frac{T}{2} (n+1) s}$$ we have \begin{align} \mathcal{L}^{-1}\left\{\frac{1}{\left(1+\mathrm e^{\frac{T}{2}s}\right)\left(1+\tau s\right)}\right\} &= \sum_{n=0}^{\infty} (-1)^{n} \, \mathcal{L}^{-1}\left\{\frac{\mathrm e^{-\frac{T}{2} (n+1) s}}{1+\tau s}\right\} \\ &= \frac{1}{\tau} \, \sum_{n=0}^{\infty} (-1)^{n} \, u\left(t - (n+1) \frac{T}{2}\right) \, \mathrm e^{- \frac{1}{\tau}\left(t - \frac{T}{2} (n+1)\right)} \end{align} which leads to $$f(t)= A\left[\mathrm e^{-\frac{t}{\tau}} - 2 \sum_{n=0}^{\infty} (-1)^{n} \, u\left(t - (n+1) \frac{T}{2}\right) \, \mathrm e^{- \frac{1}{\tau}\left(t - \frac{T}{2} (n+1)\right)}\right]$$