Lời giải:
Để pt có hai nghiệm: \(\Delta=(2m-1)^2-4(m^2+m)>0\)
\(\Leftrightarrow 1-8m>0\Leftrightarrow m< \frac{1}{8}(1)\)
Áp dụng định lý Viete: \(\left\{\begin{matrix} x_1+x_2=2m-1\\ x_1x_2=m^2+m\end{matrix}\right.\)
Để \(-2< x_1< x_2\Leftrightarrow \left\{\begin{matrix} (x_1+2)(x_2+2)>0\\ x_1+x_2>-4\end{matrix}\right.\)
\(\Leftrightarrow \left\{\begin{matrix} x_1x_2+2(x_1+x_2)+4>0\\ x_1+x_2>-4\end{matrix}\right.\)
\(\Leftrightarrow \left\{\begin{matrix} m^2+5m+2>0\\ 2m-1>-4\end{matrix}\right.\Leftrightarrow m> \frac{-5+\sqrt{17}}{2}\) (2)
Để \(x_1< x_2< 4\Leftrightarrow \left\{\begin{matrix} (x_1-4)(x_2-4)> 0\\ x_1+x_2< 8\end{matrix}\right.\)
\(\Leftrightarrow \left\{\begin{matrix} x_1x_2-4(x_1+x_2)+16>0\\ x_1+x_2< 8\end{matrix}\right.\)
\(\Leftrightarrow \left\{\begin{matrix} m^2-7m+20>0\\ 2m-1< 8\end{matrix}\right.\Leftrightarrow m< \frac{9}{2}\) (3)
Từ (1)(2)(3) suy ra \(\frac{-5+\sqrt{17}}{2}< m< \frac{1}{8}\Rightarrow m=0\)
Do đó \(S=0\)