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