When you have experience with doing time averages and if you remember a key trig identity, you can go from expression 1 to expression 2 in your head, without any work. If you are unable to do that, then you have to formally write out the time average integral, and you will arrive at that result.
To do it in your head, consider the following. The time average of a sum of terms is the sum of the time averages of each term. The term with sin(2wt) is a sine wave with no DC offset, and hence the time average of that part is zero. The terms with cos^2 and sin^2 in them can be handled with a trig identities that say cos^2 and sin^2 are DC shifted cosine waves at twice the frequency. The harmonic variations of a sine or cosine wave always average to the DC value of that sine wave, so you don't need to evaluate any integrals, and the DC components of each term are all that matter.