\(2)\\ A=\dfrac{1}{x-2}+\dfrac{1}{x+2}+\dfrac{x^2+1}{x^2-4}\left(x\ne2;-2\right).\\ A=\dfrac{x+2+x-2+x^2+1}{\left(x-2\right)\left(x+2\right)}.\\ A=\dfrac{x^2+2x+1}{\left(x-2\right)\left(x+2\right)}.\\ A=\dfrac{\left(x+1\right)^2}{x^2-4}.\)
\(4)\\ P=\left(\dfrac{1}{x}+\dfrac{x}{x+1}\right):\dfrac{x}{x^2+x}.\left(x\ne0;-1\right).\\ P=\dfrac{x+1+x^2}{x^2+x}:\dfrac{x}{x^2+x}.\\ P=\dfrac{x+1+x^2}{x^2+x}.\dfrac{x^2+x}{x}.\\ P=\dfrac{x^2+x+1}{x}.\)