b=Integrate[x Sin[n x],{x,-Pi,Pi}]/Pi

Simplify[b,Element[n,Integers]]

Simplify[b,n∈Integers]

b=Simplify[b,n∈Integers]

Sum[b Sin[n x],{n,1,4}]

Plot[Sum[b Sin[n x],{n,1,4}],{x,-Pi,Pi}]

Plot[Sum[b Sin[n x],{n,1,10}],{x,-Pi,Pi}]

Plot[Sum[b Sin[n x],{n,1,100}],{x,-Pi,Pi}]

Plot[Sum[b Sin[n x],{n,1,1000}],{x,-Pi,Pi}]

Plot[Sum[b Sin[n x],{n,1,1000}],{x,Pi-0.1,Pi},PlotRange->All]

Plot[Sum[b Sin[n x],{n,1,10000}],{x,Pi-0.1,Pi},PlotRange->All]