Another Example
In[71]:=
Clear[p1,p2,fgraph]
p1=Plot[x,{x,0,1},DisplayFunction->Identity];
p2=Plot[2-x,{x,1,2},DisplayFunction->Identity];
fgraph=Show[p1,p2,DisplayFunction->$DisplayFunction,
AspectRatio->Automatic,
Ticks->{{1,2},Automatic}];

The period here is 4, so L is 2 (after we do the periodic extension!).
In[72]:=
b[n_]:=(2/2)(Integrate[x v[x,2,n],{x,0,1}]+
Integrate[(2-x) v[x,2,n],{x,1,2}]);
Table[b[k],{k,1,10}]
Out[72]=
8 -8 8 -8 8
{---, 0, -----, 0, ------, 0, ------, 0, ------, 0}
2 2 2 2 2
Pi 9 Pi 25 Pi 49 Pi 81 Pi
Can you see the pattern?
Let's calculate some partial sums. Be patient.
In[73]:=
Clear[Sn]
Sn=Table[Sum[b[k] v[x,2,k],{k,1,n}],{n,1,5}];
Let's see how we did.
In[74]:=
Clear[sn1,sn3,sn5,sn10]
In[75]:=
sn1=Plot[Sn[[1]],{x,0,2},DisplayFunction->Identity];
Show[fgraph,sn1,PlotLabel->
FontForm["b1sin[Pi/2 x]",{"Helvetica-Bold",12}]];

In[76]:=
sn3=Plot[Sn[[3]],{x,0,2},DisplayFunction->Identity];
Show[fgraph,sn3,PlotLabel->
FontForm["b1sin[Pi/2 x]+b2sin[Pi x]+b3sin[3Pi/2 x]",{"Helvetica-Bold",12}]];

In[77]:=
sn5=Plot[Sn[[5]],{x,0,2},DisplayFunction->Identity];
Show[fgraph,sn5,PlotLabel->
FontForm["Sum(k=1 to 5) bkSin[kPi/2 x]",{"Helvetica-Bold",12}]];

Up to Fourier Series Examples