I am learning signals and systems.
Our teacher give us the following answer, it's about Laplace transform .
But I can't figure out the second line, the calculation of k1,k2,k3,k4.
why they can be solve in this way?
I know a way to solve is using undetermined coefficient.But I don't know the method used by the teacher.

Start with the partial fraction expansion
$$\frac{s-2}{s(s+1)^3}=\frac{k_1}{(s+1)^3}+\frac{k_2}{(s+1)^2}+\frac{k_3}{s+1}+\frac{k_4}{s} \tag 1$$
Now, multiplying both sides of $(1)$ by $(s+1)^3$ yields
$$\frac{s-2}{s}=k_1+k_2(s+1)+k_3(s+1)^2+\frac{k_4(s+1)^3}{s} \tag 2$$
Taking the limit of both sides of $(2)$ as $s\to -1$, we find
$$\bbox[5px,border:2px solid #C0A000]{k_1=\lim_{s\to -1}\frac{s-2}{s}}$$
Next, taking the derivative of both sides of $(2)$ with respect to $s$, we obtain
$$\frac{d}{ds}\left(\frac{s-2}{s}\right)=k_2+2k_3(s+1)-k_4\frac{(s+1)^3}{s^2}+k_4\frac{3(s+1)^2}{s} \tag 3$$
Taking the limit of both sides of $(3)$ as $s\to -1$ reveals
$$\bbox[5px,border:2px solid #C0A000]{k_2=\lim_{s\to 1}\frac{d}{ds}\left(\frac{s-2}{s}\right)}$$
Continuing, we take the second derivative with respect to $s$ of both sides of $(2)$ and then take the limit as $s\to -1$ to expose
$$\lim_{s\to -1}\frac{d^2}{ds^2}\left(\frac{s-2}{s}\right)=2k_3$$
whereupon solving for $k_3$ we have
$$\bbox[5px,border:2px solid #C0A000]{k_3=\frac12 \lim_{s\to -1}\frac{d^2}{ds^2}\left(\frac{s-2}{s}\right)}$$
And finally, multiplying both sides of $(1)$ and taking the limit as $s\to 0$ yields
$$\bbox[5px,border:2px solid #C0A000]{k_4=\lim_{s\to 0}\frac{s-2}{(s+1)^3}}$$