a: \(\dfrac{A\left(x\right)}{B\left(x\right)}=\dfrac{x^2+ax-5}{x+2}=\dfrac{x^2+2x+\left(a-2\right)x+2\left(a-2\right)-2a+4-5}{x+2}\)
\(=x+\left(a-2\right)+\dfrac{-2a-1}{x+2}\)
A(x) chia B(x) dư 3 nên -2a-1=3
=>2a+1=-3
=>2a=-4
=>a=-2
b: Không có a nha bạn