How do they simplify this l don't understand.
I would agree with Drexel28 that the expression on the LHS does not simplify to the RHS. However, $\displaystyle n = 1$ is an identity, so far as I can see:
$\displaystyle \dfrac{8}{1\pi}\,\sin(\pi/2)=8/\pi,$ for the LHS.
$\displaystyle \dfrac{8}{1\pi}\,\dfrac{(-1)^{2}}{2-1}=8/\pi,$ for the RHS.
A better number is $\displaystyle n=2,$ because then you get a zero on the LHS, and there's no way to get a zero on the RHS.
You can simplify the LHS, but not the way they've done. As it turns out, the LHS is zero whenever $\displaystyle n$ is even. So substitute $\displaystyle 2k-1=n$ to obtain
$\displaystyle \dfrac{8}{(2k-1)\pi}\sin((2k-1)\pi/2)=\dfrac{8(-1)^{k-1}}{(2k-1)\pi}.$
The last step there you can do because the sin function oscillates between plus and minus one at odd-integer multiples of $\displaystyle \pi/2.$
Make sense?
2n-1 is always odd for n=1, 2, 3.....
$\displaystyle \displaystyle\frac{8}{n{\pi}}sin\left[\frac{n{\pi}}{2}\right]=\frac{8}{n{\pi}}(-1)^k$
for n odd, as it is zero when n is even.
$\displaystyle k=even$ for multiples of $\displaystyle {\pi}$ being $\displaystyle \frac{4n-3}{2}$
$\displaystyle k=odd$ for multiples of $\displaystyle {\pi}$ being $\displaystyle \frac{4n-1}{2}$
$\displaystyle sin\frac{\pi}2}=sin\frac{5{\pi}}{2}=sin\frac{9{\pi }}{2}=....=sin\frac{(4n-3){\pi}}{2}=1,\;\;\;n=1,\;2,\;3,....$
$\displaystyle sin\frac{3{\pi}}{2}=sin\frac{7{\pi}}{2}=sin\frac{1 1{\pi}}{2}=.....=sin\frac{(4n-1){\pi}}{2}=-1,\;\;\;n=1,\;2,\;3,.....$
As the evaluation of Fourier co-efficients is involved, should you have something similar to
$\displaystyle \displaystyle\frac{8}{n{\pi}}\frac{sin\frac{(2n-1){\pi}}{2}}{2n-1}=\frac{8}{n{\pi}}\frac{(-1)^{n+1}}{2n-1}$ ?
or
$\displaystyle \displaystyle\frac{8}{n{\pi}}\frac{sin(n{\pi}-\frac{\pi}{2})}{2n-1}=\frac{8}{n{\pi}}\frac{(-1)^{n+1}}{2n-1}$