Lời giải:
ĐKXĐ: $x\neq \pm 1$
a.
\(P=\frac{x(x+1)-(x^2+2)}{x+1}:[\frac{x(x-1)}{(x-1)(x+1)}+\frac{x-4}{(x-1)(x+1)}]\\ =\frac{x-2}{x+1}:\frac{x(x-1)+x-4}{(x-1)(x+1)}\\ =\frac{x-2}{x+1}:\frac{x^2-4}{(x-1)(x+1)}\\ =\frac{x-2}{x+1}.\frac{(x+1)(x-1)}{(x-2)(x+2)}=\frac{x-1}{x+2}\)
b.
Để $P=2$ thì $\frac{x-1}{x+2}=2$ ($x\neq \pm 2$)
$\Rightarrow x-1=2(x+2)$
$\Leftrightarrow x=-5$ (tm)
c.
Với $x$ nguyên, để $P$ nguyên thì $x-1\vdots x+2$
$\Rightarrow (x+2)-3\vdots x+2$
$\Rightarrow 3\vdots x+2$
$\Rightarrow x+2\in\left\{\pm 1; \pm 3\right\}$
$\Rightarrow x\in \left\{-3; -1; 1; -5\right\}$
Do $x\neq \pm 1$ nên $x\in\left\{-3;-5\right\}$
d.
$P<1\Leftrightarrow \frac{x-1}{x+2}<1$
$\Leftrightarrow \frac{x-1}{x+2}-1<0$
$\Leftrightarrow \frac{-3}{x+2}<0$
$\Leftrightarrow x+2>0\Leftrightarrow x>-2$
Kết hợp đkxđ suy ra $x>-2; x\neq \pm 1; x\neq 2$