2
$\begingroup$

I want to compute this integral $$\int_{-\frac{\pi}{2}}^\frac{\pi}{2} \cos(x)\,e^{-inx} dx $$ to determine the fourier coefficients of $$y(x)=\max(\cos(x),0)$$ In order to calculate the sum of $$ \sum_{1}^\infty \frac{(-1)^n}{4n^{2}-1} $$

When I calculate the coefficients, I rewrite $\cos(x)$ in terms of exponentials: $$ \int_{-\frac{\pi}{2}}^\frac{\pi}{2} \frac{e^{ix}+e^{-ix}}{2}e^{-inx}\,dx $$

I'm able to integrate this integral, but I get something really messy in the end with several cases..not able to solve it in order to get something useful to compute the sum.

  • 0
    You do not integrate on a period, but on a half period.2017-02-05
  • 0
    So therfor the "orthogonality inspection" fails?2017-02-05
  • 0
    I don't see clearly what you mean by ‘orthogonality inspection’, but the dot product is given by the integral on an interval of length $2\pi$.2017-02-05
  • 0
    Yeah, and what I meant was that since our interval is not equal to $$2\pi$$ the dot product method doesnt work?2017-02-05
  • 0
    When I integrate this integral it seems to simplify to 0, im confused.. do you have any idea?2017-02-05
  • 0
    If you mean the formula to find Fourier coefficients? It works, the integral for the dot product is taken on an interval of length $2\pi$, say $[-\pi,\pi]$, but given the particular function you have, *in practice*, the integral is between $-\pi/2$ and $\pi/2$. However the orhogonality relations you mention are not related to this particular function, so they're valid for integrals on the larger interval.2017-02-05
  • 0
    Yes the formula to find the fourier coefficients, so if I understood you right the method would have worked if our interval of length was 2*pi ? But since our interval is just pi it doesnt work right?2017-02-05
  • 0
    Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/53070/discussion-between-bernard-and-fejz1234).2017-02-05

2 Answers 2

2

The integral is

$$\frac{e^{-inx}}2\left(\left.\frac{e^{ix}}{i(1-n)}+\frac{e^{-ix}}{i(-1-n)}\right)\right|_{-\pi/2}^{\pi/2}\\ =\frac{e^{-in\pi/2}}2\left(\frac1{1-n}+\frac1{1+n}\right)-\frac{e^{in\pi/2}}2\left(-\frac1{1-n}-\frac1{1+n}\right)\\ =\frac{\cos\left(n\frac\pi2\right)}{1-n^2}.$$

  • 0
    What I get is $$ \frac{1}{2}| \frac{e^{ix(1-n)}}{i(1-n)} -\frac{e^{-ix(1+n)}}{i(1+n)}|_{-\pi/2}^{\pi/2}\\$$ . But I'm having trouble getting to the last equality that you got.2017-02-07
  • 0
    yes my bad, i deleted sorry, i misread (1-n) and (n-1) :)2017-02-07
  • 0
    So how does one continue with $$\frac{\cos\left(n\frac\pi2\right)}{1-n^2}.$$ Its equal to 0 for odd n, but alternates sign for even n?2017-02-07
  • 0
    @fejz1234: you are done here, aren't you ?2017-02-08
  • 0
    No, im not sure how to continue with this result in order to compute the sum..2017-02-08
  • 1
    @fejz1234 : $\cos(2n\frac{pi}{2})=(-1)^n$ ; *Yves Daoust* wrote everything you need to solve your problem.2017-02-08
  • 0
    Yes it alternates sign...but only for even n's this makes me confused..2017-02-08
  • 0
    @fejz1234 : $2n$ is even. --- $\sum\limits_{n=1}^\infty \frac{(-1)^n}{4n^2-1}=\sum\limits_{n=1}^\infty \frac{ \cos(2n\frac{\pi}{2})}{(2n)^2-1}=\sum\limits_{\substack{n=1\\n\,even}}^\infty \frac{ \cos(n\frac{\pi}{2})}{n^2-1}=\sum\limits_{n=2}^\infty \frac{ \cos(n\frac{\pi}{2})}{n^2-1}$2017-02-08
0

For calculating the integral in a detailed and step-by-step manner,

$\displaystyle I = \int\limits_{-\pi/2}^{\pi/2} \cos x e^{-inx}\;dx \\ \displaystyle = \int\limits_{-\pi/2}^{\pi/2} \cos x e^{inx}\;dx $

By adding, $\displaystyle 2I =2\int\limits_{-\pi/2}^{\pi/2} \cos x \cos(nx)\;dx \\ \displaystyle = \int\limits_{-\pi/2}^{\pi/2} \left(\cos(n+1)x+\cos(n-1)x\right)\;dx \\ \displaystyle = \dfrac{2}{n+1}\sin\left(\dfrac{\pi (n+1)}{2}\right)+\dfrac{2}{n-1}\sin\left(\dfrac{\pi (n-1)}{2}\right)\\ \displaystyle =\dfrac{2}{n+1}\cos\left(\dfrac{\pi n}{2}\right)-\dfrac{2}{n-1}\cos\left(\dfrac{\pi n}{2}\right)\\ \displaystyle =2\cos\left(\dfrac{\pi n}{2}\right) \times \dfrac{-2}{n^2-1}$

Therefore, $\displaystyle I=\dfrac{2}{1-n^2}\cos\left(\dfrac{\pi n}{2}\right)$

Infact, $\displaystyle \sum_{n\in\mathbb{N}} \frac{(-1)^n}{4n^2-1} \\= \displaystyle \frac{1}{2}\sum_{n\in\mathbb{N}} \left(\frac{(-1)^n}{2n-1}-\frac{(-1)^n}{2n+1}\right) \\ = \displaystyle\frac{1}{2}-\frac{\pi}{4} \\$

where the last sum follows from $\displaystyle \sum_{n\in\mathbb{N}} \frac{(-1)^{n-1}}{2n-1}=\frac{\pi}{4}$