\(a,=x^2+x-6+x^2+2x+1=2x^2+3x-5\\ b,=\dfrac{2x-6+3x+9+4x-30}{\left(x-3\right)\left(x+3\right)}=\dfrac{9x-27}{\left(x-3\right)\left(x+3\right)}=\dfrac{9\left(x-3\right)}{\left(x-3\right)\left(x+3\right)}=\dfrac{9}{x+3}\)
a) \(\left(x-2\right)\left(x+3\right)+\left(x+1\right)^2.\)
\(=x^2+3x-2x-6+x^2+2x+1.\)
\(=2x^2+3x-5.\)
\(=\left(x-1\right)\left(x+\dfrac{5}{2}\right).\)
b) \(\dfrac{2}{x+3}+\dfrac{3}{x-3}+\dfrac{4x-30}{x^2-9}\left(x\ne\pm3\right).\)
\(=\dfrac{2}{x+3}+\dfrac{3}{x-3}+\dfrac{4x-30}{\left(x+3\right)\left(x-3\right)}.\)
\(=\dfrac{2\left(x-3\right)+3\left(x+3\right)+4x-30}{\left(x-3\right)\left(x+3\right)}.\)
\(=\dfrac{2x-6+3x+9+4x-30}{\left(x-3\right)\left(x+3\right)}.\)
\(=\dfrac{9x-27}{\left(x-3\right)\left(x+3\right)}.\)
\(=\dfrac{9\left(x-3\right)}{\left(x-3\right)\left(x+3\right)}.\)
\(=\dfrac{9}{x+3}.\)