a: \(\Leftrightarrow x^4+x^3-x^3-x^2+\left(a+1\right)x^2+\left(a+1\right)x-\left(a+1\right)x-a-1+b⋮x+1\)
=>b=0 và a+1=0
=>a=-1 và b=0
b: \(\dfrac{2x^3+ax+b}{x+1}=\dfrac{2x^3+2x^2-2x^2-2x+\left(a+2\right)x+a+2+b-a-2}{x+1}\)
=>b-a-2=6
\(\dfrac{2x^3+ax+b}{x-1}\)
\(=\dfrac{2x^3-2x^2+2x^2-2x+\left(a+2\right)x-a-2+a+2+b}{x-1}\)
=>a+b+2=21
=>a=11/2; b=27/2