Limit Problem-To determine the value of a and b.? 
*

*$$\lim_{n \to \infty} \sqrt{n^2-n+1}-an-b=-\infty$$

*$$\lim_{x \to -\infty} \sqrt{x^2+x+1}-ax+b=0$$
Is not the answer of the second one $a=-1$ and $b=\frac12$?
But if,I put $a=-1$ and $b=\frac12$, the limit $\neq 0$.
And, in case of the first problem I first rationalised it, however I couldn't go further.


Hints
1.$$\lim_{n \to \infty} \sqrt{n^2-n+1}-an-b=\\\lim_{n \to \infty} \sqrt{n^2\left(1-\frac1n+\frac{1}{n^2}\right)}-an-b=\\\lim_{n \to \infty} |n|\sqrt{1-\frac1n+\frac{1}{n^2}}-an-b=\\\lim_{n \to \infty} n\sqrt{1-0+0}-an-b=\\\lim_{n \to \infty} n-an-b=\\\lim_{n \to \infty} n(1-a)-b=-\infty$$
 2. $$\lim_{x \to -\infty} \sqrt{x^2+x+1}-ax+b=\\\lim_{x \to -\infty} \sqrt{x^2\left(1+\frac1x+\frac{1}{x^2}\right)}-ax+b\\\lim_{x \to -\infty} |x|\sqrt{1+\frac1x+\frac{1}{x^2}}-ax+b\\\lim_{x \to -\infty} -x\sqrt{1+0+0}-ax+b\\\lim_{x \to -\infty} -x-ax+b\\\lim_{x \to -\infty} -x(a+1)+b=0$$
From the second limit we understand that $a=-1$; $a\neq 1\Rightarrow \lim_{x \to -\infty} -x(a+1)+b= \pm\infty+b\neq 0$. Furthermore $b=0$: $\lim_{x \to -\infty} -x(a+1)+b=\lim_{x \to -\infty} 0+b=b=0$. Yet $(1)$ is not veryfied: $\lim_{n \to \infty} n(1-a)-b=\lim_{n \to \infty} 2n-0=+\infty$. Finally I suggest the $(1)$ expression is wrong written, can you check it out?
