The first is to simply note that the average of over a full period is 1/2.
The integral formula is:
where X is the interval over which you are integrating.
I'll leave it to you to do the integration. If you need help, feel free to let me know.