Ta có: \(B=\left(\dfrac{21}{x^2-9}-\dfrac{x-4}{3-x}-\dfrac{x-1}{3+x}\right):\left(1-\dfrac{1}{x+3}\right)\)
\(=\left(\dfrac{21}{\left(x-3\right)\left(x+3\right)}+\dfrac{\left(x-4\right)\left(x+3\right)}{\left(x-3\right)\left(x+3\right)}-\dfrac{\left(x-1\right)\left(x-3\right)}{\left(x+3\right)\left(x-3\right)}\right):\left(\dfrac{x+3}{x+3}-\dfrac{1}{x+3}\right)\)
\(=\dfrac{21+x^2+3x-4x-12-\left(x^2-4x+3\right)}{\left(x+3\right)\left(x-3\right)}:\dfrac{x+3-1}{x+3}\)
\(=\dfrac{x^2-x+9-x^2+4x-3}{\left(x+3\right)\left(x-3\right)}:\dfrac{x+2}{x+3}\)
\(=\dfrac{3x+6}{\left(x+3\right)\left(x-3\right)}:\dfrac{x+2}{x+3}\)
\(=\dfrac{3\left(x+2\right)}{\left(x+3\right)\left(x-3\right)}\cdot\dfrac{x+3}{x+2}\)
\(=\dfrac{3}{x-3}\)