In Fourier series representation of function, I am asked to find the Fourier series of the following piece wise function :
f(x) = (
0 if -pi
Oh, just remembered the \(b_n\) is a sine integral...
and b_n= 1/pi... not 1/2pi... right ?
Sorry, that wasn't right. If \(L=\pi\) is the half-period, then the coefficient of the integral is \(\dfrac{1}{2L}=\dfrac{1}{2\pi}\).
\[\begin{align*}b_n&=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\color{red}{\sin(nx)}~dx\\ &=\frac{1}{2\pi}\int_{-\pi/2}^{\pi/2}x\sin (nx)~dx\\ &=\frac{1}{2\pi}\left(\left[-\frac{1}{n}x\cos(nx)\right]_{-\pi/2}^{\pi/2}+\frac{1}{n}\int_{-\pi/2}^{\pi/2}\cos(nx)~dx\right)\\ &=\frac{1}{2\pi}\left(\left[-\frac{1}{n}x\cos(nx)\right]_{-\pi/2}^{\pi/2}+\frac{1}{n^2}\left[\sin(nx)\right]_{-\pi/2}^{\pi/2}\right)\\ &=-\frac{1}{2n\pi}\left(\left[\frac{\pi}{2}\cos\frac{n\pi}{2}-\left(-\frac{\pi}{2}\right)\cos\left(-\frac{n\pi}{2}\right)\right]-\frac{1}{n}\left[\sin\frac{n\pi}{2}-\sin\left(-\frac{n\pi}{2}\right)\right]\right)\\ &=\frac{1}{2n^2\pi}\left[2\sin\frac{n\pi}{2}\right]\\ &=\frac{1}{n^2\pi}\sin\frac{n\pi}{2} \end{align*}\]
Here's a check for this result: http://www.wolframalpha.com/input/?i=%281%2F%282*pi%29%29*Integrate%5Bx*Sin%5Bn*x%5D%2C%7Bx%2C-pi%2F2%2Cpi%2F2%7D%5D Notice that \(\cos\dfrac{n\pi}{2}\) is 0 for all integers \(n\), so we can reduce the result in the link.
cos(n*pi/2) is not zero for all integers, it alters between zero, -1 and +1
Ah I see I'm getting ahead of myself again. You have to split the result into even and odd \(n\), and the odd ones end up as zero. Sorry for the mix-up.
\[\begin{align*}b_n&=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\color{red}{\sin(nx)}~dx\\ &=\frac{1}{2\pi}\int_{-\pi/2}^{\pi/2}x\sin (nx)~dx\\ &=\frac{1}{2\pi}\left(\left[-\frac{1}{n}x\cos(nx)\right]_{-\pi/2}^{\pi/2}+\frac{1}{n}\int_{-\pi/2}^{\pi/2}\cos(nx)~dx\right)\\ &=\frac{1}{2\pi}\left(\left[-\frac{1}{n}x\cos(nx)\right]_{-\pi/2}^{\pi/2}+\frac{1}{n^2}\left[\sin(nx)\right]_{-\pi/2}^{\pi/2}\right)\\ &=-\frac{1}{2n\pi}\left(\left[\frac{\pi}{2}\cos\frac{n\pi}{2}-\left(-\frac{\pi}{2}\right)\cos\left(-\frac{n\pi}{2}\right)\right]-\frac{1}{n}\left[\sin\frac{n\pi}{2}-\sin\left(-\frac{n\pi}{2}\right)\right]\right)\\ &=-\frac{1}{2n\pi}\left(\pi\cos\frac{n\pi}{2}-\frac{2}{n}\sin\frac{n\pi}{2}\right)\\ &=-\frac{1}{2n}\cos\frac{n\pi}{2}+\frac{1}{n^2\pi}\sin\frac{n\pi}{2} \end{align*}\] Is this what you have?
yes the same
But how would odd ones end up with zero ?
Okay, now as you mentioned, \(\cos\dfrac{n\pi}{2}\) is indeed not zero for all integers, but zero for all \(\textit{odd}\) integers. Similarly, \(\sin\dfrac{n\pi}{2}\) is zero for all \(\textit{even}\) integers. So, we split up the result into even and odd \(n\).
Ok I got it, but how to represent the final answer after splitting, can u write it down please ?
The sine series itself if \[S=\sum_{n=1}^\infty b_n\sin x=\sum_{n=1}^\infty \left(\frac{1}{n^2\pi}\sin\frac{n\pi}{2}-\frac{1}{2n}\cos\frac{n\pi}{2}\right)\sin x\] For the even \(n\), let \(n=2k\): \[\begin{align*}{\large S_{\text{even}}}&=\sum_{\color{red}{k=1}}^\infty \left(\frac{1}{(2k)^2\pi}\sin\frac{(2k)\pi}{2}-\frac{1}{2(2k)}\cos\frac{(2k)\pi}{2}\right)\sin x\\ &=\sum_{k=1}^\infty \left(\frac{1}{4k^2\pi}\sin(k\pi)-\frac{1}{4k}\cos(k\pi)\right)\sin x \end{align*}\] Now the \(\sin k\pi\) terms become zero. For the odd \(n\), let \(n=2k+1\): \[\begin{align*}{\large S_{\text{odd}}}&=\sum_{\color{red}{k=0}}^\infty \left(\frac{1}{(2k+1)^2\pi}\sin\frac{(2k+1)\pi}{2}-\frac{1}{2(2k+1)}\cos\frac{(2k+1)\pi}{2}\right)\sin x\\ &=\sum_{k=0}^\infty \frac{1}{(2k+1)^2\pi}\sin\left(\frac{(2k+1)\pi}{2}\right)\sin x\\ \end{align*}\]
So you should have \[\begin{align*}S&={\large S_\text{even}+S_\text{odd}}\\ &=\frac{1}{\pi}\sum_{k=0}^\infty \frac{\sin\left(\frac{2k+1}{2}\pi\right)}{(2k+1)^2}\sin x -\frac{1}{4}\sum_{k=1}^\infty \frac{\cos(k\pi)}{k}\sin x \end{align*} \]
Thank you so much, I thought that sines and cosines must not be present, and that we must use a sequence instead.
You can still split up the second sum into even/odd cases, as \(\cos(k\pi)=\begin{cases}1&\text{even}~k\\-1&\text{odd}~k\end{cases}\).
And you're welcome!
The next challenge would be to try to put into Mathematica to see if the graphs match up
:) yes and by the way I didn't get why b_n=1/2pi and not b_n= 1/p can you check it ?, coz I am pretty sure,because the function is 2pi-periodic
Yes you're right about that. I remembered it wrong
So then we should have had \[-\frac{1}{n}\cos\frac{n\pi}{2}+\frac{2}{n^2\pi}\sin\frac{n\pi}{2}\\ \vdots\] That should do it for corrections, I think. Finally, \[S=\frac{2}{\pi}\sum_{k=0}^\infty \frac{\sin\left(\frac{(2k+1)\pi}{2}\right)}{(2k+1)^2}\sin x-\frac{1}{2} \sum_{k=1}^\infty\frac{\cos(k\pi)}{k}\sin x\]
True
I've run into another mistake, unfortunately. As part of the \(b_n\) expression, the sine should contain \(nx\), not just \(x\). Anyway, here's a section of a plot of \(f(x)\): http://www.wolframalpha.com/input/?i=Plot%5BPiecewise%5B%7B%7B0%2C-3pi%3Cx%3C-5pi%2F2%7D%2C%7Bx%2B2pi%2C-5pi%2F2%3Cx%3C-3pi%2F2%7D%2C%7B0%2C-3pi%2F2%3Cx%3C-pi%7D%7D%5D%2BPiecewise%5B%7B%7B0%2C-pi%3Cx%3C-pi%2F2%7D%2C%7Bx%2C-pi%2F2%3Cx%3Cpi%2F2%7D%2C%7B0%2Cpi%2F2%3Cx%3Cpi%7D%7D%5D%2C%7Bx%2C-3pi%2Cpi%7D%5D Here's our answer: http://www.wolframalpha.com/input/?i=Plot%5BSum%5B%28%281%2F%28n%5E2*pi%29%29*Sin%5Bn*pi%2F2%5D-%281%2F%282*n%29%29*Cos%5B%28n*pi%2F2%29%5D%29*Sin%5Bn*x%5D%2C%7Bn%2C1%2C10%7D%5D%2C%7Bx%2C-3*pi%2Cpi%7D%5D
Thank you a lot ! I really appreciate it :D
Join our real-time social learning platform and learn together with your friends!