a: \(=\dfrac{x^3-1}{x+2}\cdot\dfrac{x^2+x+1-x^2+1}{\left(x-1\right)\left(x^2+x+1\right)}\)
\(=\dfrac{x+2}{x+2}=1\)
b: \(=\dfrac{\left(x+2\right)\left(x-1\right)\left(x+1\right)}{2\left(x+5\right)}\cdot\left(\dfrac{x+1-2x+2}{\left(x-1\right)\left(x+1\right)}+\dfrac{1}{x+2}\right)\)
\(=\dfrac{\left(x+2\right)\left(x-1\right)\left(x+1\right)}{2\left(x+5\right)}\cdot\left(\dfrac{-\left(x-3\right)}{\left(x-1\right)\left(x+1\right)}+\dfrac{1}{x+2}\right)\)
\(=\dfrac{\left(x+2\right)\left(x-1\right)\left(x+1\right)}{2\left(x+5\right)}\cdot\dfrac{-\left(x^2-x-6\right)+x^2-1}{\left(x-1\right)\left(x+1\right)\left(x+2\right)}\)
\(=\dfrac{-x^2+x+6+x^2-1}{2\left(x+5\right)}=\dfrac{x+5}{2\left(x+5\right)}=\dfrac{1}{2}\)