Find Remainder when $(x+1)^n$ divided by $x^2+1$ I put $(x+1)^n=p(x)(x^2+1)+bx+c$ for some $p(x)$ as the other exercise where we asked to find the remainder when one polynomial is divided by another polynomial. But to make $p(x)(x^2+1)$ go so I could find $b,c$ I have to put $x=i$ which is something I shouldn't put after all. Then an idea pop into my head that the remainder itself is $(x+1)^n$, but I realized that if I put $n=2$ then the remainder is $2x$. Any idea for how to solve this?

hint
If we replace $ x $ by $ i $ and $ -i $, we get
$$(1+i)^n=bi+c$$
$$(1-i)^n=-bi+c$$
thus
$$c=\frac{(1+i)^n+(1-i)^n}{2}$$
$$b=\frac{(1+i)^n-(1-i)^n}{2i}$$
with
$$1+i=\sqrt{2}e^{i\frac{\pi}{4}}$$
and
$$1-i=\sqrt{2}e^{-i\frac{\pi}{4}}$$
this gives
$$c=2^{\frac n2}\cos(n\frac{\pi}{4})$$
$$b=2^{\frac n2}\sin(n\frac{\pi}{4})$$
