Limit with parameter $p$ Find $ p $ that will make limit convergent
$$ \lim _ { x \to \infty } \left( \left( n + \left( \frac { x ^ 2 + 2 } { x ^ 2 - x + 1 } \right) ^ { 2 x + 1 } \right) \cdot \sin \left( \frac { x \pi } 2 \right) \right) $$
I know how to solve most of the basic limits. In this problem I don't know if I'm allowed to separate it and make $ 3 $ or $ 4 $ small ones. I thought about making $ p \sin.. + \sin*(big bracket)$ and then separating again because $ p $ is parameter and can go in front of limit and I wanted to separate second one so I can find big limit (it's $e^2$ or something but that doesn't matter).

Here's one way to do it
$$\lim\limits_{x\to\infty}\left(\frac{x^2+2}{x^2-x+1}\right)^{2x+1}$$
$$=\lim\limits_{x\to\infty}\exp\left(\ln\left(\left(\frac{x^2+2}{x^2-x+1}\right)^{2x+1}\right)\right)$$
$$=\exp\left(\lim\limits_{x\to\infty}\ln\left(\left(\frac{x^2+2}{x^2-x+1}\right)^{2x+1}\right)\right)$$
By series expansion, we have
$$\exp\left(\lim\limits_{x\to\infty}\left[2+\frac4x+\frac1{6x^2}+O\left(\frac1{x^3}\right)\right]\right)$$
$$=\exp\left(2\right)$$
I think you can take it from here.
