I am trying to solve the following exercise in my PDEs book:
Consider $$ f(x)=\begin{cases}0&x<x_0\\1/\Delta&x_0<x<x_0+\Delta\\0&x>x_0+\Delta\end{cases}. $$ Assume that $x_0>-L$ and $x_0+\Delta<L$. Determine the complex Fourier coefficients $c_n$.
The book states that
$$ c_n=\frac1{2L}\int_{-L}^Lf(x)e^{in\pi x/L}\,dx. $$
Using this, I found
$$ c_n=\frac1{2L}\int_{x_0}^{x_0+\Delta}\frac1\Delta e^{in\pi x/L}\,dx=\frac{e^{in\pi x_0/L}\left(e^{in\pi\Delta/L}-1\right)}{2in\pi\Delta}, $$
but my book claims the solution is
$$ c_n=\frac1{n\pi\Delta}e^{in\pi/L(x_0+\Delta/2)}\sin\frac{n\pi\Delta}{2L}. $$
How was this obtained?
$e^{ix} - 1 = e^{ix/2} \cdot 2i \cdot sin(x/2)$. Try to apply this to the bracket term in what you found.