First, we exploit the evenness of the cosine function to write
Next, we have our first substitution. Let
so that
. Here
and see that
Using some trig we find that
so the integral becomes
Our second substitution aims to obtain the Beta function (not the Gamma function as MaxJasper pointed out). Let
so that
and
. We see that
The beta function is written as
and we need to put our integral into this form. We get
Another way we can express the Beta function is as follows
So
Of course, now that we know what the substitutions are, we can baffle everyone by using the single substitution