For both of those integrals, you'll need to break up the region of integration so that you can write a more explicit formula for u(t).
I can solve the integrals, but the answer I'm getting is too complex (no pun intended heh). The answer is supposed to be fourier coefficients that I need to generalize for different values of n, and I don't see how I can get my answer to be what the textbook says.