How to calculate $\lim _{x\to \infty }\left(\frac{x^2+3x+2}{x^2\:-x\:+\:1\:}\right)^x$
The logarithm is $\lim_{x\to\infty}x\ln\left(1+\tfrac{4x+1}{x^2-x+1}\right)$. As $x\to\infty$, $\tfrac{4x+1}{x^2-x+1}\sim\tfrac4x\to0$, and since $\lim_{y\to0}\tfrac{\ln(1+y)}{y}=:\ln^\prime1=1$ we have$$\lim_{x\to\infty}x\ln\left(1+\tfrac{4x+1}{x^2-x+1}\right)=\lim_{x\to\infty}\tfrac{x(4x+1)}{x^2-x+1}=4.$$
It's $$\left(1+\frac4x+O(x^{-2})\right)^x$$ whose logarithm is $$x\left(\frac4x+O(x^{-2)}\right)=4+O(x^{-1}).$$ So the original limit is $e^4$.
Your initial thought is right. Keep thinking. $$\lim _{x\to \infty }\left(\frac{x^2+3x+2}{x^2\:-x\:+\:1\:}\right)^x=\lim _{x\to \infty }\left(1+\frac{4x+1}{x^2\:-x\:+\:1\:}\right)^x=\\ \lim _{x\to \infty }\left[\left(1+\frac{1}{f(x)}\right)^{f(x)}\right]^{\frac{x}{f(x)}}=\exp\left({\lim\limits_{x\to \infty }\frac{4x^2+x}{x^2\:-x\:+\:1\:}}\right)=e^4.$$ where $f(x)=\frac{x^2-x+1}{4x+1}$ and $\lim_\limits{x\to\infty} f(x)=\infty$.