Is there any easy way to simplify this?
$$(x - 1)^n + (x + 1)^n \mod x^2$$
Is there any easy way to simplify this?
$$(x - 1)^n + (x + 1)^n \mod x^2$$
Most terms of the binomial theorem expansions of $(x-1)^n$ and $(x+1)^n$ are divisible by $x^2$. The leftover terms are $$((-1)^n+(-1)^{n-1}nx)+(1+nx).$$
If $n$ is even, this equals $2$. If $n$ is odd, this is $2nx$.