0
$\begingroup$

I had to find the complex exponential Fourier series of the following

$f(x):=\begin{cases}-1,\;-L<x<0,\\\;\;1,\quad0<x\le L.\end{cases}$

I'll start by writing the formulas for the series and its coefficient.

$f(x)\sim\sum_{n=-\infty}^{\infty}c_ne^{in\pi x/L}$ where $c_n=\frac{1}{2L}\int_{-L}^{L}f(x)\;e^{-in\pi x/L}$.

Now, solving for the coefficient $c_n$

$c_n=\frac{1}{2L}\int_{-L}^{0}(-1)\;e^{-in\pi x /L}dx+\frac{1}{2L}\int_{0}^{L}(1)\;e^{-in\pi x /L}dx$

$=\frac{1}{2in\pi}\big[1-e^{in\pi}\big]-\frac{1}{2in\pi}\big[e^{-in\pi}-1\big]$

$=\frac{1}{2in\pi}\big[1-e^{in\pi}-e^{-in\pi}+1\big]$

$=\frac{1}{2in\pi}\big[2-cos(n\pi)-isin(n\pi)-cos(n\pi)+isin(n\pi)\big]$

$=\frac{1}{2in\pi}\big[2-2cos(n\pi)\big]$

$=\frac{1}{in\pi}\big[1-cos(n\pi)\big]$

$=\frac{1}{in\pi}\big[1-(-1)^n\big]$

thus $c_n=\begin{cases}0\;if\;n\;even\\\frac{2}{in\pi}=\frac{-2i}{n\pi}\;if\;n\;odd,n\neq0\end{cases}$

$\therefore f(x)\sim\sum_{n\;odd}^{}\frac{-2i}{n\pi}\;e^{in\pi x/L}$

$=\sum_{n=-\infty}^{-1}\frac{-2i}{(2n+1)\pi}\;e^{i(2n+1)\pi x/L}+\sum_{n=1}^{\infty}\frac{-2i}{(2n-1)\pi}\;e^{i(2n-1)\pi x/L}$ QED.

$\endgroup$
2
$\begingroup$

Yes, I have checked analytically that your calculation is all right. Only in the first step in the arguments of $\exp$ you need to put $x$.

So $$f(x)= \sum_{n=-N}^{N} C_n e^{in\pi x/L}, C_n=\frac{(1-(-1)^n)}{in\pi}, C_0=0$$. See the plot of $f(x)$ when $L=\pi$. $N$ should actually to $infty$, however for practical purpose here let us take $N=100$ and draw $f(X)$ here to show that the series represents a step function which you have taken in the starting. When $N\rightarrow \infty$ the oscillations die out. enter image description here Also you may write it in more compact way as $$f(x)=\frac{4}{\pi} \sum_{n=0}^{\infty} \frac{\sin [(2n+1)\pi x/L]}{2n+1}$$

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks. Is there a more compact way to write my answer? $\endgroup$ – whitenoise Feb 18 at 8:47
  • $\begingroup$ @whitenoise Yes you may the edit. $\endgroup$ – Z Ahmed Feb 18 at 9:13
  • $\begingroup$ @whitenoise You may accept the answer now. $\endgroup$ – Z Ahmed Feb 18 at 10:01
  • $\begingroup$ Hi again, may I ask what algebra system you used to plot the solution? Many thanks. $\endgroup$ – whitenoise Feb 18 at 22:41
  • 1
    $\begingroup$ I did it by Mathematica by its command Plot[f(x),{x,--Pi,Pi}] $\endgroup$ – Z Ahmed Feb 19 at 2:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.