Đặt \(\sqrt{x^2+4x+5}=t\Rightarrow t\in\left[\sqrt{2};\sqrt{26}\right]\)
\(f\left(t\right)=-t^2+5+2t+7=-t^2+2t+12\)
\(-\frac{b}{2a}=1\notin\left[\sqrt{2};\sqrt{26}\right]\)
\(f\left(\sqrt{2}\right)=10+2\sqrt{2}\) ; \(f\left(\sqrt{26}\right)=-14+2\sqrt{26}\)
\(\Rightarrow f_{max}=10+2\sqrt{2}\) ; \(f_{min}=-14+2\sqrt{26}\)