Given the function: f(x)={−2, when 2, when −π<x<00<x<πThe fourier series will be of the form: 21a0+n=1∑∞[ancosnx+bnsinnx]Where: a0=π1∫−ππf(x)dx=π1∫−π0f(x)dx+π1∫0πf(x)dx=π1∫−π0−2dx+π1∫0π2dx=[π−2x]−π0+[π2x]0π=0an=π1∫−ππf(x)cosnxdx=π1∫−π0f(x)cosnxdx+π1∫0πf(x)cosnxdx=π1∫−π0−2cosnxdx+π1∫0π2cosnxdx=[nπ−2sinnx]−π0+[nπ2sinnx]0π=nπ4sinnπ=0∀n∈Nbn=π1∫−ππf(x)sinnxdx=π1∫−π0f(x)sinnxdx+π1∫0πf(x)sinnxdx=π1∫−π0−2sinnxdx+π1∫0π2sinnxdx=[nπ2cosnx]−π0+[nπ−2cosnx]0π=nπ2−nπ2cosnπ−nπ2cosnπ+nπ2=nπ4−4cosnπbn={0nπ8 when n is even when n is oddwe can just write n as n=2k−1 where k∈NSo thefore the fourier series for f(x) is given as: f(x)=π8k=1∑∞2k−1sin(2k−1)x
Comments