Could you help me prove this statements about summation?

I know that the second prove is easy of be written, but can I put that summation before cos(theta) and sin(theta)? yes. But why?
Do you know how can I put explicitly that sumation of cossine and sine according the first and the second members. I were thinking it, because I'd calcule the area of a sine function in a given distance...
Thank you.