Example
In[120]:=
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 T is 2 (after we do the periodic extension!).
In[121]:=
b=(2/2)Table[Integrate[x Sin[(k Pi/2) x],{x,0,1}]+
Integrate[(2-x) Sin[(k Pi/2) x],{x,1,2}],{k,1,10}];
In[122]:=
b
Out[122]=
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.
In[123]:=
Clear[Sn]
Sn=Table[Sum[b[[k]]Sin[(k Pi/2) x],{k,1,n}],{n,1,10}];
Let's see how we did.
In[124]:=
Clear[sn1,sn3,sn5,sn10]
In[125]:=
sn1=Plot[Sn[[1]],{x,0,2},DisplayFunction->Identity];
Show[fgraph,sn1,PlotLabel->
FontForm["b1sin[Pi/2 x]",{"Helvetica-Bold",12}]];

In[126]:=
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[127]:=
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}]];

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

Up to Periods Other than 2Pi