Нет у меня желания выискивать Ваши ошибки
a0=4/Pi
an=4cos(Pi*n)/( Pi(1-4n^2) )
bn=0

cos(x/2)=2/Pi+SUM( 4cos(Pi*n)/( Pi(1-4n^2) ) *cos nx );