Finally, we compute bn: bn=π1∫−ππxsin(nx)dx Since xsin(nx) is an even function, we can write: bn=π2∫0πxsin(nx)dx Using integration by parts, let u=x and dv=sin(nx)dx. Then du=dx and v=−n1cos(nx). ∫xsin(nx)dx=−nxcos(nx)+∫n1cos(nx)dx=−nxcos(nx)+n21sin(nx) Thus,
bn=π2[−nxcos(nx)+n21sin(nx)]0π=π2[−nπcos(nπ)+n21sin(nπ)−(0+0)] Since sin(nπ)=0 and cos(nπ)=(−1)n, we have: bn=π2[−nπ(−1)n]=n2(−1)n+1 Therefore, the Fourier series is:
f(x)=∑n=1∞bnsin(nx)=∑n=1∞n2(−1)n+1sin(nx) f(x)=2[sin(x)−2sin(2x)+3sin(3x)−4sin(4x)+…]