Find $a, b\in\mathbb{R}$ so that $\lim_{x\to 1} \frac{ax^6+bx^5+1}{(x-1)^2}$ is finite. 
Find $a, b\in\mathbb{R}$ so that 
  $$\lim_{x\to 1} \frac{ax^6+bx^5+1}{(x-1)^2}$$
   is finite. 

I tried to use polynomial division, but the computations get tedious really fast. Any suggestions? 
 A: Hint:
Use the following lemma:

Lemma: $\lim_{x\to 1} \frac{ax^6+bx^5+1}{(x-1)^2}$ is finite if and only if $(x-1)^2$ divides $ax^6+bx^5+1$.

Proof: If $ax^6+bx^5+1 = p(x)\cdot (x-1)^2$ then $\lim_{x\to 1} \frac{ax^6+bx^5+1}{(x-1)^2} = p(1)$ is finite. For the other direction, if $(x-1)^2$ does not divide $ax^6+bx^5+1$ then one of the following occure
(1) $(x-1)$ does not divide $ax^6+bx^5+1$ in this case $x=1$ is not a root of $ax^6+bx^5+1$ and so the limit is infinite (unformally it equals to "$\frac{a+b+1}{0}$")
(2) $(x-1)$ divides $ax^6+bx^5+1$, let $p(x)$ be such that $ax^6+bx^5+1 = p(x)(x-1)$ then 
$$\lim_{x\to 1} \frac{ax^6+bx^5+1}{(x-1)^2} = \lim_{x\rightarrow 1} \frac{p(x)}{x-1}$$ and $(x-1)$ doesn't divide $p(x)$ so as before the limit is infinite (unformally equals to "$\frac{p(1)}{0}$").
So your goal is to find all the $a,b$ such that $(x-1)^2$ divides $ax^6+bx^5+1$. This means that $x=1$ is a root of this polynomial and then once you divide by $(x-1)$ the integer $1$ is still a root of the polynomial. You will get two equations in the variables $a,b$ which are not hard to solve.
A: First of all, you need the numerator to be zero at $x=1$, which implies $a+b+1=0$. When you substitute, say, $a=-b-1$, the numerator becomes $-bx^5(x-1)-(x^6-1)$ which, when factoring out $(x-1)$ gives $(x-1)(-bx^5-x^5-x^4-x^3-x^2-x-1)$. After canceling $x-1$ we still have $x-1$ in the denominator, and for the limit to be finite we require $-bx^5-x^5-x^4-x^3-x^2-x-1$ to be zero at $x=1$. This gives $-b-6=0$ and then $b=-6$ and $a=5$.
A: The remainder of the division of $ax^6+bx^5+1$ by $(x-1)^2$ must be $rx+s$, for some $r$ and $s$. Thus $ax^6+bx^5+1=(x-1)^2q(x)+rx+s$ for some polynomial $q(x)$. Evaluating at $1$ we obtain
$$
a+b+1=r+s \tag{1}
$$
If we consider the derivatives, $6ax^5+5bx^4=2(x-1)q(x)+(x-1)^2q(x)+r$. Evaluating again at $1$ we get
$$
6a+5b=r \tag{2}
$$
Therefore
$$
\frac{ax^6+bx^5+1}{(x-1)^2}=q(x)+\frac{rx+s}{(x-1)^2}
$$
What's now the condition in order that the limit for $x\to1$ to exist finite?
Hint: write $rx+s=r(x-1)+r+s$, so the fraction is
$$
\frac{r}{(x-1)}+\frac{r+s}{(x-1)^2}
$$
Note that conditions $(1)$ and $(2)$ have been obtained in a purely algebraic way (derivatives of polynomials don't need limits), so this doesn't use l'Hôpital.
