Example 3 Find the range of $y=\frac{x^{2}+7 x+10}{x+1}(x \neq-1)$
This problem seems unable to use the AM-GM inequality, but we can factor the numerator to form $(x+1)$, and then separate it.
$y=\frac{x^{2}+7 x+10}{x+1}=\frac{(x+1)^{2}+5(x+1)+4}{x+1}=$
$$(x+1)+\frac{4}{x+1}+5$$

When $x+1>0$, i.e., $x>-1$, $y \geqslant 2 \sqrt{(x+1) \frac{4}{x+1}}+5=$ 9 (the equality holds if and only if $x=1$); When $x+1>0, m>0, g(x)$ is always positive or always negative), we can transform it into the form of a fraction, and then use the AM-GM inequality to find the extremum.