a)
ĐKXĐ: \(x\ne-4\)
Để A nguyên thì \(3x+21⋮x+4\)
\(\Leftrightarrow3x+12+9⋮x+4\)
mà \(3x+12⋮x+4\)
nên \(9⋮x+4\)
\(\Leftrightarrow x+4\inƯ\left(9\right)\)
\(\Leftrightarrow x+4\in\left\{1;-1;3;-3;9;-9\right\}\)
\(\Leftrightarrow x\in\left\{-3;-5;-1;-7;5;-13\right\}\)(nhận)
Vậy: Để A nguyên thì \(x\in\left\{-3;-5;-1;-7;5;-13\right\}\)
b) ĐKXĐ: \(x\ne\dfrac{1}{2}\)
Để B nguyên thì \(2x^3-7x^2+7x+5⋮2x-1\)
\(\Leftrightarrow2x^3-x^2-6x^2+3x+4x-2+7⋮2x-1\)
\(\Leftrightarrow x^2\left(2x-1\right)-3x\left(2x-1\right)+2\left(2x-1\right)+7⋮2x-1\)
\(\Leftrightarrow\left(2x-1\right)\left(x^2-3x+2\right)+7⋮2x-1\)
mà \(\left(2x-1\right)\left(x^2-3x+2\right)⋮2x-1\)
nên \(7⋮2x-1\)
\(\Leftrightarrow2x-1\inƯ\left(7\right)\)
\(\Leftrightarrow2x-1\in\left\{1;-1;7;-7\right\}\)
\(\Leftrightarrow2x\in\left\{2;0;8;-6\right\}\)
hay \(x\in\left\{1;0;4;-3\right\}\)(nhận)
Vậy: \(x\in\left\{1;0;4;-3\right\}\)