Trouble computing $\int_0^\pi e^{ix} dx$

133 Views Asked by At

I am trying to compute the integral of $\int_0^\pi e^{ix} dx$ but get the wrong answer. My calculations are $$ \begin{eqnarray} \int_0^\pi e^{ix} dx &=& (1/i) \int_0^\pi e^{ix} \cdot i \cdot dx = (1/i) \Bigl[ e^{ix} \Bigr]_0^{\pi} \\ &=& (1/i) \Bigl[ e^{i\cdot \pi} - e^{i\cdot 0} \Bigr] = (1/i) \Bigl[ -1 - 1 \Bigr] \\ &=& -2 / i \end{eqnarray} $$

But WolframAlpha says the answer is $2i$. What am I missing?

2

There are 2 best solutions below

3
On BEST ANSWER

You have taken all the right steps so far $$ \begin{eqnarray} \int_0^\pi e^{ix} dx &=& (1/i) \int_0^\pi e^{ix} \cdot i \cdot dx \\ &=& (1/i) \Bigl[ e^{ix} \Bigr]_0^{\pi} \\ &=& (1/i) \Bigl[ e^{i\cdot \pi} - e^{i\cdot 0} \Bigr] \\ &=& (1/i) \Bigl[ -1 - 1 \Bigr] \\ &=& -2 / i = 2i \end{eqnarray}$$ Note that $i$ is the pure imaginary number satisfying $i^2 =-1$.

Thus $1/i = -i$ which implies $-2/i =2i$

0
On

your answer is correct just see that $-i =\frac{1}{i}$. Whereas it could be simpler to write

$$e^{ix} = \cos x+i\sin x$$

Then $$\int_0^\pi e^{ix} dx = \int_0^\pi \cos x dx+i\int_0^\pi \sin x dx \\ =\left[\sin x\right]_0^\pi+i\left[-\cos x\right]_0^\pi=2i$$