As bonus: lets calculate #intcos^nxdx# and then we will have an special case for #n=4#
#I_n=intcos^nxdx# lets do it by parts
#u=cos^(n-1)x# ; #dv=cosxdx#
#du=(n-1)cos^(n-2)x(-sinx)dx# and #v=sinx#
#I_n=sinxcos^(n-1)x+int(n-1)sin^2xcos^(n-2)x=#
#=sinxcos^(n-1)x+(n-1)int(1-cos^2x)cos^(n-2)xdx=#
#=sinxcos^(n-1)x+(n-1)intcos^(n-2)xdx-intcos^nxdx#
Then we have
#I_n=sinxcos^(n-1)x+(n-1)I_(n-2)-I_n#
#2I_n=sinxcos^(n-1)x+(n-1)I_(n-2)#
And we get the reduction formula
#I_n=(sinxcos^(n-1)x)/2+(n-1)/2I_(n-2)#
#n=0ddots#; #I_0=intcos^0xdx=intdx=x#
#n=1ddots# #I_1=intcosxdx=sinx#
#n=2 ddots#; #I_2=intcos^2xdx=(sinxcosx)/2+1/2I_0=(sinxcosx)/2+1/2x#
#n=3ddots#;#I_3=(sinxcos^2x)/2+cancel2/cancel2sinx#
#n=4ddots#;#I_4=(sinxcos^3x)/2+3/2I_2=#
#=(sinxcos^3x)/2+3/2((sinxcosx)/2+1/2x)=#
#=(sinxcos^3x)/2+(3sinxcosx)/4+3/4x#
And so on....
You can use other trigonometric identities to resume the final expresion...