a:
ĐKXĐ: \(x\ne-1\)
Để A nguyên thì \(x^2+2x-1⋮x+1\)
=>\(x^2+2x+1-2⋮x+1\)
=>\(-2⋮x+1\)
=>\(x+1\in\left\{1;-1;2;-2\right\}\)
=>\(x\in\left\{0;-2;1;-3\right\}\)
b:
ĐKXĐ: \(x\ne-2\)
Để A nguyên thì \(2x^2+x-1⋮x+2\)
=>\(2x^2+4x-3x-6+5⋮x+2\)
=>\(5⋮x+2\)
=>\(x+2\in\left\{1;-1;5;-5\right\}\)
=>\(x\in\left\{-1;-3;3;-7\right\}\)