0

Is there any easy way to simplify this?

$$(x - 1)^n + (x + 1)^n \mod x^2$$

Bill Dubuque
  • 282,220
Cisplatin
  • 4,835
  • 7
  • 34
  • 60

1 Answers1

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$.

Bill Dubuque
  • 282,220
pi66
  • 7,444