Calculating this integral?

104 Views Asked by At

I'm trying to calculate

$$\int\limits_{-\pi}^0e^{-x}\cos(nx)\,\mathrm{d}x$$

as part of a Fourier series calculation. My problem is the calculations seem to loop endlessly - I'm integrating by parts but the integral sticks around, as both $\cos(nx)$ and $e^{-x}$ are never going to lose their $x$. Am I missing something here?

3

There are 3 best solutions below

0
On

Once you get a similar integral by integrating by parts try to make it a variable and then simply solve the equation.

0
On

Hint: $\cos(n\phi)=\mathrm{Re}(e^{in \phi}$)

0
On

$$\int\limits_{-\pi}^0e^{-x}\cos(nx)\,\mathrm{d}x=-\int\limits_{-\pi}^0(e^{-x})'\cos(nx)\,\mathrm{d}x =-e^{-0}\cos(n0)+e^{-\pi}\cos(n\pi)-n\int\limits_{-\pi}^0e^{-x}\sin(nx)\,\mathrm{d}x= -1+(-1)^ne^{-\pi}+n\int\limits_{-\pi}^0(e^{-x})'\sin(nx)\,\mathrm{d}x=$$ $$=-1+(-1)^ne^{-\pi}+n(e^{-0}\sin(n0)+e^{-\pi}\sin(n\pi)-n\int\limits_{-\pi}^0e^{-x}\cos(nx)\,\mathrm{d}x)=$$$$= -1+(-1)^ne^{-\pi}-n^2\int\limits_{-\pi}^0e^{-x}\cos(nx)\,\mathrm{d}x .$$ Finally $$\int\limits_{-\pi}^0e^{-x}\cos(nx)\,\mathrm{d}x=\frac{-1+(-1)^ne^{-\pi}}{1+n^2}.$$