Integrating Trignometric Functions

I know that to integrate functions like cos(x) you search for the expression which gave cos(x) as its derivative in the first place so the integral of cos(x) will be sin(x).So i should think that the integral of cos(2x) should be sin(2x) but is that correct? Afterall maybe z=2x and the integarl of cos(z) will be sin(z).but i have seen a different expression for the integrals of those trignometric functions which have a coefficient>1 with x,in their domain.i did not really understand what they did and please also give some simple reasoning as to why sin(2x) will be incorrect.

And similarly how will I integrate functions like cos(3x+1) , cos(3x^2) , cos(x^(2x+4)) , cos((3x+4)^99).What is the underling principle behind all of them?

Re: Integrating Trignometric Functions

Consider:

$\displaystyle \int\cos(ax+b)\,dx$ where $\displaystyle a,b$ are constants.

If we use the substitution:

$\displaystyle u=ax+b\,\therefore\,du=a\,dx$

then we have:

$\displaystyle \frac{1}{a}\int\cos(u)\,du=\frac{1}{a}\sin(u)+C= \frac{1}{a}\sin(ax+b)+C$

If the argument of the cosine function is non-linear, that is, its derivative is not constant, then you will need a function that is a constant times this derivative as a factor to the cosine function within the integrand in order to use this substitution technique.