0

Here is the function: $|\cos x|$ and I need to write the representation of the function as a Fourier series on the interval: $[-\pi, \pi]$

$$ a_0 = -\frac{1}{\pi}\int^{-\frac{\pi}{2}}_{-\pi}\cos x dx -\frac{1}{\pi}\int^{\frac{\pi}{2}}_{-\frac{\pi}{2}} \cos x dx +\frac{1}{\pi} \int^{\pi}_{\frac{\pi}{2}} \cos x dx = \frac{1}{\pi} + \frac{1}{\pi}=\frac{2}{\pi} \tag{1}\\[6pt]$$

$$ -\frac{1}{\pi}\int^{-\frac{\pi}{2}}_{-\pi}\cos\left(x(2n-1)\right)+\cos (x(2n+1)) dx = \left[x(2n+1) = u; du = 2n+1 \ \ dx = \frac{1}{2n+1} \right] = \left[ \left. \frac{1}{\pi (2n+1)}\sin(x(2n+1)) + \frac{1}{\pi(2n-1)}\sin(x(2n-1))\right] \right|^{-\frac{\pi}{2}}_{-\pi} = -\frac{1}{\pi(2n+1)}\sin(2n+1) - \frac{1}{\pi(2n-1)}\sin(2n-1)$$

It already looks incorrect, but I don't know where my mistake is. Can someone help?

nmasanta
  • 9,222
user
  • 1,412
  • As the function is positive, $a_0$ must be positive. All other terms average to zero over a period. – Ross Millikan May 25 '20 at 00:54
  • @RossMillikan Ok, I corrected the computations made for $a_0$. But I would like how do I compute incorrectly the $a_n$ coefficient? I don't need results. – user May 25 '20 at 00:56
  • No, you left out the integral on $[-\frac \pi 2, \frac \pi 2]$ where the cosine is positive. You should show the derivation of the terms in your integral from the product of the two cosines so we can check. – Ross Millikan May 25 '20 at 01:00
  • @RossMillikan Here I added a fragment, where I integrate over an interval $[-\pi. -\frac{\pi}{2}]$ and it looks really messy, I cannot simplify it anyhow, so maybe at this step you can tell the mistake? – user May 25 '20 at 01:32
  • The difference between the intervals is just a factor $-1$ where the cosine is negative. There should be no other difference in the integration. In the first line, the first term in the middle should be positive because $\cos x \ge 0$ there. When you go from the middle to the right you lose the middle term. The answer should be $\frac 4 \pi$. For the others you have lost two factors of $2$ in the denominator. The basic form looks right but I haven't chased all the factors. – Ross Millikan May 25 '20 at 01:50

0 Answers0