Fourier Sine Series
ak=0,
bk=(2/L)
Integral from 0 to Pi of f(x)sin(k Pi/L x)

Let's do an example.
f(x) = x for 0<=x<=Pi/2
Pi-x for Pi/2<=x<=Pi
This is a reasonable function, similar to the last one we did above. Here L=Pi.
In[79]:=
Clear[p1,p2,fgraph]
p1=Plot[x,{x,0,Pi/2},DisplayFunction->Identity];
p2=Plot[Pi-x,{x,Pi/2,Pi},DisplayFunction->Identity];
fgraph=Show[p1,p2,DisplayFunction->$DisplayFunction,
AspectRatio->Automatic,
Ticks->{{Pi/2,Pi},Automatic}];

In[80]:=
b[n_]:=(2/Pi)(Integrate[x v[x,Pi,n],{x,0,Pi/2}]+
Integrate[(Pi-x) v[x,Pi,n],{x,Pi/2,Pi}])
Table[b[k],{k,1,10}]
Out[80]=
4 -4 4 -4 4
{--, 0, ----, 0, -----, 0, -----, 0, -----, 0}
Pi 9 Pi 25 Pi 49 Pi 81 Pi
Can you see the pattern?
Let's calculate some partial sums. Be patient.
In[81]:=
Clear[Sn]
Sn=Table[Sum[b[k] v[x,Pi,k],{k,1,n}],{n,1,5}];
Let's see how we did.
In[82]:=
Clear[sn1,sn3,sn5]
In[83]:=
sn1=Plot[Sn[[1]],{x,0,Pi},DisplayFunction->Identity];
Show[fgraph,sn1,PlotLabel->
FontForm["b1sin[x]",{"Helvetica-Bold",12}]];

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

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