$\DeclareMathOperator{\Res}{Res}$ $\DeclareMathOperator{\e}{e}$ We did the following equations in our lecture:
Calculate $x(t)$ with the help of the residue-calculus: $X(s)=\frac{s^2}{(s+1)^3}$
$x(t)=\sum\Res\left[x(-s)\e^{st}\right]=\Res_{s=-1}\left[\frac{s^2}{(s+1)^3}\e^{st}\right]=\frac{1}{2!}\lim_{s\to-1} \frac{d^2}{ds^2}\left[\frac{s^2\color{red}{(s+1)^3}}{(s+1)^3}\e^{st}\right]$
$x(t)=\frac{1}{2}\lim_{s\to-1} \frac{d}{ds}\left[(s^2t+2s)\e^{st}\right]=\frac{1}{2}\e^{st}(s^2t^2+4st+2)|_{s=-1}$
$x(t)=\frac{1}{2}\e^{-t}(t^2-4t+2)\quad (t>0)$
Why is it allowed to do this (the highlighted part)?
The residue is by definition the coefficient in front of $(s+1)^{-1}$ in the Laurent expansion of your function, let's call it $f$. As $f$ has a pole of order $3$ in $-1$ you multiply by $(s+1)^3$ to get a holomorphic function $g(s) = (s+1)^3f(s)$. The Laurent series of $g$ is now just a Taylor series, hence you can easily compute the coefficients via derivatives. The second derivative yields the correct coefficient because the $(s+1)^{-1}$-coefficient of $f$ is the $(s+1)^2$-coefficient of $g$ by construction.