Given the closed loop transfer function $W(s)$, I have to analyze the stability of the system.
$$ W(s) = \frac{\dfrac{2s + 2 + k}{s^2 + 3s +2}}{1 + \dfrac{2s^2 + 2s + ks}{s^3 + 3s^2 + 2s}} $$
After some calculations, I got
$$ W(s) = \frac{s(s+1)(s+2)(2s + 2 + k)}{s(s+1)(s+2)(s^2 + 5s + 4 + k)} $$
Now, I should apply the Routh-Hurwitz criterion in order to analyze the stability of the system. However, I am having an hard time understanding whether I should simplify $s(s+1)(s+2)$ or not. If I am not mistaken, given that $s = -1$ and $s = -2$ are two poles which belong to the LHP, I should be able to simplify $(s+1)(s+2)$, while I don't know what to do with the pole in the origin.
I have tried to apply the criterion without simplifying anything and considering the polynomial $$Q(s,k) = s(s+1)(s+2)(s^2 + 5s + 4 + k)$$ Doing so, I get that the system should be marginally stable for $k > -4$. At the same time, however, I have tried to simulate the model and the response resembles that of an asymptotically stable system: does this imply that I am forced to simplify the pole/zero in the origin?
It is incorrect to say that the system is marginally stable when $k > -4$, because the system is marginally stable when $k = -4$.
To do a proper stability analysis, we begin with the feedforward transfer function that is given by $$ G(s) = \frac{2 s + 2 + k}{s^2 + 3 s + 2} $$ If the open-loop transfer function $G(s) H(s) = G(s)$, then the closed-loop transfer function is given by $$ G_{cl}(s) = \frac{G(s)}{1 + G(s)} = \frac{2 s + 2 + k}{s^2 + 5 s + 4 + k} $$ The Routh–Hurwitz Stability Criterion can be applied. According to the criterion for a 2nd-order characteristic equation $s^2 + c s + 1 = 0$, the system is stable if $c > 0$ (you can actually prove this using the quadratic formula). Before applying the criterion, the characteristic equation should be normalized first so that we can make the apple-to-apple comparison: $$ \begin{aligned} s^2 + 5 s + 4 + k &= 0 \\ \omega_{n}^{2} &= 4 + k \\ \frac{s^2}{\omega_{n}^{2}} + \frac{5}{\omega_{n}} \frac{s}{\omega_{n}} + \frac{\omega_{n}^{2}}{\omega_{n}^{2}} &= 0 \\ \bar{s}^2 + \frac{5}{\sqrt{4 + k}} \bar{s} + 1 &= 0 \\ \end{aligned} $$ From the normalized form of the characteristic equation, we can solve the inequality for $k$, and conclude that the closed-loop system will be stable when $$ \begin{aligned} \frac{5}{\sqrt{4 + k}} &> 0 \\ k &> -4 \\ \end{aligned} $$ Note: It is actually unnecessary to use this normalization approach to apply the Routh–Hurwitz Stability Criterion for a 2nd-order system, if you understand the properties of the Quadratic equation, $a x^2 + b x + c = 0$.
However, it can be much more efficient when dealing when higher-order systems. Else, you need to be meticulous when creating the Routh–Hurwitz Table using the ordinary approach.