\(\Delta'=\left(m+3\right)^2-m^2+1=6m+10\ge0\Rightarrow m\ge-\frac{5}{3}\)
Theo định lý Viet: \(\left\{{}\begin{matrix}x_1+x_2=2\left(m+3\right)\\x_1x_2=m^2-1\end{matrix}\right.\)
\(Q=x_1+x_2-3x_1x_2\)
\(Q=2\left(m+3\right)-3\left(m^2-1\right)=-3m^2+2m+9\)
\(Q=-3\left(m-\frac{1}{3}\right)^2+\frac{28}{3}\le\frac{28}{3}\)
\(\Rightarrow Q_{max}=\frac{28}{3}\) khi \(m=\frac{1}{3}\)