0
$\begingroup$

I am trying to find the Fourier coefs of even extension of $cos^2(\pi x /L)$ which is defined over $0\leq x \leq L$.

So since the function is even it only has $a_0$ and $a_n$ as cosine series expansion. I find $a_0$ to be 0.5 which is fine, but when I find $a_n$ I come to zero, which does not make sense and I do not know what I am doing wrong.

Basically, I write

$a_n=\frac{1}{2L} \int_{-L}^{L} cos^2(\pi x /L) cos(n\pi x/L)$

even I put this in a software to calculate the integral, I got similar to the one I found by hand, which has all sine terms which at $\pm L$ give zero so that's why I come to zero values for $a_n$.

I don't see what I doing wrong

2 Answers 2

0

Perhaps you made an error in entering the integral into the software.

$$ \int \cos^2 \left(\frac{\pi x}{L}\right) \cos\left(\frac{2\pi x}{L}\right)\,dx = \frac{L}{4 \pi} \sin\left(\frac{2\pi x}{L}\right) + \frac{L}{16 \pi} \sin\left(\frac{4\pi x}{L}\right) + \frac x4 + C, $$

therefore

$$ a_2 = \frac{1}{L}\int_{-L}^L \cos^2 \left(\frac{\pi x}{L}\right) \cos\left(\frac{2\pi x}{L}\right)\,dx = \frac12. $$

See this calculation at https://www.wolframalpha.com/input/?i=integral+of+cos%5E2(pi+x%2FL)cos(2pi+x%2FL)dx+from+-L+to+L

1

I think you're overcomplicating it. $$\cos^2 (\pi x / L ) = \frac 1 2 (1 + \cos (2\pi x / L) )$$ by familiar double angle formulae.

By the way, could there be a typo in the question? "An even extension of $\cos^2(\pi x / L)$ on $[0,L]$" is just $\cos^2(\pi x / L)$, right?

  • 0
    I don't think the OP is overcomplicating it. On the opposite, I think you're oversimplifying it by using a trigonometric identity here (+1). Nice observation that saves time in an examination... :)2017-02-28
  • 1
    I have actually used this for changing them into two multiplications then converting the second cosine*cosine into summation then integrating, I knew how to integrate but did not expect to get zero for the coefficients values.2017-02-28