\(A=\dfrac{2x\left(x+1\right)\left(x-2\right)^2}{x\left(x-2\right)\left(x+2\right)\left(x+1\right)}=\dfrac{2\left(x-2\right)}{x+2}\\ A=\dfrac{2\left(\dfrac{1}{2}-2\right)}{\dfrac{1}{2}+2}=\dfrac{2\left(-\dfrac{3}{2}\right)}{\dfrac{5}{2}}=\left(-3\right)\cdot\dfrac{2}{5}=-\dfrac{6}{5}\)
\(B=\dfrac{x\left(x^2-xy+y^2\right)}{\left(x+y\right)\left(x^2-xy+y^2\right)}=\dfrac{x}{x+y}=\dfrac{-5}{-5+10}=\dfrac{-5}{5}=-1\)