Sawtooth Wave:

1/Sqrt[L] Integrate[2/L x Exp[-I m 2 Pi x/L],{x,-L/2,L/2}]
result = Simplify[%,Element[m,Integers]]
a=Table[result,{m,25}]
e[m_,x_] = 1/Sqrt[L] Exp[I m 2 Pi x/L]
ComplexExpand[Sum[2 Re[a[[m]] e[m,x]],{m,1,2}]]
% /. L->1
Plot[%,{x,-1,1},PlotPoints->1000]
ComplexExpand[Sum[2 Re[a[[m]] e[m,x]],{m,1,4}]]
% /. L->1
Plot[%,{x,-1,1},PlotPoints->1000]
ComplexExpand[Sum[2 Re[a[[m]] e[m,x]],{m,1,8}]]
% /. L->1
Plot[%,{x,-1,1},PlotPoints->1000]
Show[%13,%10,%7]
PSPrint[%]
ComplexExpand[Sum[2 Re[a[[m]] e[m,x]],{m,1,16}]]
% /. L->1
Plot[%,{x,-1,1},PlotPoints->1000]
ComplexExpand[Sum[2 Re[a[[m]] e[m,x]],{m,1,25}]]
% /. L->1
Plot[%,{x,-1,1},PlotPoints->1000]
PSPrint[%21]


Full Wave Rectifier Wave:

start with: L=2 Pi

e[m_,x_] = 1/Sqrt[2 Pi] Exp[I m x]
f[x_]=Sin[x/2]
Integrate[f[x] 1/Sqrt[2 Pi]  Exp[-I m x],{x,0,2 Pi}]
result = Simplify[%,Element[m,Integers]]
a=Table[result,{m,25}]
a0 = result /. m->0
ComplexExpand[a0/Sqrt[2 Pi] + Sum[2 Re[a[[m]] e[m,x]],{m,1,2}]]
Plot[%,{x,-2 Pi,2 Pi},PlotPoints->1000]
ComplexExpand[a0/Sqrt[2 Pi] + Sum[2 Re[a[[m]] e[m,x]],{m,1,4}]]
Plot[%,{x,-2 Pi,2 Pi},PlotPoints->1000]
ComplexExpand[a0/Sqrt[2 Pi] + Sum[2 Re[a[[m]] e[m,x]],{m,1,8}]]
Plot[%,{x,-2 Pi,2 Pi},PlotPoints->1000]
Show[%12,%10,%8]
PSPrint[%]
ComplexExpand[a0/Sqrt[2 Pi] +Sum[2 Re[a[[m]] e[m,x]],{m,1,16}]]
Plot[%,{x,-2 Pi,2 Pi},PlotPoints->1000]
ComplexExpand[a0/Sqrt[2 Pi] +Sum[2 Re[a[[m]] e[m,x]],{m,1,25}]]
Plot[%,{x,-2 Pi,2 Pi},PlotPoints->1000]
PSPrint[%]

