分段函数 f²(x)+af(x)<0 恰有一个整数解
16. 已知函数 $f(x)=\begin{cases}\dfrac{x+1}{e^{x}}, & x\le 0\\[2mm] x^{2}-x, & x>0\end{cases}$,若关于 $x$ 的不等式 $f^{2}(x)+af(x)<0$ 恰有一个整数解,则实数 $a$ 的取值范围为 $\underline{\qquad}$。
函数 $f(x)$ 图像如上图所示。
解: $f^{2}(x)+af(x)<0$,即 $f(x)\left(f(x)+a\right)<0$。
当 $a>0$ 时,有 $-a<f(x)<0$。
图像左侧:$x=-1$ 时 $f(x)=0$;$x=-2$ 时 $f(x)=-e^{2}$;$x=-3$ 时 $f(x)=-2e^{3}$。
要使 $f(x)\in(-a,0)$ 恰有一个整数解 $x=-2$:
$\therefore -2e^{3}\le -a<-e^{2}$,$\therefore e^{2}<a\le 2e^{3}$。
当 $a<0$ 时,有 $0<f(x)<-a$。
$x=0$ 时 $f(x)=1$;$x=1$ 时 $f(x)=0$;$x=2$ 时 $f(x)=2$。
要使恰有一个整数解 $x=0$:
$\therefore 1<-a\le 2$,$\therefore -2\le a<-1$。
综上:$a$ 的取值范围为 $\left(e^{2},\,2e^{3}\right]\cup\left[-2,\,-1\right)$。