\(B=\left(\dfrac{2}{a^2+a}-\dfrac{2}{a+1}\right):\dfrac{1-a}{a^2+2a+1}\)
\(=\left(\dfrac{2}{a\left(a+1\right)}-\dfrac{2a}{a\left(a+1\right)}\right):\dfrac{1-a}{\left(a+1\right)^2}\)
\(=\dfrac{2\left(1-a\right)}{a\left(a+1\right)}\cdot\dfrac{\left(a+1\right)^2}{1-a}\)
\(=\dfrac{2a+2}{a}\)