I can't seem to get the right answer on #4 of the questions you posted.
I've tried splitting each integral up from -pi to 0 and from 0 to pi for each a(0), a(n), and b(n).
Then I get that a(0)=pi, a(n)=0, and that b(n)=-cos(n*pi)/n.
My answer for b(n) must be incorrect though as this doesn't produce a series where every term is multiplied by 2 and the even values are missing as in the answer.
I'm not sure where I have gone wrong. Any tips on how to get b(n)?
(If this is unclear I can try to type more of my work out, although I fear that might get messy very fast)
I think that when you compute bn you forget that cos0 is not 0 (it is 1). Secondly, you should evaluate explicitly cos(np); the result depends on the parity of n. We had a similar story in the class; it may be clearer if you take a look at the class notes.