Divide $(x+1)^2$ by $x-1$ without using longdivision. Dividing a polynomial of degree $n$ with a polynomial of degree $n-1$ gives a polynomial of degree $1$. So,
$$\frac{(x+1)^2}{x-1}=ax+b\Leftrightarrow x^2+2x+1=ax^2+(b-a)x-b$$
Gives $a=1, \quad a-b=2, \quad -b=1$. So $a=1$ and $b=-1.$ The result I get is that $$\frac{(x+1)^2}{x-1}=x-1.$$ Which is far from the correct answer. I can't spot my mistake. I feel that the more I sit and study, the worse at math I become.

$x-1$ doesn't divide $(x+1)^2$ exactly, so there must also be a remainder term of lower degree than $x-1$, i.e.
$$ \frac{(x+1)^2}{x-1} = ax+b + \frac{c}{x-1}. $$
Then you find
$$ x^2+2x+1 = ax^2+(b-a)x+(c-b), $$
giving three equations in three unknowns (you expect a unique solution anyway, so you should have the same number of equations as unknowns).
