\(\left(\frac{21}{x^2-9}+\frac{4-x}{3-x}-\frac{x-1}{3+x}\right):\left(1-\frac{1}{x+3}\right)\)
\(=\left(\frac{21}{\left(x-3\right).\left(x+3\right)}+\frac{4-x}{3-x}-\frac{x-1}{3+x}\right):\left(\frac{x+3}{x+3}-\frac{1}{x+3}\right)\)
\(=\left(\frac{21}{\left(x-3\right).\left(x+3\right)}+\frac{\left(x-4\right)\left(3+x\right)}{\left(x-3\right).\left(x+3\right)}-\frac{\left(x-1\right).\left(x-3\right)}{\left(x+3\right).\left(x-3\right)}\right):\frac{x+2}{x+3}\)
\(=\frac{21+3x+x^2-12-4x-x^2+3x+x-3}{\left(x+3\right).\left(x-3\right)}:\frac{x+2}{X+3}\)
\(=\) \(\frac{3x+6}{\left(3+x\right)\left(x-3\right)}.\frac{x+3}{x+2}\)
\(=\)\(\frac{3.\left(x+2\right).\left(x+3\right)}{\left(x+3\right).\left(x-3\right)\left(x+2\right)}\)
\(=\frac{3}{x-3}\)