I can't follow a proof in my physics class. It involves this:

$\displaystyle \int^{2pi}_0 e^{i(n+1)x}dx$

I am suppose to get 2pi for n=-1 and 0 otherwise.

I got:

$\displaystyle \frac{e^{i(n+1)x}}{i(n+1)}$

Using euler's formula I got:

$\displaystyle \frac{sin[(n+1)x]}{n+1}-i \frac{[cos(n+1)x]}{n+1}$

Pluging in the limits I only got 0 regardless of what n is.

What am I missing?