I'm failing at calculating this (pretty simple) integral:

$$\frac{1}{2\pi} \cdot \int_{-\pi/2}^{\pi/2} e^{-jx} \cdot \cos(x) dx $$

As $$ \int e^{ax} \cdot \cos(bx) dx = \frac{e^{ax}}{a^2+b^2}\cdot[a\cdot \cos(x) + b\cdot \sin(bx)]$$ and $a=-j;b=1$ the antiderivative should be the following: $$ \frac{1}{2\pi}\cdot\int_{-\pi/2}^{\pi/2} e^{-jx} \cdot \cos(x) dx = \frac{1}{2\pi}\cdot \Bigg[\frac{e^{-jx}}{(-j)^2+1}\cdot[(-j)\cdot \cos(x) + \sin(x)]\Bigg]^{\pi/2}_{-\pi/2}$$ But because $(-j)^2 = -j\cdot-j=j^2=-1$ this leads to an undefined expression.
I know that this has to be wrong because using a calculator I get $\frac{1}{4}$. But I can't find my mistake.

  • $\begingroup$ Use the formula mentioned in math.stackexchange.com/questions/439851/… and then mathworld.wolfram.com/WernerFormulas.html $\endgroup$ – lab bhattacharjee Sep 11 '18 at 15:01
  • 1
    $\begingroup$ The formula antiderivative works for $a,b\in \mathbb R$. When encounter complex numbers, you should be careful. A safe way is to write $\mathrm {e}^{\mathrm i x} = \cos(x) + \mathrm i \sin(x)$. $\endgroup$ – xbh Sep 11 '18 at 15:02
  • $\begingroup$ $\cos{x} = \frac{e^{jx}+e^{-jx}}{2}$ $\endgroup$ – saulspatz Sep 11 '18 at 15:04
  • $\begingroup$ @xbh I already integrated functions with complex variables and never had problems. More precisely this is a follow up question of this one: math.stackexchange.com/questions/2912547/… I successfully integrated the function with $n$ but I fail for $n=1$. How do I know if it's a good idea to use my default tables for antiderivatives and when not? $\endgroup$ – TimSch Sep 11 '18 at 15:45

$$I=\frac{1}{2\pi} \cdot \int_{-\pi/2}^{\pi/2} e^{-jx} \cdot cos(x) dx$$

Substitute $x=-t$ $$I=\frac{1}{2\pi} \cdot \int_{\pi/2}^{-\pi/2} -e^{jt} \cdot cos(-t) dt$$ $$I=\frac{1}{2\pi} \cdot \int_{-\pi/2}^{\pi/2} e^{jt} \cdot cos(t) dt$$

$$2I=\frac{1}{2\pi} \cdot \int_{-\pi/2}^{\pi/2} (e^{-jx}+e^{jx}) \cdot cos(x) dx$$ $$I=\frac{1}{2\pi} \cdot \int_{-\pi/2}^{\pi/2} \frac{e^{jx}+e^{-jx}}{2} \cdot cos(x) dx$$

Use $$\cos{x} = \frac{e^{jx}+e^{-jx}}{2}$$

  • $\begingroup$ Am I right with the feeling that the $-j$ is causing the problems here? If it was $e^{+jx}$ everything would be alright? $\endgroup$ – TimSch Sep 11 '18 at 15:37
  • $\begingroup$ see the updated answer $\endgroup$ – Deepesh Meena Sep 11 '18 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.