0

Here is a piecewise function extended periodically with period $2\pi$. $$f(x)= \begin{cases} \pi + x & -\pi<x<-\frac{\pi}{2} \\ x & -\frac{\pi}{2}< x<\frac{\pi}{2} \\ \pi - x & \frac{\pi}{2}< x<\pi \\ \end{cases} $$

I know to find the $a_n$ coefficients of a Fourier Series I can rewrite this in the form $$a_n=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cdot\cos(nx)dx\\ =\frac{1}{\pi}\left(\int_{-\pi}^{-\frac{\pi}{2}}(\pi+x)\cdot\cos(nx)dx+\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}x\cdot\cos(nx)dx+\int_{\frac{\pi}{2}}^{\pi}(\pi-x)\cdot\cos(nx)dx\right)$$

I then note that the middle integrand is an odd function overall, and is being evaluated over such an interval that the result would be zero, so it can be discarded. Then, after evaluating the outer two integrals and using the facts that $\sin(n\pi)=0\:\forall\, n$, $\cos(-x)=\cos(x)$, and $\sin(-x)=-\sin(x)$, I discover a number of cancellations and end up with the following. $$a_n=\frac{2}{\pi n^2}\left(\cos(n\pi)-\cos(\frac{n\pi}{2})\right)$$

When I iterate through the $n$ inside the cosine functions only, I find that $a_n$ is always one of $\{\frac{-2}{\pi n^2},\frac{4}{\pi n^2},\frac{-2}{\pi n^2},\frac{0}{\pi n^2}\}$ where these values correspond to the multiples $\{1\cdot n,2\cdot n, 3\cdot n,4\cdot n\}$ respectively.

I can't find a way to express this so that I can rid myself of the cosine functions within the expression, I have only begun studying this and we can usually turn this into something like $\frac{2}{\pi n^2}(-1)^{n}$ or other similar expressions.

I've double and triple checked my integrations and I'm 99.99% sure I've made no mistakes on that front, any help would be appreciated.

  • Well, $$\cos n\pi=(-1)^n;,;;\cos\frac{n\pi}2=\begin{cases}(-1)^k=(-1)^{n/2},&n=2k\{}\0,&n=2k-1\end{cases} , k\in\Bbb Z$$ – DonAntonio Feb 17 '21 at 16:18

1 Answers1

1

If you read my comment, we have

$$\cos n\pi-\cos\frac{n\pi}2=(-1)^n-(-1)^{n/2}=\begin{cases}-1,&n\;\text{ is odd}\\{}\\0,&n=2\pmod 4\\{}\\2,&n=0\pmod 4\end{cases}$$

DonAntonio
  • 211,718
  • 17
  • 136
  • 287
  • I see how you're getting this, but how do I boil this down to a coefficient? Or is that how I would write it when I write my final equation for the Fourier Series? – Maksymilian5275 Feb 17 '21 at 16:33
  • As for the above, I'd split the sum in two: one for the odd indices, and one for the indices that are multiples of $;4;$ . Those are the only ones that give us something different from zero. – DonAntonio Feb 17 '21 at 16:35