Find the Fourier series S(t) of the period $2\pi$ function
$f(t)=\begin{cases} -1& \text{if −$\pi$ < t < 0;}\\ \;\;1& \text{if $\:$0 < t < $\pi$;}\\ \;\;0&\text{if $t = −\pi, 0, or \;\pi$ } \end{cases}$
Use MATHEMATICA to graph partial sums $S_N(t)$ of the Fourier series for f(x) with N = 3, 6, 12, 24. What do you notice? Depending on the correctness of your $S_N(t)$, your graphs should portray what is known as Gibbs’s phenomenon.
For Fourier sine coefficients $b_n$ of the square wave, I get:
$b_n =\frac{2}{\pi} \int\limits_0^\pi$sin nx dx = $\frac{2}{\pi}[\frac{-cos\; nx}{n}] x = 0$ to $\pi$
$\frac{cos n\pi}{n}=\begin{cases} 0& \text{if n is even}\\ \frac{4}{n\pi}& \text{if n is odd} \end{cases}$
Thus for n = 1, 2, 3, 4, 5...
I get:
{$\frac{4}{\pi},0,\frac{4}{3\pi}, 0, ... $} I have difficulty in partial graphing sums. I need some help.
You are not summing the coefficients, but rather the sine series having these coefficients. Thus you want the graphs of
$$\frac{4}{\pi} \sin{x} + \frac{4}{3 \pi} \sin{3 x} + \cdots + \frac{4}{(2 N+1) \pi} \sin{(2 N+1) x}$$
over $x \in [-\pi,\pi]$ for various values of $N$.